Arch linux Install
partition
![beginner's guide][Beginners' guide]
准备好两个分区用于root分区和boot分区 我的root分区为/dev/sda9 boot分区为/dev/sda8 由于我的笔记本支持UEFI, 所以boot分区类型为ESP
install from exsiting linux
参考archlinux.org上的wiki ![download image from archlinux][Archlinux download] ![install archlinux from existing linux][Install from existing linux]
在现有的linux发行版上使用arch-bootstrap安装archlinux 原理: 将磁盘mount到宿主机上,通过chroot环境安装软件 当前的环境: fedora23 runs on laptop(support UEFI)
download archlinux-bootstrap-2016.01.01-x86_64.tar.gz
setup the chroot environment
tar xzvf archlinux-bootstrap-2016.01.01-x86_64.tar.gz -C /tmp/
- change to the chroot environment: sudo /tmp/root.x8664/bin/arch-chroot /tmp/root.x8664/
2. initial the choroot environment pacman-key –init pcman-key –populate archlinux
mount /dev/sda9 /mnt/ mount /dev/sda8 /boot /dev/sda9是为archlinux准备好的root分区 /dev/sda8是为archlinux准备好的boot分区,分区类型为ESP
从host环境编辑/tmp/root.x8664/etc/pacman.d/mirrorlist, 选择软件源
3. install the base system pacstrap /mnt base
配置分区表: genfstab -p /mnt/ » /mnt/etc/fstab 修改生成的fstab
chroot to the new system: arch-chroot /mnt
4. configure the new system
设置hostname: echo ThinkpadE540 > /etc/hostname
设置时区: ln -s /usr/share/zoneinfo/Asia/Chongqing /etc/localtime
配置locale: 编辑/etc/locale.gen, uncomment 其中的 enUS.UTF-8 UTF-8 zhCN.UTF-8 UTF-8 locale-gen echo “LANG=enUS.UTF-8” > /etc/locale.conf
mkinitcpio -p linux
设置root用户密码,并添加新用户 使用passwd设置root账户密码 useradd -c caodan -m -d /home/caodan caodan
安装bash命令补全工具: pacman -S bash-completion
关闭tab补全时蜂鸣器的叫声: 修改 /etc/inputrc, uncoment the “set bell-style none”
安装base-devel, 包含make, gcc, autoconf 以及常用的命令 pacman -S base-devel
5. configure the wireless networkpacman -S iw wpa_supplicant
使用netctl自动连接网络: netctl在base里面,所以不需要额外安装 /etc/netctl/examples/下面有很多配置文件的示例, 拷贝一个到 /etc/netctl/ 例如我的配置文件为 /etc/netctl/wireless-haha
$ cat wireless-haha Description='haha WPA encrypted wireless connection' Interface=wlp5s0 Connection=wireless
Security=wpa IP=dhcp
ESSID='haha' # Prepend hexadecimal keys with \“ # If your key starts with ”, write it as '“”<key>“' # See also: the section on special quoting rules in netctl.profile(5) Key='xingxing' # Uncomment this if your ssid is hidden Hidden=yes # Set a priority for automatic profile selection Priority=2
6. install bootloader
由于boot分区为EFI system partition, 支持安装systemd-boot
安装systemd-boot: bootctl –path=/boot install
添加启动项: 在/boot/loader/entries目录下添加配置文件arch.conf
$ cat /boot/loader/entries/arch.conf title Arch Linux linux /vmlinuz-linux initrd /initramfs-linux.img options root=PARTUUID=60914ef3-2e1e-4610-9eb3-3412b8a80e86 rw
修改/boot/loader/loader.conf如下: timeout 3 default arch
经过上面的步骤,一个基本archlinux环境已经安装好了 输入exit 从chroot环境退出, 重启之后就可以通过systemd-boot进入archlinux
install the desktop
X.org提供了X Window System的一种开源实现,开发工作和freedesptop.org社区共同完成 Xorg是X window system的开源实现。X window system并不是一个软件,而是一个协议。这个协定定义了一个系统成品所必须具备的功能
在安装桌面环境之前必须先安装Xorg 或者Wayland(作为Xorg的替代)
- install Xorg
pacman -S xorg-server xorg-server-utils
2. install drivers
https://wiki.archlinux.org/index.php/Xorg
显卡驱动: NVIDIA可以安装nouveau (Open Source 2D acceleration driver for nVidia cards) pacman -S xf86-video-nouveau
输入设备: pacman -S xf86-input-evdev
触摸板: pacman -S xf86-input-synaptics
3. install desktop environments安装GNOME3 pacman -S gnome
设置systemd启动display-manager ln -s /usr/lib/systemd/system/gdm.service display-manager.service
input method
install fonts: pacman -S ttf-dejavu pacman -S wqy-microhei wqy-zenhei install fcitx: pacman -S fcitx-im pacman -S fcitx-googlepinyin 通过fcitx-configtool添加输入法 配置~/.xprofile $ cat .xprofile export LC_CTYPE="zh_CN.utf8" export GTK_IM_MODULE=fcitx export QT_IM_MODULE=fcitx export XMODIFIERS="@im=fcitx" 一定要将LC_CTYPE设置为"zh_CN.utf8", 如果中文输入法不能启动,可以用fcitx-diagnose进行诊断