Archlinux installation
Intro
Read this two official wiki: First pre-install Software & Hardware Issues/Wikis
You can try archinstall, it's a pretty simple tool to install the os.
Be careful when executing commands.
Read this two official wiki: First pre-install Software & Hardware Issues/Wikis
You can try archinstall, it's a pretty simple tool to install the os.
Be careful when executing commands.
ifconfig to check the network card.
Here wlan0 as default.
iwctl
station wlan0 scan
station wlan0 get-networks
station wlan0 connect your_network
Once you're done, type exit.
If you have an old pc, you should check your bios that support uefi or not.
Since there are two choice to install arch: uefi and legacy.
On legacy you don't have to create the efi partition and install efibootmgr.
Be clear what disk you are going to partition.
If it's a m.2 disk it should be something like /dev/nvme0n1p1.
If it's a sata or some usb disk it should be /dev/sda
Btw don't format your installation media.
fdisk -l to list disks on your computer.
cfdisk
Part(s) | Type | Size |
---|---|---|
nvme0n1p1 | EFI | 300MiB |
nvme0n1p2 | swap | 4GiB |
nvme0n1p3 | f2fs | Remain |
Formatting:
Here are some filesystems like: ext4, brtfs, xfs, f2fs...
I choose ext4 here.
mkfs.fat -F 32 /dev/nvme0n1p1
mkswap /dev/nvme0n1p2
swapon /dev/nvme0n1p2
mkfs.ext4 /dev/nvme0n1p3
Mounting:
mount /dev/nvme0n1p3 /mnt
mount --mkdir /dev/nvme0n1p1 /mnt/boot
Switch mirrors to improve your download speed: Arch mirrorlist Arch generator
vim /etc/pacman.d/mirrorlist
Insert this code: Server = /your/mirror/$repo/os/$arch
Refresh your repo with: pacman -Syu.
pacstrap -K /mnt linux linux-firmware base base-devel \
efibootmgr grub networkmanager
pipewire pipewire-{alsa,jack,pulse} mesa \
xorg xorg-server xorg-xdm udisks2 gvfs ntfs-3g wget git vi vim \
wqy-microhei-lite terminus-font bluez bluez-utils \
alsa-{utils,plugins} zip {un,p7}zip tlp acpi{d,light}
Graphic card driver:
intel: vulkan-intel,intel-media-driver,libva-intel-driver
amd: xf86-video-amd,vulkan-radeon
Microcode:
intel cpu: intel-ucode;
amd cpu: amd-ucode;
pacstrap /mnt intel-ucode intel-media-driver vulkan-intel \
xf86-video-fbdev linux-firmware-qlogic(for me)
genfstab -U /mnt >> /mnt/etc/fstab arch-chroot /mnt
ls /usr/share/zoneinfo to list timezone.
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
hwclock --systohc
vim /etc/locale.gen
Find your locale and uncomment it.
locale-gen
echo LANG=en_US.UTF-8 > /etc/locale.conf
echo your-hostname(eg. archlinux) > /etc/hostname
Legacy:
grub-install --target=i386-pc /dev/nvme0n1p3
UEFI:
grub-install --target=x86_64-efi --efi-directory=/boot
vim /etc/default/grub
Find GRUB_CMDLINE_LINUX_DEFAULT and add these:
fbcon=nodefer (not sure what this do)
modprobe.blacklist=iTCO_wdt (if you want to disable watchdog)
resume=/dev/nvme0n1p2 (if you want your pc hibernate)
video=efifb:nobgrt (if you dont want startup logo twice)
grub-mkconfig -o /boot/grub/grub.cfg
Add one account:
useradd -m -G audio,storage,video,wheel your-accountName
passwd your-accountName
visudo
Uncomment %wheel ALL=(ALL:ALL) ALL
Add hibernate(if you want):
vim /etc/mkinitcpio.conf
Find HOOKS=(...)
Add resume behind filesystems
It should look like this:
HOOKS=(... filesystem resume)
vim /etc/systemd/logind.conf
Uncomment HandleLidSwitch and HandleLidSwitchExternalPower
HandleLidSwitch=hibernate(or keep default suspend)
HandleLidSwitchExternalPower=suspend
tty font:
echo FONT=ter-132n(n-normal b-bold) > /etc/vconsole.conf
High resolution:
Bigger values represents bigger window.
echo GDK_DPI_SCALE=1.25 >> /etc/environment
echo GDK_SCALE=1.25 >> /etc/environment
If you are troubled with the intel or some graphic cards,
then add MESA_LOADER_DRIVER_OVERRIDE.
Notice your fps may be less than before.
echo MESA_LOADER_DRIVER_OVERRIDE=zink >> /etc/environment
mkinitcpio -P
exit
umount /mnt/boot
umount /mnt
reboot