新买的HP-AS110TU配置的是超高清屏幕,虽然视觉效果非常棒,但是带来了很大的麻烦,使用不兼容高清屏的软件,真的是眼睛都要瞎了。如果长期需要使用这些软件的话,就千万不要买那么好的屏幕,配置高清屏的AS109TU会更加适合,没有那么多烦劳,电池的续航时间应该也会长一些。

安装系统

分区

我打算尝试一下btrfs文件系统格式,对ssd的优化,子卷,snapshot等特性非常吸引人,具体可以参考arch的wiki。

fdisk /dev/nvme0n1

#根据提示划分一个新的Linux分区,以下是我的分区情况。
Device             Start        End   Sectors   Size Type
/dev/nvme0n1p1      2048     206847    204800   100M EFI System
/dev/nvme0n1p2    206848     468991    262144   128M Microsoft reserved
/dev/nvme0n1p3    468992  168241151 167772160    80G Microsoft basic data
/dev/nvme0n1p4 168241152  587671551 419430400   200G Microsoft basic data
/dev/nvme0n1p5 587671552 1000215182 412543631 196.7G Linux filesystem

mkfs.btrfs /dev/nvme0n1p5
mount /dev/nvme0n1p5 /mnt
cd /mnt
btrfs subvol create rootfs
btrfs subvol create homefs
btrfs subvol create pkg
ls
rootfs homefs pkg
cd ..
mount /dev/nvme0n1p5 /mnt -o subvol=rootfs,compress=lzo
mkdir /mnt/home
#压缩参数是默认参数,加不加结果都一样的
mount /dev/nvme0n1p5 /mnt/home -o subvol=homefs
#将pkg目录使用单独的子卷挂载,方便使用快照功能
mkdir -p /mnt/var/cache/pacman/pkg
mount /dev/nvme0n1p5 /mnt/var/cache/pacman/pkg  -o subvol=pkg
mkdir -p /mnt/boot/EFI
#挂载EFI分区
mount /dev/nvme0n1p1 /mnt/boot/EFI
mount | grep btrfs

无线上网

HP-AS110TU只配有无线网卡,要先通过wifi-menu连上wifi。

安装系统

首先修改mirrorlist,将163的源放到最前面

Server = http://mirrors.163.com/archlinux/$repo/os/$arch
pacman -Syy
pacstrap -i /mnt base base-devel net-tools iw dialog wpa_supplicant dosfstools grub efibootmgr os-prober btrfs-progs

生成fstab

genfstab -U /mnt >> /mnt/etc/fstab

系统设置

首先请使用chroot进入部署好的基本系统,这里使用“进入”,只是为了避免此blog涵盖过多内容,关于chroot的知识,点击进入。

arch-chroot /mnt /bin/bash alias ls='ls --color'

后一条命令是为了让ls显示颜色,方便查看。

设置Locale

vi /etc/locale.gen

这里你至少开启en_US.UTF-8和zh_CN.UTF-8。

locale-gen echo LANG=zh_CN.UTF-8 >> /etc/locale.conf

这里由于console字体的原因,中文会变成方框,如果你不安装桌面环境,请使用en_US.UTF-8。

设置console

vi /etc/vconsole.conf

先ls /usr/share/kbd/consolefonts查看有哪些字体,选择最大的字体latarcyrheb-sun32,如果没有该字体,可以安装kbd包

sudo pacman -S kbd

临时设置的方法:

setfont latarcyrheb-sun32

永久设置的方法: 在/etc/vconsole.conf中的添加或修改这一句 font=

KEYMAP=us
FONT=latarcyrheb-sun32

设置时区

rm /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

这里大家可能会发现BIOS的时间和系统不一样了,我提供一个解决方案。

vi /etc/adjtime

输入如下内容:

0.0 0 0.0
0
LOCAL

原本是为了方便时区调整的措施,点击详解,对于多系统的用户而言,就很纠结了,特别是我这样有OCD的。

设置主机名

虽说这里的主机名可以有大写,不过我建议大家使用常规的英文小写。

echo 主机名 > /etc/hostname

你还得修改/etc/hosts文件的内容。

vi /etc/hosts

你会看到如下内容:

#
# /etc/hosts: static lookup table for host names
#
#<ip-address>   <hostname.domain.org>             <hostname>
127.0.0.1   localhost.localdomain localhost   主机名 
::1     localhost.localdomain localhost   主机名
#End of file

请把主机名替换成你所设置的主机名。

生成初始ramdisk环境

mkinitcpio -p linux

用户设置

首先是设置root的密码:

passwd

创建一个日常用户,这里添加wheel用户组是为了能够使用sudo提权,毕竟我可不敢直接拿着root操作(虽然我经常这么干)。

useradd -m -g users -G wheel -s /bin/bash 用户名 passwd 用户名

安装启动器

我是使用UEFI方式启动的

pacman -S dosfstools grub efibootmgr os-prober btrfs-progs #这些包已经安装过了
grub-install --target=x86_64-efi --efi-directory=/mnt/boot/EFI --bootloader-id=arch_grub --recheck
#更改grub启动器的分辨率,高分屏下开机菜单字太小了,需要改一下分辨率。
sudo vim /etc/default/grub
#把GRUB_GFXMODE=auto更改为1024x768
grub-mkconfig -o /boot/grub/grub.cfg

重启

