This is my personal setup almost every time I install Arch Linux. This is meant for me as being something I can quickly reference.
In my case I have a Danish keyboard layout.
loadkeys dkYou can find your keymap file by using localectl:
localectl list-keymapsOr by simply looking inside the /usr/share/kbd/keymaps/ directory.
find /usr/share/kbd/keymaps/ -type fcfdiskLet us say you have a simple setup:
- /boot partition (ext2)
- / partition (ext4)
- /home partition (ext4)
- /var partition (ext4)
- /tmp partition (ext4)
- swap partition [swap]
NOTE: lsblk is a very nice tool to doublecheck your partition(s) structure.
First we format to the file systems we want:
mkfs.ext2 /dev/sdaxY (/boot)
mkfs.ext4 /dev/sdaxY (/, /home, /var, /tmp)Why do I use ext2 for the boot partition? No need to have a journal.
Create /mnt structure, one-liner:
mkdir -p /mnt/{boot,home,var,tmp}And then mount the file systems to /mnt:
# Mount / (root)
mount /dev/sdaxY /mnt
# Mount /boot, /home, /var, /tmp
mount /dev/sdaxY /mnt/<point>Let us not forget to make ("format") our swap and mount it as well:
mkswap /dev/sdaxY
swapon /dev/sdaxYInstall the base system, with sudo as well.
pacstrap /mnt base base-devel sudoThis is why we had to mount everything as first, so genfstab would know what to do when generating the fstab.
genfstab -U -p /mnt >> /mnt/etc/fstabarch-chroot /mnt /bin/bashDepending on what you want, you change the /etc/locale.gen file:
nano /etc/locale.genNOTE: Use UTF-8 whenever possible.
DOUBLE NOTE: If you are from America, you don't need to change the file.
When done, you simply generate the locales you want and tell the system what you want to use.
Generate:
locale-genTell the system what we use:
echo LANG=en_GB.UTF-8 > /etc/locale.conf
export LANG=en_GB.UTF-8Symlink/Set your timezone:
ln -s /usr/share/zoneinfo/Europe/Copenhagen /etc/localtimehwclock --systohc --utcChoose an awesome hostname:
echo myhostname > /etc/hostnamesystemd setup of your dhcp interface:
ip link
systemctl enable [email protected]Just simply using systemctl enable dhcpcdeth0.service won't work anymore.
So I'm getting the correct device with ip link. (Usually the entry under the loop.)
Initial ramdisk environment.
mkinitcpio -p linuxThis actually ran under the pacstrap process, I just like to be safe.
Be stronk:
passwdWell, we need a bootloader:
pacman -S grubIf I'm having Windows as well on another Partition, I'll also install os-prober.
grub-install --target=i386-pc --recheck /dev/sda
grub-mkconfig -o /boot/grub/grub.cfgexitUnmount EVERYTHING and reboot the system.
umount /dev/sdaxY
rebootNOTE: You can use umount -R /mnt to recursively unmount everything in /mnt
Now we want to make our keyboard layout permanent:
localectl set-keymap --no-convert dkI obviously have "dk" for Danish layout. Substitute with your own layout.
NOTE: If you are a bloody American, you don't need to do this. US is default.
pacman -Syy
pacman -Syuuseradd -m -g users -G lp,scanner,audio,video,optical,network,games,wheel -s /bin/bash username
passwd usernameEDITOR=nano visudoUncomment wheel group.
# %wheel ALL=(ALL:ALL) ALL
exitsudo pacman -Syy
sudo pacman -SyuReferences