Arch入教路
Contents
我的linux入门是redhat系,跟着兄弟连用的centos。之后一直用的debian系,包括桌面日用,ubuntu,deepin,kubuntu,mint。早就听说了Arch邪教,纯命令安装系统,需要对linux系统有更深的了解,也借这个契机来试试。
第一步:虚拟机试探
-
官网下载安装包
-
启动vBox,开始进入安装界面
-
确保开启虚拟机的EFI支持
-
确保网络
1 2 3 4 5 6 7 8 9 10 11
ip link #有线网络 dhcpcd #无线网络 iwctl [iwd] device list [iwd] station device scan [iwd] station device get-networks [iwd] station device connect SSID ping www.baidu.com
-
更新系统时间
1 2 3
timedatectl set-ntp true #检查服务状态 timedatectl status
-
系统分区
1 2
fdisk -l cfdisk /dev/sdx (x替换成相应的硬盘字母,一般是a或b,默认gpt即可)
分区结果
1 2 3 4
mkfs.fat -F32 /dev/sda1 mkfs.ext4 /dev/sda3 mkswap /dev/sda2 swapon /dev/sda2
-
挂载
1 2 3
mount /dev/sda3 /mnt mkdir /mnt/boot mount /dev/sda1 /mnt/boot
-
安装
1 2 3 4 5
vim /etc/pacman.d/mirrorlist # 找到中国镜像移到最上面或者添加 Server = http://mirrors.ustc.edu.cn/archlinux/$repo/os/$arch # pacstrap脚本安装arch基础 pacstrap /mnt base base-devel linux linux-firmware dhcpcd vim
-
生成fstab挂载文件
1 2
genfstab -U /mnt >> /mnt/etc/fstab cat /mnt/etc/fstab
-
切换根目录,进入安装好的系统
1
arch-chroot /mnt
-
本地化设置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
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 vim /etc/locale.conf LANG=en_US.UTF-8 vim /etc/hostname jack1024 vim /etc/hosts 127.0.0.1 localhost ::1 localhost 127.0.1.1 jack1024.localdomain jack1024 #设置root密码 passwd
-
设置微码引导
1 2 3 4
#intel CPU pacman -S intel-ucode #AMD CPU pacman -S amd-ucode
-
安装引导
1 2 3 4 5 6 7 8 9 10
pacman -S os-prober ntfs-3g grub efibootmgr grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB #生成并查看引导配置 grub-mkconfig -o /boot/grub/grub.cfg cat /boot/grub/grub.cfg # 重启 umount -R /mnt reboot
出现这个说明安装一切搞定,重启后进入邪教生活。
-
常用软件
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 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 52 53 54 55
#重启后登录 jack1024 login: root password: **** #联网 dhcpd ping www.baidu.com systemctl enable dhcpcd #配置国内源 vim /etc/pacman.conf #文档末尾添加 [multilib] Include = /etc/pacman.d/mirrorlist [archlinuxcn] Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch #安装 archlinuxcn-keyring 包以导入 GPG key pacman -S archlinuxcn-keyring #更新 pacman -Syyu #安装常用软件 pacman -S openssh man git systemctl start sshd systemctl enable ssdd.service #添加用户 useradd -m -G wheel -s /bin/bash username passwd username #给用户sudo权利 pacman -S sudo #第一种方法 su - root chmod u+w /etc/sudoers vim /etc/sudoers #找到这行 root ALL=(ALL) ALL,在他下面添加xxx ALL=(ALL) ALL (这里的xxx是你的用户名) chmod u-w /etc/sudoers #第二种方法 ln -s /usr/bin/vim /usr/bin/vi visudo %wheel ALL=(ALL) ALL #安装zsh #不知道为什么虚拟机无法从github clone,所以采用gitee sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" # 然后参考之前的linux工作环境配置那篇博客自定义zsh # 由于虚拟机暂时无法访问github,需要通过gitee安装一些插件 git clone https://gitee.com/mirror-github/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting git clone https://gitee.com/lxgyChen/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions git clone https://gitee.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k
1 2 3 4 5 6 7
# 经过多次试错终于能让虚拟机从github拉取项目了 用浏览器访问 IPAddress.com 使用 IP Lookup 工具获得 github.com github.global.ssl.fastly.net raw.githubusercontent.com 三个域名的ip地址 然后写入/etc/hosts中即可
-
安装图形界面
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 26 27 28 29 30 31 32
#安装声卡驱动 sudo pacman -S alsa-utils pulseaudio pulseaudio-alsa #查看显卡型号 lspci | grep VSA #查看独显型号 lspci | grep 3D #参考官网驱动表进行安装 sudo pacman -S 驱动包名 #安装输入设备驱动 pacman -S xf86-input-libinput #安装笔记本触摸板驱动 sudo pacman -S xf86-input-synaptics #安装中文字体 sudo pacman -S ttf-dejavu wqy-bitmapfont wqy-microhei wqy-zenhei noto-fonts noto-fonts-emoji # xorg用于实现窗口系统,sddm是登陆管理器,登陆管理器还有lightdm等等,但是个人比较推荐sddm,sddm可以支持多个桌面环境的切换。 pacman -S xorg xorg-server #安装kde桌面 pacman -S plasma #安装kde应用 pacman -S kde-applications #安装sddm图形登录界面 sudo pacman -S sddm sddm-kcm systemctl enable sddm #安装网络管理 sudo pacman -S net-tools networkmanager sudo systemctl enable NetworkManager
-
virtualbox安装增强功能(经过反复折腾,最终安装失败)
1 2 3 4
sudo pacman sudo pacman -S linux-headers sudo pacman -S base-devel #理论上安装以上就行了,但是还是失败了,不知道为什么
安装主步骤:
- 联网
- 更新时间
- 创建分区
- 格式化挂载点
- 挂载分区
- 国内镜像置顶
- 拉取安装件(包括devel)
- 生成挂载文件
- 切换根目录
- 调整时区
- 生成配置文件
- 本地化修改
- 修改root密码
- 网络工具安装
- 安装微码引导
pacman包管理
- 简洁高效
- 拥有神器:Arch User Repository
|
|
AUR助手
-
Arch 用户软件仓库 通常称为 AUR,是给 Arch 用户的基于社区的软件存储库。
-
什么是 AUR(Arch 用户软件仓库)?
Arch 用户软件仓库 通常称为 AUR,是给 Arch 用户的基于社区的软件存储库。
根据软件包在 AUR 社区的流行程度,用户编译的软件包会进入到 Arch 的官方存储库。
-
什么是 AUR 助手?
AUR 助手是一个包装程序,允许用户从 AUR 存储库安装软件包,而无需手动干预。
很多用例实现了自动化,比如包搜索、解决依赖关系、检索和构建 AUR 包、Web 内容检索和 AUR 包提交之类。
|
|
用debian系的小伙都惊呆了,AUR是真的牛皮