archlinux setup
A brief archlinux install guide.
Final setup will be: archlinux + i3wm, booted with efi.
# Before the install…
NOTES:
- this is for gpt partitions and efi boot. And the
device name
here is only a reference. - Also note that: if you are installing the new system from a existing system, you can simply use rsync to migrate system, see wiki for details. If you want a fresh new install, the package
arch-install-scripts
is needed, which includes the tools likearch-chroot
andgenfstab
etc. - Before you get started, use
lsblk
to list out the disks and identify onto which disk you want to install the system.
Make sure the system clock is accurate before the install.
|
|
Make sure internet is available. A wired connection is recommended. See wiki for details.
# Connect to network
It’s recommended to use ethernet. For wifi setup, use iwctl:
- make sure your interface is up
ip link set <interface> up
- run
iwctl
, which should come with the installation image, and - get list of access points:
# station list # station <interface> get-networks
- connect WLAN
# station <interface> connect SSID_NAME
# Preparing the disk.
THIS TUTORIAL IS DEDICATED TO UEFI + GPT setup, if you have an older machine that only support BIOS/MBR, the partitions and bootloader part should be different.
Disk Partition & Formatting
If you already have the partitions simply skip this section.
use tool cgdisk
to make partitions.
|
|
for further disk info you can use fdisk -l /dev/sdx
.
The minimal partitions should look like this (swap is optional).
Partition | Mount Point | Type | Size (typical) | Device Name |
---|---|---|---|---|
boot | /boot | Efi System | 256-512MB | /dev/sda1 |
swap | linux swap | 2 * Memory Size | /dev/sda2 | |
root | / | linux filesystem | as large as needed | /dev/sda3 |
If you already have another OS with EFI(e.g. you want dual booting), you can continue using an existing boot partition.
Disk formatting
Formatting the boot and root partition
|
|
Use swap partition (Optional)
|
|
Note: package dosfstools
may be needed for vfat file system.
Mount the Disk
|
|
# System Install and Basic Configs
Before the install, you may want to choose a faster mirror. Expecially when you are from CHINA… China’s gov is a total blyat… Edit /etc/pacman.d/mirrorlist
and run pacman -Syy
install basic system
|
|
config fstab
# genfstab -U /mnt >> /mnt/etc/fstab
Note: before running genfstab, I recommend you to use lsblk
or fdisk -l
etc. to check if the partitions are correctly mounted.
After the system installing, genfstab should not be used anymore. Edit /etc/fstab
manually afterwards if needed.
chroot into the new installed system
|
|
# basic system config
Setting Timezone
# timedatectl list-timezones
# timedatectl set-timezone Zone/SubZone
Locale and Language
edit /etc/locale.gen
, uncomment the language encoding that you need. e.g. I have
en_US.UTF-8 UTF-8
de_DE.UTF-8 UTF-8
zh_CN.GB18030 GB18030
zh_CN.GBK GBK
zh_CN.UTF-8 UTF-8
zh_CN GB2312
then run locale-gen
to generate locales..
create /etc/locale.conf
and set LANG variable, e.g.
LANG=en_US.UTF-8
Network Manager I prefer Network Manager.. here we disable dhcpd(if used during the installation) and install network-manager
|
|
Create new user It’s not recommended to use root user on a daily basis.
useradd -G wheel username
passwd username
mkdir -m 700 /home/username
chown username:username /home/user
Then edit sudoers
to grant new user root privilege. Use visudo
command to edit.
username ALL=(ALL) ALL
# Bootloader (fore UEFI)
Check again all the partitions are correctly mounted!
|
|
Now you can unmount the disk and reboot. If nothing went wrong, you should be able to boot into the new system with grub.
# Desktop Environment (xorg + i3)
install xorg
pacman -S xorg xorg-server xorg-utils xorg-xinit xorg-xfontsel xorg-font-util
install and setup i3
pacman -S i3-wm i3status i3blocks i3lock dmenu dunst
Note: packages other than i3-wm
are optinal. There are also forks of i3 that you may choose from e.g. i3-gaps
which gives extra gap between panels. Also I’m not going to cover the usage and detailed config of i3-wm and other utils here. This is only a setup guide.
To run i3, edit ~/.xinitrc
and add at the end:
exec i3
Now run startx
to launch X and i3! (A basic config will be generated during the first startup)
[+] click to leave a comment [+]
>> SEND COMMENT <<