manjaro/endeavourOS/Arch linux 折腾手记

最后更新2025-09-09

我的日常所用电脑已逐步切换至manjaroendeavourOSArch linux录下安装配置过程,方便折腾。

一、基本配置

   0、首先配置科学上网环境,方便后面的操作   
   安装前下载好v2rayN,下载AppImage格式的,图形化界面,无需安装。系统安装后,将v2rayN复制到linux,右击文件-属性-权限,勾选“允许将文件作为程序运行”。在CLI命令行下运行,启动后再进行配置。
   以下命令在CLI下临时启用代理,或直接在v2rayN里启用Tun
export http_proxy=http://127.0.0.1:10808; export https_proxy=$http_proxy
1、选择国内源:
 编辑修改配置文件
nano   /etc/pacman.d/mirrorlist 
对于manjaro加入以下内容
Server = https://mirrors.aliyun.com/manjaro/stable/$repo/$arch
对于endeavourOS和Arch linux,则是以下地址。官方推荐源在此
Server = https://mirrors.aliyun.com/archlinux/$repo/os/$arch
保存后刷新缓存,更新系统
sudo pacman -Syu
2、安装nano等常用软件
sudo pacman -S nano vlc  telegram-desktop  xdotool doublecmd
xdotool是类似于按键精灵的鼠标键盘模拟软件,dublecmd是类似于total commander的文件管理软件。
安装libreoffice
sudo pacman -S libreoffice libreoffice-zh-CN 
3、安装AUR助手yay 
sudo pacman -S --needed git base-devel && git clone https://aur.archlinux.org/yay-bin.git && cd yay-bin && makepkg -si
安装yay,以后安装东西直接yay -S 包名(yay 的用法与 pacman 完全类似)

此网站 搜索相关软件的包名称,然后yay -S安装。

4、安装chrome浏览器、snipaste截图、filezilla文件传输、代码编辑、edge浏览器、文件下载等软件。
yay -S google-chrome snipaste filezilla vscode  microsoft-edge-stable-bin uget aria2
chrome安装proxy switchyomega插件

配置uGet和aria2
打开uget,点击edit->setting,点击插件,选aria2,其他默认即可,点击ok。
如果出现不能下载的问题,如uGet弹出Error occourred when downloading。可能是aria2的问题,终端执行以下命令
aria2c --daemon --enable-rpc=true
5、系统默认的VPN如果不支持L2TP/IPSec的话,需要安装相关软件
yay -S networkmanager-l2tp  strongswan xl2tpd
然后在设置-网络 里配置VPN。

二、安装字体
安装霞鹜文楷字体
yay -S ttf-lxgw-wenkai
若有已经下载好的字体文件,如 仓耳今楷,则将字体文件复制到以下文件夹
sudo cp  仓耳今楷03-W04.ttf /usr/share/fonts/TTF
再刷新字体即可
fc-cache -fv
KDE桌面在系统设置->外观->字体里更改相应字体,Gnome桌面在优化(tweak)->字体里修改
chrome等其他浏览器可以在浏览器设置里改一下字体风格。

三、安装中州韵rime输入法
linux下有二个流行的输入法框架,ibus和fcitx5,但二个好像不能并存。
1、fcitx5框架(选择安装全部4个组件)
sudo pacman -S  fcitx5-im  fcitx5-rime
 在“系统设置”-“键盘”-“虚拟键盘”里选择 fcitx5 。
