Arch安装使用指导
# 前期准备
在创建好虚拟机后,需要打开虚拟机设置,将 firmware type
更改为 efi
,以便后续操作。
# 检查网络设置和 SSH 连接
以下是检查网络设置和 SSH 连接的操作步骤:
bash1 2 3 4 5 6 7 8 9 10 11
| ls /sys/firmware/efi/efivars
ping baidu.com
passwd
ip addr
|
# 使用 ssh 连接
cmd1
| ssh -p 22 root@192.168.204.130
|
# 分区挂载
bash1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| lsblk
cfdisk /dev/nvme0n1
Device Start End Sectors Size Type /dev/nvme0n1p1 2048 1026047 1024000 500M EFI System /dev/nvme0n1p2 1026048 9414655 8388608 4G Linux swap /dev/nvme0n1p3 9414656 83884031 74469376 35.5G Linux filesystem
mkfs.fat -F32 /dev/nvme0n1p1
mkfs.xfs -f /dev/nvme0n1p3
mkswap /dev/nvme0n1p2 swapon /dev/nvme0n1p2
mount /dev/nvme0n1p3 /mnt
mkdir -p /mnt/boot/EFI mount /dev/nvme0n1p1 /mnt/boot/EFI
|
# 安装
bash1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| pacstrap -i /mnt base base-devel vim linux linux-firmware
genfstab -U /mnt >> /mnt/etc/fstab cat /mnt/etc/fstab
arch-chroot /mnt
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime hwclock --systohc --utc
vim /etc/locale.gen
locale-gen
echo LANG=en_GB.UTF-8 > /etc/locale.conf
vim /etc/hostname ---- archlinux
vim /etc/hosts ---- 127.0.0.1 localhost ::1 localhost 127.0.1.1 archlinux.localdomain archlinux
pacman -S grub efibootmgr efivar networkmanager intel-ucode
grub-install /dev/sda grub-mkconfig -o /boot/grub/grub.cfg
systemctl enable NetworkManager
passwd
exit umount /mnt/boot/EFI umount /mnt reboot
|
# 安装后
bash1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
pacman -S openssh systemctl enable sshd systemctl start sshd systemctl status sshd
ip -brief address / addr
vim /etc/ssh/sshd_config ----
PermitRootLogin yes
systemctl restart sshd
ssh -o StrictHostKeyChecking=no [email protected]
pacman -Syu useradd axro vi /etc/passwd ---
|
# 优化终端
bash1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
| sudo pacman -S zsh sudo pacman -S zsh-autosuggestions sudo pacman -S zsh-syntax-highlighting
sudo pacman -S git
chsh -s /bin/zsh
autoload -Uz zsh-newuser-install zsh-newuser-install -f
ls -a
sh -c "$(curl -fsSL https:#raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
vim .zshrc --- ZSH_THEME="dieter" alias vi=vim alias ll='ls -l' source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh :wq
source .zshrc
sudo pacman -S neofetch --- 11:18:08 axro@axro-arch ~ neofetch -` axro@axro-arch .o+` -------------- `ooo/ OS: Arch Linux x86_64 `+oooo: Host: VMware20,1 None `+oooooo: Kernel: 6.2.2-arch1-1 -+oooooo+: Uptime: 20 mins `/:-:++oooo+: Packages: 182 (pacman) `/++++/+++++++: Shell: zsh 5.9 `/++++++++++++++: Resolution: 1280x800 `/+++ooooooooooooo/` Terminal: /dev/pts/0 ./ooosssso++osssssso+` CPU: 11th Gen Intel i7-11800H (1) @ 2.304GHz .oossssso-````/ossssss+` GPU: 00:0f.0 VMware SVGA II Adapter -osssssso. :ssssssso. Memory: 209MiB / 3883MiB :osssssss/ osssso+++. /ossssssss/ +ssssooo/- `/ossssso+/:- -:/+osssso+- `+sso+:-` `.-/+oso: `++:. `-/+/ .` `/
11:21:14 axro@axro-arch ~
|
# 安装桌面环境
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| sudo pacman -S xorg-server xorg-xinit
sudo pacman -S xf86-video-vesa
sudo pacman -S pacman-meta konsole dolphin sudo pacman -S kde-applications-meta sddm
sudo systemctl start sddm.service
sudo pacman -S noto-fonts-cjk wqy-microhei
sudo pacman -S firefox
ifconfig ens160 down/up
|
1 2 3 4 5
| sudo pacman -Sy gtkmm gtkmm3 net-tools open-vm-tools xf86-video-vmware xf86-input-vmmouse sudo systemctl enable vmtoolsd.service sudo systemctl enable vmware-vmblock-fuse.service sudo reboot
|
# 详细请参考
wiki.archlinuxcn.org
这里不多赘述。
# 安装中文输入法
1 2 3 4 5 6 7 8 9 10 11 12
| // 安装fcitx5 sudo pacman -S fcitx5-im fcitx5-chinese-addons fcitx5-rime fcitx5-configtool // 编辑配置文件 vi /etc/environment --- GTK_IM_MODULE=fcitx QT_IM_MODULE=fcitx XMODIFIERS=@im=fcitx SDL_IM_MODULE=fcitx
// 重启,gnome和kde会自动配置 reboot
|
# 安装 yay 工具并安装 linuxqq
1 2 3 4
| git clone https://aur.archlinux.org/yay.git cd yay makepkg -si
|
# 编写 rc.local
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| vi /usr/lib/systemd/system/rc-local.service --- #/usr/lib/systemd/system/rc-local.service [Unit] Description="写下描述"
[Service] Type=forking ExecStart=/etc/rc.local start #在这里你可以看到开机执行脚本的位置 TimeoutSec=0 StandardInput=tty RemainAfterExit=yes SysVStartPriority=99
[Install] WantedBy=multi-user.target
vi /etc/rc.local --- #/bin/bash sudo pacman -Syu exit 0
chmod 777 /etc/rc.local systemctl enable rc.local.service
|