参考
archlinux
先联网
[root@archiso~] iwctl [iwd#]device list #查询机器的网卡设备,如wlan0之类。 [iwd#]station <devicename> scan #查询附近可用的wifi网络: [iwd#]station <devicename> get-networks #显示扫描的结果 [iwd#]station <devicename> connect <wifi-ssid> #连接wifi网络 如果wifi加密,会提示你输入密码。
|
测试
如果是用网线:dhcpcd
测试网络:ping www.baidu.com
ssh远程安装
pacman -Syy Pacman -Syy openssh passwd systemctl start sshd ifconfig
|
tenda网卡驱动
连接
china源
gen
## ## Arch Linux repository mirrorlist ## Generated on 2021-06-21 ##
## China #Server = http://mirrors.163.com/archlinux/$repo/os/$arch #Server = http://mirrors.bfsu.edu.cn/archlinux/$repo/os/$arch #Server = https://mirrors.bfsu.edu.cn/archlinux/$repo/os/$arch #Server = http://mirrors.cqu.edu.cn/archlinux/$repo/os/$arch #Server = https://mirrors.cqu.edu.cn/archlinux/$repo/os/$arch #Server = http://mirrors.dgut.edu.cn/archlinux/$repo/os/$arch #Server = https://mirrors.dgut.edu.cn/archlinux/$repo/os/$arch #Server = http://mirrors.hit.edu.cn/archlinux/$repo/os/$arch #Server = https://mirrors.hit.edu.cn/archlinux/$repo/os/$arch #Server = http://mirror.lzu.edu.cn/archlinux/$repo/os/$arch #Server = http://mirrors.neusoft.edu.cn/archlinux/$repo/os/$arch #Server = https://mirrors.neusoft.edu.cn/archlinux/$repo/os/$arch #Server = http://mirrors.nju.edu.cn/archlinux/$repo/os/$arch #Server = https://mirrors.nju.edu.cn/archlinux/$repo/os/$arch #Server = http://mirror.redrock.team/archlinux/$repo/os/$arch #Server = https://mirror.redrock.team/archlinux/$repo/os/$arch #Server = https://mirrors.sjtug.sjtu.edu.cn/archlinux/$repo/os/$arch #Server = http://mirrors.tuna.tsinghua.edu.cn/archlinux/$repo/os/$arch #Server = https://mirrors.tuna.tsinghua.edu.cn/archlinux/$repo/os/$arch #Server = http://mirrors.ustc.edu.cn/archlinux/$repo/os/$arch #Server = https://mirrors.ustc.edu.cn/archlinux/$repo/os/$arch #Server = https://mirrors.xjtu.edu.cn/archlinux/$repo/os/$arch #Server = http://mirrors.zju.edu.cn/archlinux/$repo/os/$arch
|
时钟同步
timedatectl set-ntp true timedatectl status
|
更新源
reflector -c China -a 6 --sort rate --save /etc/pacman.d/mirrorlist pacman -Syy #执行刷新
|
分区
fdisk -l #查看分区列表 fdisk /dev/sda #选择此分区操作(设置的磁盘所在的分区,可根据类型或容量区分)
->n 新建分区,p 类型为主分区, 1/2 分区序号, First sector 起始扇区, End sector 结束扇区 ->w 保存修改
/boot 1G /home 64G /swap 8G /mnt 32G
boot-->mkfs.vfat home mnt -->mkfs.ext4 swap -->mkswap
mount /dev/sd?? /dir swapon /dev/sd?? lsblk 列出块设备信息(确认挂载成功)
|
安装系统
pacman -Sy archlinux-keyring pacstrap /mnt base linux linux-firmware base-devel vim
|
生成硬件信息
genfstab -U /mnt >> /mnt/etc/fstab cat /mnt/etc/fstab #查看硬盘信息是否正确
|
系统已挂在到/mnt ,切换到系统
设置时区
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime hwclock --systohc
|
设置语言
vim /etc/locale.gen
en_US.UTF-8 UTF-8 zh_CN.UTF-8 UTF-8 zh_TW.UTF-8 UTF-8 去除注释
locale-gen -->更新配置 echo "LANG=en_US.UTF-8" >> /etc/locale.conf 设置系统语言(中文 LANG=zh_CN.UTF-8)
|
设置计算机名
echo "Heaven" >> /etc/hostname
|
设置Host文件
vim /etc/hosts #写入 127.0.0.1 localhost ::1 localhost 127.0.1.1 Heaven.localdomain Heaven
|
设置root密码
intel CPU安装
pacman -S intel-ucode(AMD:amd-ucode)
|
引导文件配置
pacman -S grub efibootmgr ntfs-3g os-prober vim /etc/default/grub 添加: +GRUB_DISABLE_OS_PROBER=false
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=Archlinux grub-mkconfig -o /boot/grub/grub.cfg
|
安装工具
pacman -S networkmanager dhcpcd git vim clang gcc openssh nasm bochs lldb systemctl enable dhcpcd #台式机执行 systemctl enable sshd
|
重启
exit # 退出系统 umount -a #取消挂载 ---->重启前一定要把U盘 reboot #重启
|
联网
systemctl enable --now NetworkManager nmtui
|
创建普通用户
useradd -m -g users -s /bin/bash 用户名 passwd 用户名 vim /etc/sudoers #在root ALL=(ALL)ALL下面添加: 用户名 ALL=(ALL)ALL
exit 用普通账户登陆
|
archlinuxcn
# vim /etc/pacman.conf +[archlinuxcn] +Server = https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch
sudo pacman -Syu haveged systemctl start haveged systemctl enable haveged
rm -fr /etc/pacman.d/gnupg
pacman-key --init pacman-key --populate archlinux sudo pacman -Sy archlinuxcn-keyring pacman-key --populate archlinuxcn
|
字体安装
sudo pacman -S ttf-dejavu wqy-microhei wqy-zenhei
|
dwm
sudo pacman -S xorg xorg-server xorg-xinit base-devel
|
dwm
桌面安装(plasma+sddm)
sudo pacman -S xorg sudo pacman -S plasma sudo pacman -S sddm sddm-kcm sudo pacman -S dolphin kfind ark konsole yay ufw vlc
|
驱动安装
sudo pacman -S alsa-utils pulseaudio-alsa #声卡驱动 sudo pacman -S xf86-input-synaptics #触摸板 (pacman -S xf86-input-evdev无法控制采用另一类触摸板驱动)
|
nvidia
lspci | grep -E "VGA|3D" sudo pacman -S mesa lib32-mesa vulkan-intel lib32-vulkan-intel #核心显卡 不装xf86-video-intel 以sddm的modesetting代替 sudo pacman -S nvidia nvidia-utils lib32-nvidia-utils
|
重要,以上是单显卡,独立显卡
双显卡-->双显卡不用配置以上配置(决定用先显卡暂时不用配置,直接跳过,进入桌面后,配置科学上网在来弄) yay -S optimus-manager optimus-manager-qt bbswitch // 科学上网 出现失败执行:proxychains yay -S optimus-manager optimus-manager-qt sudo systemctl enable optimus-manager
|
服务启动
su systemctl enable NetworkManager systemctl enable sddm systemctl enable dhcpcd sddm --example-config > /etc/sddm.conf reboot
|
科学上网
Clash
clash
clash
v2ray
sudo pacman -S qv2ray-dev-git v2ray sudo pacman -S proxychains-ng sudo vim /etc/proxychains.conf
-socks4 127.0.0.1 9089 +socks5 127.0.0.1 1089
订阅:https://nbsd.us/auth/login ## 使用方法 proxychains + (shell指令) 例:proxychains yay -S ”包名“
## shell中科学上网 直接shell执行 export https_proxy=http://127.0.0.1:8889 export http_proxy=http://127.0.0.1:8889 export all_proxy=http://127.0.0.1:8889
## yay代理 ALL_PROXY=socks://localhost:7890 yay package_name $ ALL_PROXY=socks://localhost:7890 yay vim
|
常用软件
浏览器
需要[archlinuxcn]
sudo pacman -S google-chrome/yay -S microsoft-edge-stable-bin
fcixt5
sudo pacman -S fcitx5-im sudo pacman -S fcitx5-chinese-addons sudo pacman -S fcitx5-pinyin-moegirl sudo pacman -S fcitx5-material-color
GTK_IM_MODULE DEFAULT=fcitx5 QT_IM_MODULE DEFAULT=fcitx5 XMODIFIERS DEFAULT=\@im=fcitx5 INPUT_METHOD DEFAULT=fcitx5 SDL_IM_MODULE DEFAULT=fcitx5 GLFW_IM_MODULE DEFAULT=ibus
|
百度网盘
ranger
sudo pacman -S --noconfirm imlib2 sudo pacman -S ranger w3m ranger ranger --copy-config=all
|
rofi
vscode
yay -S visual-studio-code-bin
|
网易云
yay -S netease-cloud-music
|
vmware(Arch wiki配置服务)
sudo pacman -S fuse2 gtkmm linux-headers pcsclite libcanberra yay -S ncurses5-compat-libs yay -S vmware-workstation sudo systemctl start vmware-networks.service vmware-usbarbitrator.service sudo systemctl enable vmware-networks.service vmware-usbarbitrator.service sudo modprobe -a vmw_vmci vmmon vmnet sudo vmware-networks --start # 密钥 ZF3R0-FHED2-M80TY-8QYGC-NPKYF YF390-0HF8P-M81RQ-2DXQE-M2UT6 ZF71R-DMX85-08DQY-8YMNC-PPHV8
|
向日葵
install:sunloginclient(aur)
sudo systemctl start runsunloginclient.service sudo systemctl enable runsunloginclient.service
|
other
neofetch :sudo pacman -S neofetch Typora: sudo pacman -S typora waifu2x-ncnn-vulkan:pacman->图片缩放 flameshot截屏:sudo pacman -S flameshot office:libreoffice-still 或 wps-office gwenview图片查看工具:sudo pacman -S gwenview pdf查看器:sudo pacman -S okular
JetBrains-toolbox: ldr-translate:yay ldr-translate(qt/gtk)可以截屏翻译的解决方案 pacman -S numlockx:开机启动数字键盘(dwm需要) 安卓模拟器:麟卓科技的xdroid 远程windows:前端:remmina 后端freerdp
|
base美化(我换fish啦~~~)
sudo vim ~/.bashrc
PS1='\[\033[0;31m\]\342\224\214\342\224\200$([[ $? != 0 ]] && echo "[\[\033[0;31m\]\342\234\227\[\033[0;37m\]]\342\224\200")[\[\033[0;39m\]\u\[\033[01;33m\]@\[\033[01;96m\]\h\[\033[0;31m\]]\342\224\200[\[\033[0;32m\]\w\[\033[0;31m\]]\n\[\033[0;31m\]\342\224\224\342\224\200\342\224\200\342\225\274 \[\033[0m\]\[\e[01;33m\]\$\[\e[0m\]'
|
fish
sudo pacman -S fish chsh -s /usr/bin/fish fish
提示语:set -U fish_greeting ""
|
win硬盘自动挂载
df -lh sudo blkid 查询UUID和格式类型 sudo vi /etc/fstab 添加挂载信息--->注意 ntfs的格式为`ntfs-3g`
UUID=0D920C390D920C39 /media/data ntfs-3g uid=youshu,gid=users,dmask=022,fmask=133 0 0 reboot
|
rsync
- 备份 sudo rsync -Pa / /home/youshu/Backup/backup_20211227 --exclude=/media/* --exclude=/sys/* --exclude=/proc/* --exclude=/mnt/* --exclude=/tmp/* --exclude=~/.cache/* --exclude=~/BackUp/*
- 还原 sudo rsync -Pa /home/youshu/Backup//backup_20211227 /
|
windows共享
共享
KDE定制
latte-dock: yay -S latte-dock-git git clone git@github.com:YSjcqs/.dotfiles.git dotfiles cd dotfiles git submodule update --init bash scripts/install-dependencies-arch.sh bash scripts/install-applet.sh
latte->导入Frosty.layout.latte
over
|