注销下系统看输入法是否正常,不正常的话可能需要设置环境变量
sudo nano  /etc/environment
加入以下内容
GTK_IM_MODULE=fcitx
QT_IM_MODULE=fcitx
XMODIFIERS=@im=fcitx 
注销下系统,然后右键点击fcitx5托盘图标,可进行相关设置。
快捷键Ctrl + ` 打开设置菜单,可在简体繁体、全角半角切换等。

RIME输入法应该可以用了,但可以进一步配置RIME。下载并复制雾凇拼音配置文件到  ~/.local/share/fcitx5/rime。默认的配置文件是 ~/.local/share/fcitx5/rime/default.yaml,如候选词个数就在此文件里修改。
git clone https://github.com/iDvel/rime-ice.git
cp -r rime-ice/*  ~/.local/share/fcitx5/rime
fcitx5会自动根据显示器不同的DPI来调整界面大小,不满意的话也可自定义设置修改  ~/.config/fcitx5/conf/classicui.conf
# 按屏幕 DPI 使用
PerScreenDPI=False

# Font (设置成你喜欢的字体)
Font="TsangerJinKai03 15"
使用hosxy的Material-color皮肤,安装非常方便,依照Readme操作即可,效果非常惊艳。
mkdir -p ~/.local/share/fcitx5/themes/Material-Color
git clone https://github.com/hosxy/Fcitx5-Material-Color.git ~/.local/share/fcitx5/themes/Material-Color
设置配色方案
cd ~/.local/share/fcitx5/themes/Material-Color
ln -sf ./theme-blue.conf theme.conf
启用主题
修改配置文件  ~/.config/fcitx5/conf/classicui.conf ,加入以下内容
# 主题
Theme=Material-Color
要使用单行模式,新建/修改 ~/.config/fcitx5/conf/rime.conf ,加入/修改以下内容:
# 可用时在应用程序中显示预编辑文本
PreeditInApplication=True
最后,注销下系统应该效果就可以出来了。

2、ibus框架
sudo pacman -S  ibus ibus-rime 
下载雾凇拼音配置文件
git clone https://github.com/iDvel/rime-ice.git
复制到目录 ~/.config/ibus/rime
cp -r rime-ice/* ~/.config/ibus/rime
输入法设置里点击“部署”或注销下系统就OK。

四、安装配置zsh
 安装zsh
sudo pacman -S zsh
查看当前shell
echo $SHELL
使用zsh替换bash(重启电脑生效)
chsh -s /bin/zsh
还原bash
chsh -s /bin/bash
安装 oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
安装二个很有用的插件zsh-autosuggestions及zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions.git ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
修改配置文件
nano  ~/.zshrc
为以下内容即可,主题根据自己偏好选择
export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="random"
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)
source $ZSH/oh-my-zsh.sh
使之生效
source  ~/.zshrc
完后打开终端即为 on-my-zsh(有的可能要注销一下)

五、安装科学上网环境

 1、sing-box ,新一代通用网络代理平台,基本上目前流行的协议都支持,支持基于规则的分流、支持TUN等,有网络代理平台的“瑞士军刀”之称。安装参考这里 。
curl -fsSL https://sing-box.app/install.sh | sh
编辑配置文件 /etc/sing-box/config.json,参考这里 。
nano /etc/sing-box/config.json
设置开机自启动
systemctl enable --now sing-box

 2、clash(mihomo)是一款用Go开发的基于规则分流的适用于Linux/MacOS/Windows等多平台的客户端,支持ss/v2ray/xray/trojan(trojan-go)等协议 ,在此下载
    编辑配置文件config.yaml ,参考这里。 如下示例:将域名,uuid,ws-path,密码等换成自己的。
mode: rule
log-level: info
ipv6: true
allow-lan: true
mixed-port: 7890
tcp-concurrent: true

external-controller: 0.0.0.0:9090
#external-ui: /etc/dashboard
secret: "123456"

geox-url:
geoip: "https://fastly.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geoip.dat"
geosite: "https://fastly.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geosite.dat"
mmdb: "https://fastly.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geoip.metadb"

find-process-mode: strict
global-client-fingerprint: chrome

profile:
store-selected: false
store-fake-ip: true

sniffer:
enable: true
sniff:
QUIC:
TLS:
ports: [443, 8443]
HTTP:
ports: [80, 8080-8880]
override-destination: true

tun:
enable: false
stack: system
dns-hijack:
- 'any:53'
auto-detect-interface: true

dns:
cache-algorithm: arc
enable: true
listen: :53
ipv6: true
enhanced-mode: fake-ip
fake-ip-range: 198.18.0.1/16
default-nameserver:
- 223.5.5.5
- 8.8.8.8
nameserver:
- tls://223.5.5.5:853
- https://doh.pub/dns-query
fallback:
- https://1.0.0.1/dns-query
- tls://dns.google
fallback-filter:
geoip: true
geoip-code: CN
ipcidr:
- 240.0.0.0/4

proxies:
- name: "v2ray"
type: vmess
server: mydomain.com
port: 443
uuid: your-uuid
alterId: 0
cipher: auto
udp: true
tls: true
network: ws
skip-cert-verify: true
ws-opts:
path: /your-ws-path
headers:
Host: mydomain.com
- name: "trojan"
type: trojan
server: bbs.mydomain.com
port: 443
password: "password"
network: ws
sni: bbs.mydomain.com
skip-cert-verify: true
udp: true
ws-opts:
path: /your-ws-path
headers:
Host: bbs.mydomain.com
- name: "xray"
type: vless
server: free.mydomain.com
port: 443
uuid: your-uuid
network: tcp
tls: true
udp: true
flow: xtls-rprx-vision
client-fingerprint: chrome
# fingerprint: xxxx
# skip-cert-verify: true


proxy-groups:
- name: Auto
type: url-test
proxies:
- v2ray
- xray
- trojan
url: https://cp.cloudflare.com/generate_204
interval: "600"
tolerance: "150"

# select 用户自行选择节点
- name: Proxy
type: select
proxies:
- Auto
- v2ray
- xray
- trojan

rules:
- GEOSITE, CN, DIRECT
- GEOSITE, private, DIRECT
- GEOSITE, geolocation-!cn, Proxy
- GEOIP, CN, DIRECT
- MATCH, Proxy
最后,安装webUImetacubexd 。可以部署到免费云服务上,如cloudflare或vercel,我在vercel了配置一个,在这里

六、安装tailscale,参考这里 ,或netbird,参考这里
    1、tailscale安装
curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up 
复制生成的连接到浏览器访问,登录并授权
查看状态
tailscale status
启用访问子网路由功能
sudo tailscale up --accept-routes
    2、netbird安装
curl -fsSL https://pkgs.netbird.io/install.sh | sh
客户端连入netbird组网
netbird up --management-url https://nb.mydomain.com:443
查看相关信息
netbird status -dA
七、美化

我选择的 桌面主题组合是主题 Mc-OS-themes 、图标 la-capitaine-icon-theme

GNOME桌面主题在 github 上的源码
git clone https://github.com/vinceliuice/Mojave-gtk-theme.git
在终端里cd到此文件夹下
./install.sh
图标:位置在/usr/share/icons,clone后复制到此文件夹即可
git clone https://github.com/keeferrourke/la-capitaine-icon-theme.git
sudo cp -r la-capitaine-icon-theme /usr/share/icons
在 【优化】(tweaks)进行外观管理, 选择相关主题、图标即可。

KDE桌面在 github 上的源码
git clone https://github.com/vinceliuice/McMojave-kde.git
在终端里cd到此文件夹下
./install.sh
在 【系统设置】-【外观】中可以进行外观管理, 选择相关主题即可。

KDE窗口设置:

开始菜单点击【系统设置】-【外观】下的【应用程序风格】

选择【窗口装饰】右下角的【获取新窗口装饰】

我安装的mcmojave,这个是苹果的修饰,安装后在窗口装饰这里选择即可。

八、HP打印机安装
sudo pacman -S hplip
打开 “设置”-“打印机”,若可以识别你的打印机,直接添加即可。否则按以下步骤配置
sudo pacman -S cups 
如果已经安装则跳过,然后
sudo systemctl start cups.service 
加入开机启动
sudo systemctl enable  cups.service 
用浏览器打开网址 http://localhost:631/

依次选择Administration > Add Printer(输入root及密码) > 选中打印机 > 点击 Continue >勾选 Share This Printer > Continue > 选中打印机型号 > Add Printer完成添加。完成添加后,点击打印机名称,可以修改默设置、维护等操作。

九、配置SSH通过代理连接远程服务器

首先安装netcat,使用nc -h查看是否有-X参数,如果没有,那就需要安装其它版本的netctat。对于manjaro ,默认使用的是gnu-netcat,需要换为openbsd-netcat
sudo pacman -S openbsd-netcat
示例
通过本地Socks5代理访问SSH
ssh -o ProxyCommand='nc -X 5 -x 127.0.0.1:1081 %h %p' myusername@ssh-server
通过本地Http代理访问SSH
ssh -o ProxyCommand='nc -X connect -x 127.0.0.1:1080 %h %p' myusername@ssh-server
十、其他配置问题
(一)、Dolphin 是KDE默认的文件管理器,几点优化配置:
双击打开文件(夹):打开“系统设置”=>“工作空间行为”=>“常规行为”可以看见这一选项。

Dolphin中使用 Del 键是很危险的:它会在没有任何确认的情况下直接删除你的文件。可以在菜单栏"设置"=>"配置Dolphin"=>"常规"=>"确认"中打开文件删除确认。
Dolphin菜单栏"视图"里设置是否显示隐藏文件。

(二)、Grub 设置
在默认情况下我们打开 grub 引导菜单以后只有5秒钟的时间选择系统,这个能会带来些许不便。可以通过以下命令来修改 grub 配置:
sudo nano /etc/default/grub   
sudo update-grub             # 更新 grub 配置
(三)、解决Windows和Linux双系统时间不一致问题
sudo timedatectl set-local-rtc 1
 (四)、关于Arch linux的安装,官方文档相当详细,使得初次接触的人觉得很复杂。实际上问chatgpt或gemini,会给出一个精简的安装指南,而且联网配置、分区等命令的使用以及安装过程出现的相关问题,问chatgpt及gemini,基本上都能得到解决。
下面是chatgpt写的一个 Arch Linux 安装指南(UEFI)。

1. 准备工作
下载镜像:从 Arch 官方网站下载最新 ISO。
制作启动盘:使用ventory 制作 U 盘启动盘。
联网:建议使用有线网络,安装时更稳定。

2. 启动系统
进入 BIOS,设置 UEFI 启动模式,从 USB 启动,进入 Arch Linux Live 环境。
默认会进入命令行界面。若字体太小的话
setfont ter-132b      #数字越小,字体越小

3. 检查网络
ping archlinux.org
能 ping 通就说明网络正常。

如果用 Wi-Fi:
iwctl
# 进入交互模式
device list
station wlan0 scan
station wlan0 get-networks
station wlan0 connect <WiFi名>
exit

4. 系统时间
timedatectl set-ntp true
timedatectl status                   #时间设置一定要正确,否则安装软件时可能会出现“签名无效”之类的错误

显示 System clock synchronized: no 通常意味着没有正确运行或配置
 编辑NTP 服务配置文件 /etc/systemd/timesyncd.conf,加入以下内容 

[Time]
NTP=ntp.aliyun.com

保存文件并重启
systemctl restart systemd-timesyncd

5. 分区与格式化
查看磁盘:
lsblk

假设目标磁盘是 /dev/nvme0n1。推荐分区:

EFI 分区:/dev/nvme0n1p1,大小 512MB,FAT32

根分区:/dev/nvme0n1p2,ext4或btrfs
(如果需要 swap,可单独分一块,如 4~8GB)

分区工具可用 cfdisk /dev/nvme0n1

格式化:

mkfs.fat -F32 /dev/nvme0n1p1
mkfs.ext4 /dev/nvme0n1p2

6. 挂载分区
mount /dev/nvme0n1p2 /mnt         #注意,首先挂载根分区

mount /dev/nvme0n1p1 /mnt/boot/efi   --mkdir

7. 安装基础系统
pacstrap  -K  /mnt base linux linux-firmware sudo dhcpcd nano networkmanager

8. 配置系统
生成 fstab:

genfstab -U /mnt >> /mnt/etc/fstab

核对fstab文件内是否有误:

cat /mnt/etc/fstab

进入新系统:

arch-chroot /mnt

设置时区:

ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
hwclock  --systohc

设置本地化:

nano  /etc/locale.gen
# 去掉 en_US.UTF-8 UTF-8 和 zh_CN.UTF-8 UTF-8 前的注释
locale-gen
echo "LANG=en_US.UTF-8" > /etc/locale.conf

设置主机名:

echo "archpc" > /etc/hostname

设置 root 密码:

passwd

9. 安装引导程序
pacman -S grub efibootmgr os-prober
grub-install  --target=x86_64-efi  --efi-directory=/boot/efi  --bootloader-id=Archlinux
grub-mkconfig -o /boot/grub/grub.cfg

10. 网络管理
启用 NetworkManager:
systemctl enable NetworkManager

11. 创建普通用户
useradd -m -G wheel -s /bin/bash yourname
passwd yourname

编辑 sudo 权限:

EDITOR=nano visudo
# 去掉 %wheel ALL=(ALL:ALL) ALL 前的注释

12. 退出 & 重启
exit
umount -R /mnt
reboot

拔掉 U 盘,进入 Arch Linux 系统。

13. 安装桌面环境
更新系统:
sudo pacman -Syu

安装常见桌面环境(如KDE)及相应软件:

sudo pacman -S plasma  sddm ark dolphin konsole kate openssh
sudo systemctl enable sddm

KDE自动登录:
nano /etc/sddm.conf  #加入以下内容

[Autologin]
User=yourusername    #将 yourusername 替换为你要自动登录的用户名
Session=plasma


✅ 至此,一个完整的 Arch Linux 基础系统就安装好了!

评论

热门博文

Xray安装配置VLESS-XTLS-Vision及VLESS-XTLS-uTLS-REALITY

V2Ray安装配置VMESS-TLS及VMESS-TLS-WS

在VPS上轻松搭建L2TP/IPSec图文教程(通吃各种架构的VPS,包括KVM,OpenVZ等)