title: Blog post: Arch Linux Installation description: List of commands needed for my Arch install date: 2019-09-09 comments: true --- I've now been running Arch Linux on my Desktop for over a year. After exclusively running Mac OS X for many years before, this was my first real step into a Desktop Linux distribution. It has been surprisingly painless and I'm very happy with my machine. Here are all the steps I've ran to install and setup Arch, with some explanations in between. Of course, take a look at the [Arch Wiki installation guide](https://wiki.archlinux.org/index.php/installation_guide) before doing anything. ### Rotating the Virtual Console At the time of installing Arch, the first monitor output of my machine was connected to a rotated display. To be able to work properly, you may want to rotate the Linux virtual console. This can be done by adding the argument `fbcon=rotate:1` to the kernel boot options. When the system is booted, you can execute the following command. Also check out the [kernel documentation](https://www.kernel.org/doc/Documentation/fb/fbcon.txt).
echo 1 > /sys/class/graphics/fbcon/rotate_all### Installation Boot into the Arch Live USB stick environment. After getting the time, format your harddisk (see [UEFI & GPT partitioning in Wiki](https://wiki.archlinux.org/index.php/Partitioning#UEFI.2FGPT_example_layout)) and mount the new partitions.
timedatectl set-ntp true fdisk -l fdisk /dev/nvme0n1 mkfs.ext4 /dev/nvme0n1p3 mkfs.ext4 /dev/nvme0n1p4 mkfs.fat -F32 /dev/nvme0n1p1 mkswap /dev/nvme0n1p2 swapon /dev/nvme0n1p2 mount /dev/nvme0n1p3 /mnt mkdir /mnt/boot mount /dev/nvme0n1p1 /mnt/boot mkdir /mnt/home mount /dev/nvme0n1p4 /mnt/homeGenerate the mirrorlist by speed (see [Mirrorlist in Wiki](https://wiki.archlinux.org/index.php/Mirrors#List_by_speed)).
cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup rankmirrors -n 6 /etc/pacman.d/mirrorlist.backup | tee /etc/pacman.d/mirrorlistBootstrap the new installation.
pacstrap /mnt base base-devel genfstab -L /mnt >> /mnt/etc/fstab arch-chroot /mntStart setting up the machine (see [Locale in Wiki](https://wiki.archlinux.org/index.php/installation_guide#Locale)).
ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime hwclock --systohc vi /etc/locale.gen locale-gen vi /etc/locale.conf vi /etc/hostname vi /etc/hosts passwdInstall some important stuff.
pacman -Syu sudo vim avahi nss-mdns zsh vim /etc/nsswitch.conf systemctl enable avahi-daemon.serviceCreate your new user account.
useradd -m -G wheel /usr/bin/zsh thomas chfn --full-name “Thomas Buck” thomas passwd thomas visudoInstall systemd-boot and add boot entries (see [systemd-boot in Wiki](https://wiki.archlinux.org/index.php/Systemd-boot#Adding_boot_entries)).
bootctl --path=/boot install cat /usr/share/systemd/bootctl/arch.conf > /boot/loader/entries/arch.conf blkid /dev/nvme0n1p3 >> /boot/loader/entries/arch.conf vim /boot/loader/entries/arch.confConfigure systemd-boot (also see [systemd-boot in Wiki](https://wiki.archlinux.org/index.php/Systemd-boot#Loader_configuration)).
vim /boot/loader/loader.confAdd Intel Microcode to systemd-boot (see [Microcode in Wiki](https://wiki.archlinux.org/index.php/Microcode#systemd-boot)).
pacman -Syu intel-ucode vim /boot/loader/entries/arch.confConfigure automatic systemd-boot update (see [systemd-boot in Wiki](https://wiki.archlinux.org/index.php/Systemd-boot#Automatic_update)).
mkdir /etc/pacman.d/hooks vim /etc/pacman.d/hooks/systemd-boot.hookInstall NetworkManager (see [NetworkManager in Wiki](https://wiki.archlinux.org/index.php/NetworkManager)).
pacman -Syu networkmanager systemctl enable NetworkManager
vim /etc/systemd/timedsyncd.conf timedatectl set-ntp trueI'm using an nVidia graphics card.
pacman -Syu xorg-server pacman -Syu nvidia opencl-nvidia vim /etc/mkinitcpio.conf vim /boot/loader/entries/arch.conf # https://wiki.archlinux.org/index.php/NVIDIA#DRM_kernel_mode_setting vim /etc/pacman.d/hooks/nvidia.hook # https://wiki.archlinux.org/index.php/NVIDIA#Pacman_hook mkinitcpio -PStart installing more stuff.
pacman -Syu sddm systemctl enable sddm systemctl enable nvidia-persistenced.service systemctl start nvidia-persistenced.service pacman -Syu pulseaudio pulseaudio-alsa pulseaudio-bluetooth pulseaudio-zeroconf pacman -Syu plasma-meta vlc phonon-qt5-gstreamer phonon-qt5-vlc dolphin dolphin-plugins kdialog kfind ark yakuake pacman -Syu nvidia-settings sddm-kcmAll this has been done in the (chrooted) environment of the Live USB stick until now. Now we reboot into the new installation.
exit umount -R /mnt rebootInstalling Synergy so I can comfortably continue writing these commands while in the new installation (see [Synergy in Wiki](https://wiki.archlinux.org/index.php/Synergy#Installation)).
pacman -Syu synergy cp /etc/synergy.conf.example /etc/synergy.conf vim /etc/synergy.conf systemctl --user enable --now synergys.serviceOf course I need an AVR and Arduino toolchain!
pacman -Syu arduino arduino-avr-core avr-gcc avr-binutils avr-libc avrdude gpasswd -a $USER uucp gpasswd -a $USER lockI'm using the AUR wrapper 'Bauerbill', taken from the creators TU repo.
vim /etc/pacman.conf # https://xyne.archlinux.ca/repos/ pacman -Syu bauerbill vim /etc/makepkg.conf # CFLAGS march=native MAKEFLAGS j, no compressionContinue installing even more stuff, like a Webbrowser.
pacman -Syu hunspell hunspell-en hunspell-de firefox # Install ublock Origin, set DuckDuckGo, etc.Install and configure NTP.
pacman -Syu ntp vim /etc/ntp.conf systemctl --user enable --now ntpd.serviceSome more applications.
bb-wrapper -Syu --aur perl-opengl perl-wx-glcanvas slic3r pacman -Syu cura pacman -Syu keepassxc pacman -Syu mpv youtube-dl pacman -Syu libreoffice okular picocomOpenSSH server needs to be enabled and started after installation.
pacman -Syu openssh systemctl enable --now sshd.socketFonts may require a call to fc-cache to update the font cache.
pacman -Syu breeze-gtk kde-gtk-config pacman -Syu ttf-droid ttf-inconsolata ttf-liberation ttf-roboto pacman -Syu ttf-dejavu ttf-bitstream-vera terminus-font sudo fc-cacheSome packets need 32bit libs on x64, so enable multilib.
vim /etc/pacman.conf # enable multilib pacman -Syu lib32-nvidia-utils wine steam openscadInstall Redshift to reduce eyestrain in the evenings (see [Redshift in Wiki](https://wiki.archlinux.org/index.php/Redshift#Manual_setup)). To autostart on boot, run `redshift-gtk` in the GUI and click on autostart there.
pacman -Syu python-gobject redshift vim ~/.config/redshift.confGenerate new SSH keys for GitHub etc. and also configure git.
ssh-keygen -t ecdsa -b 521 # generate as many as needed, one for github, one for webserver, one for home use, … git config --global user.name “Thomas Buck” git config --global user.email xythobuz@xythobuz.de pacman -Syu meld vim ~/.gitconfig # set meld as merge and diff, enable colorInstall more stuff.
pacman -Syu nmap wget konversation sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)" vim ~/.zshrc pacman -Syu gvim curl http://j.mp/spf13-vim3 -L -o - | sh # http://vim.spf13.com/Install VirtualBox.
pacman -Syu virtualbox virtualbox-host-modules-arch virtualbox-guest-iso bb-wrapper -Syu --aur virtualbox-ext-oracle gpasswd -a $USER vboxusersIf you are using an SSD, maybe think about enabling TRIM (see [SSD TRIM in Wiki](https://wiki.archlinux.org/index.php/Solid_State_Drive#Periodic_TRIM)).
sudo systemctl enable fstrim.timer pacman -Syu thermald cpupower vim /etc/default/cpupower sudo systemctl enable cpupower.serviceI was also trying out Opera, but have now settled on Firefox.
pacman -Syu opera opera-ffmpeg-codecs bb-wrapper -Syu --aur opera-adblock-complete mkdir .opera ln -s /usr/share/opera-adblock-complete/urlfilter.ini ~/.opera/urlfilter.iniTo get Bluetooth to work you may need some firmware (see [StackExchange Question](https://unix.stackexchange.com/questions/421946/bluetooth-is-not-working-no-adapter-available-arch-linux-kde)).
bb-wrapper -Syu --aur bcm20702a1-firmware systemctl enable --now bluetooth.serviceFor monitoring needs (in conky), install hddtemp (see [Hddtemp in Wiki](https://wiki.archlinux.org/index.php/Hddtemp#Daemon)).
pacman -Syu hddtemp systemctl edit hddtemp.service systemctl enable --now hddtemp.serviceInstall conky, a very cool monitoring tool (see [Conky in Wiki](https://wiki.archlinux.org/index.php/Conky#Autostart)).
bb-wrapper -Syu --aur conky-lua-nv conky -C > ~/.conkyrc vim ~/.conkyrcThis is my conkyrc at the moment: -- vim: ts=4 sw=4 noet ai cindent syntax=lua --[[ Conky, a system monitor, based on torsmo Any original torsmo code is licensed under the BSD license All code written since the fork of torsmo is licensed under the GPL Please see COPYING for details Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen Copyright (c) 2005-2012 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS) All rights reserved. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see
sudo nvidia-settings # enable full composition pipeline, store x config sudo vim /etc/X11/xorg.conf.d/20-nvidia.conf # remove unneeded stuff, add triple buffering sudo vim /etc/profile.d/kwin.sh # enable triple buffering # https://wiki.archlinux.org/index.php/NVIDIA/Troubleshooting#Avoid_screen_tearing # Fix DPI, D0: 96x98, D1: 91x90 --> 96x96 # https://wiki.archlinux.org/index.php/Xorg#Proprietary_NVIDIA_driverI had a BluRay I wanted to rip but couldn't up to this point, because my Desktop is my only device with a BluRay reader. So the point came to install and use the necessary software.
# MakeMKV BluRay support # http://www.makemkv.com/forum2/viewtopic.php?f=5&t=1053 bb-wrapper -Syu --aur lib32-glibc makemkv makemkv-libaacs sudo sh -c “echo sg > /etc/modules-load.d/sg.conf“ modprobe sgAt this point of the installation, I needed to change the keyboard layout of my Ergodox. So I had to install some more development tools.
pacman -Syu arm-none-eabi-binutils arm-none-eabi-gcc arm-none-eabi-newlib dfu-util pacman -Syu --needed git cmake ninja python libusb ctags gcc lsb-release pacman -Syu --needed avr-binutils avr-gcc avr-libcStill more stuff to be installed.
pacman -Syu bind-tools pacman -Syu pcsx2 pacman -Syu xorg-xev pacman -Syu lsof strace htop pacman -Syu fuse2 fuseiso pacman -Syu spectacle bb-wrapper -Syu --aur opentx-companion betaflight-configurator bb-wrapper -Syu --aur libspnav spacenavd blenderInstall CUPS so we can print stuff.
pacman -Syu cups cups-pdf print-manager system-config-printer systemctl enable --now org.cups.cupsd.service sudo gpasswd -a $USER sysEnable Color Emojis (see [this Reddit Thread](https://www.reddit.com/r/archlinux/comments/9q8dlj/how_to_better_enable_color_emojis/)).
sudo pacman -S noto-fonts-emoji sudo vim /etc/fonts/conf.avail/75-noto-color-emoji.conf sudo ln -sf /etc/fonts/conf.avail/75-noto-color-emoji.conf /etc/fonts/conf.d/Automatically remove old versions of packages in local cache.
sudo pacman -S pacman-contrib sudo systemctl enable --now paccache.timerSome more stuff that could be useful:
# fix for nextcloud aur build error export LC_ALL=C # nas mounts in /etc/fstab 192.168.0.5:/mnt/Excelsus/Media /mnt/nas_media nfs noauto,x-systemd.automount,x-systemd.device-timeout=30,_netdev 192.168.0.5:/mnt/Excelsus/Misc /mnt/nas_misc nfs noauto,x-systemd.automount,x-systemd.device-timeout=30,_netdev 192.168.0.5:/mnt/Excelsus/Dashcam /mnt/nas_dashcam nfs noauto,x-systemd.automount,x-systemd.device-timeout=30,_netdev # Auto-update pacman mirrorlist # https://www.reddit.com/r/archlinux/comments/9xmw3a/what_archlinux_tricks_do_you_know_that_you_wish/This is a nice little tool enabling auto-suggestion of packets when running a command that does not exist.
sudo bb-wrapper -Syu --aur pkgfile sudo pkgfile -u sudo systemctl enable --now pkgfile-update.timer echo "source /usr/share/doc/pkgfile/command-not-found.zsh" > ~/.zshIf you want to keep the kernel modules of the currently running kernel after updating it with pacman, run these commands. They will add a hook to pacman that copies the modules to a safe location on updates. This way, you will still be able to use for example new USB devices without having rebooted after an update.
sudo bb-wrapper -Syu --aur kernel-modules-hook sudo systemctl daemon-reload sudo systemctl enable linux-modules-cleanupOne other small thing I noticed: in the KDE system settings GUI I could set my language to English and my localization settings regarding Currency, Dates, etc. to German. This resulted in a locale-setting of "en_DE" which does not actually exist, so some programs complain. To be able to properly set this locale in '/etc/locale.gen' and create it with 'sudo locale-gen', first run this command:
sudo ln -s /usr/share/i18n/locales/en_US /usr/share/i18n/locales/en_DEOf course this project is forever ongoing. In the future, I'm planning to properly use the other harddisks in my machine, as I'm currently only utilizing the NVMe SSD in there. For this, I want to combine them all, probably with some kind of RAID, using LVM. I also have a couple more SSDs in there, so I will probably use one SSD for root, one for home and one as swap. And of course, I also want to enable full-disk-encryption, but I'm not yet sure how exactly. This will probably come in another blog post further down the road.