准备工作 windows 上使用的分区上分出空闲硬盘空间给 archlinux 下载archlinux镜像 启动u盘 ventoy 关闭windows 快速启动,BIOS 安全启动 安装配置网络 iwctl device list station wlan0 scan station wlan0 get-networks station wlan0 connect BUPT-D39u exit
测试网络
更新系统时间 timedatectl set-ntp true timedatectl status
更换国内源 vim /etc/pacman.d/mirrorlist Server = https://mirrors.ustc.edu.cn/archlinux/$repo /os/$arch
分区 lsblk cfdisk /dev/nvme0n1 lsblk mkfs.ext4 /dev/nvme0n1p5 mount /dev/nvme0n1p5 /mnt mkdir /mnt/bootlsblk mount /dev/nvme0n1p2 /mnt/boot
安装系统 pacman -Sy archlinux-keyring pacstrap /mnt base base-devel linux linux-firmware btrfs-progs
生成fastb文件 genfstab -U /mnt >> /mnt/etc/fstab cat /mnt/etc/fstab
切换装好的系统 创建swapfile dd if =/dev/zero of=/swapfile bs=2048 count=1048576 status=progresschmod 600 /swapfile mkswap /swapfile swapon /swapfile vim /etc/fstab
时区和硬件时钟 timedatectl set-timezone Asia/Shanghai hwclock --systohc
Locale Locale 决定了软件使用的语言、书写习惯和字符集。
vim /etc/locale.gen locale-gen echo 'LANG=en_US.UTF-8' > /etc/locale.conf
host vim /etc/hostname 127.0.0.1 localhost ::1 localhost 127.0.1.1 arch.localdomain arch
设置root用户密码 驱动器 grub pacman -S grub efibootmgr networkmanager network-manager-applet dialog wireless_tools wpa_supplicant os-prober mtools dosfstools ntfs-3g base-devel linux-headers reflector git sudo pacman -S intel-ucode
启用os-prober识别Windows
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=Arch
生成 grub.cfg
grub-mkconfig -o /boot/grub/grub.cfg
完成安装
设置网络 进去输入root加密码 启动网络服务
systemctl enable --now NetworkManager nmtui
新建用户 useradd -m -G wheel fantasy passwd mir EDITOR=vim visudo
添加archlinuxcn源 vim /etc/pacman.conf [archlinuxcn] Server = https://mirrors.bfsu.edu.cn/archlinuxcn/$arch pacman -Syu && pacman -S archlinuxcn-keyring sudo pacman -S yay
中文字体 pacman -S ttf-sarasa-gothic noto-fonts-cjk yay -S nerd-fonts-jetbrains-mono yay -S ttf-material-design-icons yay -S ttf-joypixels yay -S ttf-dejavu
驱动 sudo pacman -S mesa lib32-mesa vulkan-intel lib32-vulkan-intel
音频和蓝牙 sudo pacman -S pipewire-pulse sudo pacman -S pavucontrol sudo pacman -S bluez bluez-utils bluedevil pactl load-module module-bluetooth-discover sudo vim /etc/bluetooth/main.conf FastConnectable=true AutoEnable=true
修复本机小新pro14,内置键盘和声音
pacman -S sof-firmware alsa-ucm-conf vim /etc/default/grub
屏幕亮度
yay -S light sudo usermod -a -G video "用户名"
安装dwm和基本软件 yay -S xorg picom neovim feh redshift-gtk rofi thunar flameshot xautolock i3lock-color wmname git clone https://gitee.com/fantasy06/dotfiles.git cd ~/dotfiles ln -s ~/dotfiles/dwm ~/.config/ln -s ~/dotfiles/st ~/.config/ln -s ~/dotfiles/nvim ~/.config/ln -s ~/dotfiles/wallpaper ~/Pictures/ln -s ~/dotfiles/scripts ~/ln -s ~/dotfiles/.xinitrc ~/ln -s ~/dotfiles/.Xresources ~/ln -s ~/dotfiles/.profile ~/cd ~/.config/st && sudo make install cleancd ~/.config/dwm && sudo make install cleanstartx
zsh 安装配置 sudo pacman -Sy zsh sudo pacman -S zsh-autosuggestions zsh-syntax-highlighting zsh-theme-powerlevel10k zsh-completions chsh -s /usr/bin/zsh ln -s ~/dotfiles/.zshrc ~/ln -s ~/dotfiles/.p10k.zsh ~/
中文输入法 sudo pacman -S fcitx5 fcitx5-qt fcitx5-gtk fcitx5-config-qt fcitx5-material-color fcitx5-im fcitx5-rime sudo echo ' GTK_IM_MODULE=fcitx QT_IM_MODULE=fcitx XMODIFIERS=@im=fcitx SDL_IM_MODULE=fcitx GLFW_IM_MODULE=ibus' >> /etc/environment
触控板 yay -S xf86-input-synaptics sudo pacman -S wmctrl xdotool libinput-gestures sudo gpasswd -a $USER input sudo vim /etc/X11/xorg.conf.d/30-touchpad.conf Section "InputClass" Identifier "touchpad" Driver "libinput" MatchIsTouchpad "on" Option "Tapping" "on" Option "TappingButtonMap" "lrm" EndSection cp /etc/libinput-gestures.conf ~/.config/libinput-gestures.confvim ~/.config/libinput-gestures.conf gesture swipe left 4 xdotool key Super+Shift+Tab gesture swipe right 4 xdotool key Super+Tab gesture swipe up 4 xdotool key Super+f gesture swipe down 4 xdotool key Super+a gesture swipe left 3 xdotool key Super+Left gesture swipe right 3 xdotool key Super+Right gesture swipe up 3 xdotool key Super+Up gesture swipe down 3 xdotool key Super+h
自动锁屏 sudo vim /etc/X11/xorg.conf.d/10-monitor.conf Section "ServerLayout" Identifier "ServerLayout0" Option "BlankTime" "10" Option "StandbyTime" "20" Option "SuspendTime" "30" Option "OffTime" "60" EndSection
日常软件 yay -S lxappearance yay -S paper-gtk-theme-git yay -S pavucontrol yay -S breeze-icons yay -S rofi yay -S flameshot yay -S google-chrome wyeb-git yay -S byzanz yay -S libnotify dunst yay -S xorg-xsetroot yay -S xf86-input-synaptics yay -S network-manager-applet yay -S mpc mpd ncmpcpp yay -S picgo-appimage yay -S xmind yay -S deepin-wine-wechat yay -S dingtalk-bin yay -S wps-office-cn wps-office-mui-zh-cn ttf-wps-fonts /opt/apps/com.qq.weixin.deepin/files/run.sh -d env WINEPREFIX="$HOME /.deepinwine/Deepin-WeChat" /usr/bin/deepin-wine winecfgyay -S linuxqq yay -S yesplaymusic yay -S qqmusic-bin yay -S baidunetdisk-bin yay -S clash clash-for-windows-bin yay -S copyq yay -S atril yay -S gimp
编程开发 sudo pacman -S nodejs sudo pacman -S npm sudo pacman -S php yay -S jdk sudo pacman -S mysql sudo mysqld --initialize --user=mysql --basedir=/usr --datadir=/var/lib/mysql sudo systemctl start mysqld.service mysql -uroot -p alter user 'root' @'localhost' identified by '123456' ; use mysql; GRANT ALL PRIVILEGES ON *.* TO 'root' @'%' IDENTIFIED BY '123456' ; sudo systemctl enable mysqld.service yay -S navicat16-premium-cs yay -S visual-studio-code-bin yay -S wechat-devtools-bin yay -S intellij-idea-ultimate-edition
修复键盘f区问题 在Linux上,Keychon K2不会将任何F1-F12功能键映射为实际的F键 而是默认将它们视为多媒体键。 Fn+F1-12的组合也不会起作用
键盘切换到window模式 长按Fn + X + L将F1-F12优先映射到功能键而不是媒体键 写入 echo 0 | sudo tee /sys/module/hid_apple/parameters/fnmodeecho "options hid_apple fnmode=0" | sudo tee -a /etc/modprobe.d/hid_apple.confmkinitcpio -p
参考来源连接安装 安装 dwm 键盘