需要退出chroot,卸载分区,然后直接reboot。

exit
umount -R /mnt
reboot

相关驱动安装

安装显卡驱动

pacman -S xf86-video-intel

安装桌面环境

gnome-extra太多没有用的包了,就选择性地安装一些有用的吧。

pacman -S gnome file-roller evolution gedit gnome-music gnome-photos cheese gnome-mplayer unrar unzip p7zip
pacman -Rscn epiphany folks
#因为只装了部分的包,需要自己安装默认的字体,不然会很丑
pacman -S cantarell-fonts
systemctl enable gdm

安装网络管理工具

pacman -S networkmanager

开启网络服务

systemctl enable NetworkManager

添加yaourt

vi /etc/pacman.conf
#文件末尾添加如下内容
[archlinuxcn]
SigLevel = Optional TrustAll
Server   = https://mirrors.ustc.edu.cn/archlinuxcn/$arch
sudo pacman -Syy
sudo pacman -S archlinuxcn-keyring
sudo pacman -S yaourt
sudo pacman -S gvim gtk-murrine-engine

安装terminix

第三句话很关键,terminix解压到相应目录了,却无法启动就是因为schemas没有导入。

wget -c https://github.com/gnunn1/terminix/releases/download/1.5.2/terminix.zip
sudo unzip terminix.zip -d / 
sudo glib-compile-schemas /usr/share/glib-2.0/schemas/
#terminix该名为tilix了,用这种方法安装我需要写脚本才把文件卸载干净
yaourt -S tilix

Update ~.bashrc (or ~.zshrc if you are using zsh) to execute vte.sh directly, this involves adding the following line at the end of the file.vteconfig

if [ $TERMINIX_ID ] || [ $VTE_VERSION ]; then
        source /etc/profile.d/vte.sh
fi

安装zsh、oh-my-zsh

安装oh-my-zsh之前需要安装一些必要的字体,因为比较好看的主题powerlevel9k需要用到一些powerline的字体,其实vim vundle和spacemacs都会用到这些字体的。主题powerlevel9k的配置参考官网

sudo pacman -Ss powerline-fonts
wget https://github.com/gabrielelana/awesome-terminal-fonts/archive/master.zip
cp ./build/*.ttf ~/.local/share/fonts
sudo pacman -S zsh
安装oh-my-zsh
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
chsh -s /bin/zsh
git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k
echo ZSH_THEME="powerlevel9k/powerlevel9k" >> ~/.zshrc

存在的问题

gnome下无法切换fcitx

原因大概是Gnome 3.22默认改用了Wayland,之后重新登录选择"Gnome on xorg"就可以切换了。 https://bbs.archlinuxcn.org/viewtopic.php?id=4630

xf86-input-synaptics

许多教程都说要安装这个驱动的,事实上这个驱动已经不更新了,使用libinput驱动,触摸板反而好用一点,使用xf86-input-synaptics驱动,无论怎样设置,掌压检测是无效的,会导致打字的时候鼠标乱点,特别是编辑文字的时候,手掌接触到触摸板,选中的文字就取消选择了,使用体验非常糟糕。用libinput驱动情况会好一点。如果你两个驱动都安装了,可以通过把驱动的配置文件放在/etc/X11/xorg.conf.d,更改驱动的优先级。

#把libinput.conf的配置文件复制到/etc/X11/xorg.conf.d/,系统就会使用libinput驱动触摸板
sudo cp /usr/share/X11/xorg.conf.d/40-libinput.conf /etc/X11/xorg.conf.d/
sudo libinput-list-devices

Device:           SynPS/2 Synaptics TouchPad
Kernel:           /dev/input/event17
Group:            7
Seat:             seat0, default
Size:             118.17x62.29mm
Capabilities:     pointer 
Tap-to-click:     disabled
Tap-and-drag:     enabled
Tap drag lock:    disabled
Left-handed:      disabled
Nat.scrolling:    disabled
Middle emulation: disabled
Calibration:      n/a
Scroll methods:   *two-finger edge 
Click methods:    *button-areas clickfinger 
Disable-w-typing: enabled
Accel profiles:   none
Rotation:         n/a

hidpi下ibus定位错误

本来ibus在gnome环境下集成得更加好,但这个问题太影响使用体验了,还是建议改用fcitx吧。

sudo pacman -S fcitx fcitx-gtk2 fcitx-gtk3 fcitx-configtool fcitx-rime

fcitx-qt4 fcitx-qt5就先不安装了,因为把qt都安装进去的,看情况以后如果需要再安装这两个包。

更新发生错误提示

#error: failed to commit transaction (conflicting files)
#ca-certificates-utils: /etc/ssl/certs/ca-certificates.crt exists in filesystem
sudo pacman -Syuw #先更新数据库并下载系统升级的安装包但不安装
sudo rm /etc/ssl/certs/ca-certificates.crt #删除证书
sudo pacman -Su #进行系统升级

网卡驱动加载失败

找到最新的驱动,复制到/lib/firmware/目录下

#iwlwifi 0000:01:00.0: Direct firmware load for iwlwifi-7265D-29.ucode failed with error -2
#iwlwifi 0000:01:00.0: Direct firmware load for iwlwifi-7265D-28.ucode failed with error -2
#iwlwifi 0000:01:00.0: capa flags index 3 larger than supported by driver
git clone  git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git

参考文章

results matching ""

    No results matching ""