Arch Linux Setup: Post Installation - dmitana/dotfiles GitHub Wiki
Add new unprivileged user and set his password.
$ useradd -m -G wheel -s /bin/bash <USERNAME>
$ passwd <MYUSERNAME>
Add the new user to sudoers.
$ EDITOR=vim visudo
Uncomment the line.
# %wheel ALL=(ALL) ALL
Now you can logout and login as a newly created user.
Use the previously installed NetworkManager to connect to the internet. You should start and enable NetworkManager.service
.
$ sudo systemctl enable --now NetworkManager
Note: You must ensure that no other service that wants to configure the network is running; in fact, multiple networking services will conflict. You can find a list of the currently running services with systemctl --type=service
and then stop them.
After that, list nearby wifi networks and connect to a wifi network.
$ nmcli device wifi list
$ nmcli device wifi connect <SSID> --ask
Clean systemd logs in /var/log/journal
manually.
$ sudo journalctl --vacuum-size=50M
Set such limit permanenntly in /etc/systemd/journald.conf
.
/etc/systemd/journald.conf
SystemMaxUse=50M
I am using yay
as an AUR helper.
First install its dependencies (some are already installed).
$ sudo pacman -S go
Then install yay
.
$ git clone https://aur.archlinux.org/yay.git
$ cd yay
$ makepkg -sri
Install pacman-contrib
for the paccache
script.
$ yay -S pacman-contrib
The paccache
script deletes all cached versions of installed and uninstalled packages, except for the most recent 3, by default.
$ paccache -r
# To retain only one past version
$ paccache -rk1
Enable and start paccache.timer
to discard unused packages weekly.
$ sudo systemctl enable --now paccache.timer
Add the -u/--uninstalled
switch to limit the action of paccache to uninstalled packages. For example to remove all cached versions of uninstalled packages, use the following:
$ paccache -ruk0
To remove also AUR cache use:
$ yay -Sc
Tip: To remove unused packages use yay -S --clean
or sudo pacman -Rns $(pacman -Qtdq)
.
yay -S kitty
Python
itself should be installed in previous steps, but pip
is missing, so install it.
$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
$ python get-pip.py
$ rm pip.py
$ yay -S docker docker-compose
$ sudo systemctl enable --now docker
Optionally add yourself to docker
group to use docker
as a non-root user. Logout and login to take effect.
$ sudo usermod -aG docker $USER
Optionally move docker's files to /home
(or somewhere else), because docker images can grow in a size very quickly.
$ sudo systemctl stop docker
$ sudo mv /var/lib/docker ~/var-lib-docker
$ sudo ln -s ~/var-lib-docker /var/lib/docker
$ sudo systemctl start docker
Verify that Docker Engine is installed correctly by running the hello-world
image. After that remove that worthless container and image.
$ docker run hello-world
$ docker rm ...
$ docker rmi hello-world:latest
$ yay -S alsa-utils pulseaudio-alsa pulseaudio-bluetooth pulseaudio pavucontrol
Use gnome-keyring as a wrapper around ssh-agent.
$ yay -S gnome-keyring gcr-4
$ systemctl --user enable --now gcr-ssh-agent.socket # Don't use sude with --user flag
After installation and systemd unit enabling and starting log out and log in
(or reboot) and SSH_AUTH_SOCK
should be set to $XDG_RUNTIME_DIR/gcr/ssh
via
.zshenv
.
$ yay -S google-chrome ttf-liberation firefox
Install X display server.
$ yay -S xorg-server xorg-xinit xorg-xrandr xorg-xprop xorg-xbacklight
- Install intel drivers.
$ yay -S xf86-video-intel vulkan-intel vulkan-icd-loader mesa
- Add intel kernel graphics driver
i915
to initramfs.
$ sudoedit /etc/mkinitcpio.conf
MODULES=(i915 ...)
- Regenerate the initramfs for the change to take effect.
$ sudo mkinitcpio -P
Install NVIDIA drivers.
$ yay -S nvidia
Install AwesomeWM/
$ yay -S awesome-git --removemake
Install my AwesomeWM's
dependencies and other utilities.
$ yay -S picom-git udiskie network-manager-applet xfce4-clipman-plugin autorandr arc-icon-theme acpi xterm
- Install plymouth a flicker-free graphical boot process. It relies on kernel mode setting (KMS) to set the native resolution of the display as early as possible, then provides an eye-candy splash screen leading all the way up to the login manager.
$ yay -S plymouth-git
- Add
plymouth
to the HOOKS array in mkinitcpio.conf. It must be added after base and udev for it to work:
$ sudoedit /etc/mkinitcpio.conf
HOOKS=(base systemd plymouth ...)
- Regenerate the initramfs for the change to take effect.
$ sudo mkinitcpio -P
- Set theme, I use Arch Linux Glow.
# Install theme
$ yay -S plymouth-theme-arch-glow
# List all installed plymouth themes
$ sudo plymouth-set-default-theme -l
# Select a theme and rebuild the initrd
$ sudo plymouth-set-default-theme -R arch-glow
-
splash
has to be appended in the kernel parameters to makeplymouth
works. Other parameters are for silent boot.
$ sudoedit /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="... quiet splash loglevel=3 rd.udev.log_priority=3 vt.global_cursor_default=0"
- Recreate grub config.
$ sudo grub-mkconfig -o /boot/grub/grub.cfg
A display manager, or login manager, is typically a graphical user interface that is displayed at the end of the boot process in place of the default shell.
Install sddm
DM and enable it.
$ yay -S sddm
$ sudo systemctl enable sddm.service
Install a theme.
$ yay -S sddm-theme-sugar-candy-git
Note: Sddm configuration is set up in the Dotfiles Optional section.
Well-known user directories like Downloads or Music are created by the xdg-user-dirs-update.service
user service, that is provided by xdg-user-dirs and enabled by default upon install.
$ yay -S xdg-user-dirs
$ xdg-user-dirs-update
Install used fonts and some nerd fonts.
$ yay -S ttf-dejavu ttf-liberation ttf-droid noto-fonts noto-fonts-emoji ttf-mononoki nerd-fonts-mononoki ttf-meslo ttf-meslo-nerd ttf-fira-mono ttf-fira-sans ttf-inconsolata ttf-opensans ttf-roboto ttf-ubuntu-font-family
Enable font presets by creating symbolic links.
$ sudo ln -s /etc/fonts/conf.avail/70-no-bitmaps.conf /etc/fonts/conf.d
$ sudo ln -s /etc/fonts/conf.avail/10-sub-pixel-rgb.conf /etc/fonts/conf.d
$ sudo ln -s /etc/fonts/conf.avail/11-lcdfilter-default.conf /etc/fonts/conf.d
The above will disable embedded bitmap for all fonts, enable sub-pixel RGB rendering, and enable the LCD filter which is designed to reduce colour fringing when subpixel rendering is used.
For font consistency, all applications should be set to use the serif, sans-serif, and monospace aliases, which are mapped to particular fonts by fontconfig.
Create /etc/fonts/local.conf
. You can get the actual names of fonts by fc-list
.
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match>
<edit mode="prepend" name="family">
<string>MesloLGS</string>
</edit>
</match>
<match target="pattern">
<test qual="any" name="family">
<string>serif</string>
</test>
<edit name="family" mode="assign" binding="same">
<string>Noto Serif</string>
</edit>
</match>
<match target="pattern">
<test qual="any" name="family">
<string>sans-serif</string></test>
<edit name="family" mode="assign" binding="same">
<string>Noto Sans</string>
</edit>
</match>
<match target="pattern">
<test qual="any" name="family">
<string>monospace</string>
</test>
<edit name="family" mode="assign" binding="same">
<string>Noto Mono</string>
</edit>
</match>
</fontconfig>
Create a new keyboard layout configuration using localectl. It will save the configuration in /etc/X11/xorg.conf.d/00-keyboard.conf
, this file should not be manually edited, because localectl will overwrite the changes on next start.
$ localectl --no-convert set-x11-keymap us,sk pc104 ,qwerty grp:alt_shift_toggle
After reboot a new keyboard layout will work.
- Install app for chaging system fonts, icons, themes and cursor themes.
$ yay -S lxappearance-gtk3
- Instal GTK3 theme, currently my favourite is Materia Dark Compact.
$ yay -S materia-gtk-theme
- Install icon theme, currently my favourite is Papirus.
$ yay -S papirus-icon-theme
- Install cursor theme, currently my favourite is Vimix.
$ yay -S vimix-cursors
- GTK3 theme, icon theme, fonts and cursor themes can be set in
lxappearance
. If you already have cloned dotfiles, then everything should be set (maybe a reboot is needed).
Now, install Dotfiles. After that, come back and finish this setup.
Note: if there is some problem with AwesomeWM widgets, check theirs READMES.
- Install TLP with
tlp-rdw
and optional dependencies.
$ yay -S tlp tlp-rdw ethtool smartmontools
- Enable
TLP
andNetworkManager-dispatcher
(fortlp-rwd
) services.
$ sudo systemctl enable --now tlp.service
$ sudo systemctl enable --now NetworkManager-dispatcher.service
- Mask the service
systemd-rfkill.service
and socketsystemd-rfkill.socket
to avoid conflicts and assure proper operation of TLP's radio device switching options.
$ sudo systemctl mask systemd-rfkill.service
$ sudo systemctl mask systemd-rfkill.socket
- Install the bluez package, providing the Bluetooth protocol stack.
- Install the bluez-utils package, providing the
bluetoothctl
utility. - The generic Bluetooth driver is the
btusb
Kernel module. Check whether that module is loaded. If it's not, then load the module. - Start/enable bluetooth.service.
$ yay -S bluez bluez-utils
$ sudo systemctl enable --now bluetooth
$ lsmod | grep btusb
# Optionally load the module
$ sudo modprobe btusb
- Install Blueman, a full featured Bluetooth manager.
$ yay -S blueman
$ blueman-applet
Such snapshots can be used for full system backups with minimal downtime or testing system updates with the option to revert them.
Create /etc/systemd/system/mk-lvm-snapshots.service
containing:
[Unit]
Description=make LVM snapshots
Requires=local-fs-pre.target
Wants=local-fs.target
DefaultDependencies=no
Conflicts=shutdown.target
After=local-fs-pre.target
Before=local-fs.target
[Install]
WantedBy=make-snapshots.target
[Service]
Type=oneshot
ExecStart=/usr/sbin/lvcreate -l 100%%FREE -n root-snapshot -s /dev/vg0/root
Note: Character %
have to be escaped in systemd files using another %
.
Create a new systemd target /etc/systemd/system/make-snapshots.target
:
[Unit]
Description=Make Snapshots
Requires=graphical.target
Enable mk-lvm-snapshots.service
:
$ sudo systemctl enable mk-lvm-snapshots.service
Create GRUB menu netry in /boot/grub/custom.cfg
based on the /boot/grub/grub.cfg
entry for your normal startup. The kernel command line is extended to start the new make-snapshots.target
:
### make snapshots ###
menuentry 'Arch Linux - make snapshots' --class arch --class gnu-linux --class gnu --class os {
... # copy from /boot/grub/grub.cfg
echo 'Loading Linux core repo kernel ...'
linux /boot/vmlinuz-linux root=/dev/vg0/root rw loglevel=3 quiet systemd.unit=make-snapshots.target
echo 'Loading initial ramdisk ...'
initrd /boot/intel-ucode.img /boot/initramfs-linux.img
}
If you want to create root filesystem snapshot e.g. when performing full system update boot Arch Linux - make snapshots
. If you want to permantly stick to the updates just drop the snapshot with sudo lvremove /dev/vg0/root-snapshot
. If you want to revert to the snapshotted state issue a sudo lvconvert --merge /dev/vg0/root-snapshot
for the snapshot. During the next restart of the system (use the default target) the snapshot is merged back into your regular volume. All changes to the volume happened after the snapshot are undone.
- Install slock.
$ yay -S slock
- Create the following service
/etc/systemd/system/[email protected]
which turns off the monitor and locks the screen before suspend.
[Unit]
Description=Lock X session using slock for user %i
Before=sleep.target
[Service]
User=%i
Environment=DISPLAY=:0
ExecStartPre=/usr/bin/xset dpms force suspend
ExecStart=/usr/bin/slock
[Install]
WantedBy=sleep.target
- Enable for username
user
(change to your username).
$ sudo systemctl enable [email protected]
Note: If you want patches, download and install slock
by hand using sudo make install
. Before installation, change user
and group
in config.def.h
to nobody
. Patches can be applied using patch -p1 < patch -p1 < path/to/patch.diff
. Do not forget to remove config.h
when patching.
For gpu support install nvidia-docker. Currently working method is to install nvidia-container-toolkit
.
$ yay -S nvidia-container-toolkit
$ sudo systemctl restart docker
Verify correct installation of nvidia-container-toolkit
by running a base CUDA container.
$ docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi
This should result in a similar console output.
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 450.51.06 Driver Version: 450.51.06 CUDA Version: 11.0 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 Tesla T4 On | 00000000:00:1E.0 Off | 0 |
| N/A 34C P8 9W / 70W | 0MiB / 15109MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| No running processes found |
+-----------------------------------------------------------------------------+
After successful verification you can remove the CUDA image.
$ docker rmi nvidia/cuda:11.0-base
Cgroups v2 is the default as of systemd
v248, but nvidia-container
doesn't support it yet [1, 2]. To make GPU support work, you have to force using of cgroups v1 instead of v2.
To do this, add systemd.unified_cgroup_hierarchy=0
kernel command line parameter to /etc/default/grub
.
/etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="... systemd.unified_cgroup_hierarchy=0"
Don't forget to regenerate grub config /boot/grub/grub.cfg
using grub-mkconfig
.
$ grub-mkconfig -o /boot/grub/grub.cfg
- Install cups package.
$ yay -S cups
- Enable
org.cups.cupsd.socket
.
$ sudo systemctl enable --now org.cups.cupsd.socker
- Install printer drivers.
# For HP install hplip and setup a printer
$ yay -S hplip
$ hp-setup -i
- Install sane package with drivers.
$ yay -S sane sane airscan ipp-usb
- Enable and start
ipp-usb.service
to allow using IPP protocol over USB connection.
$ sudo systemctl enable --now ipp-usb.service
- Install
hplip-plugin
for HP scanner support.
$ yay -S hplip-plugin
- Check whether
sane
recognizes scanner.
$ scanimage -L
Scanner should be in the output.
device `v4l:/dev/video0' is a Noname Integrated_Webcam_HD: Integrate virtual device
device `hpaio:/usb/HP_LaserJet_MFP_M129-M134?serial=VNFYY50649' is a Hewlett-Packard HP_LaserJet_MFP_M129-M134 all-in-one
- Install Simple Scan frontend.
$ yay -S simple-scan
-
Install required packages (eID client, web signer, IcedTea, and Java).
$ yay -S eidklient disig-web-signer icedtea-web jre8-openjdk jre8-openjdk-headless java8-openjfx java11-openjfs
-
Download and install D.Launcher.
$ wget https://www.slovensko.sk/static/zep/apps/DLauncher.linux.x86_64.zip $ unzip DLauncher.linux.x86_64.zip $ chmod +x DLauncher.linux.x86_64.run $ ./DLauncher.linux.x86_64.run
-
Enable and start
pcscd
service to access the built in card reader.$ sudo systemctl enable --now pcscd.service
-
Start
eID
client viaEAC_MW_klient
.
The extendind consists of these steps:
-
Create a new LVM partition using
fdisk
. -
Add a new PV for the created LVM partition.
-
Extend VG and LV.
-
Use
fdisk
for the appropriate device.# fdisk /dev/sdX
-
Press
n
to add a new partition. -
If prompted, specify the partition type, type
p
to create a primary partition ore
to create an extended one. There may be up to four primary partitions. -
Press
Enter
to select default partition number (e.g.1
so the full path is/dev/sdX1
). -
Press
Enter
to select default starting sector. -
Press
Enter
to select default ending sector or use the+
symbol to specify a position relative to the start sector measured in sectors, kibibytes (K
), mebibytes (M
), gibibytes (G
), tebibytes (T
), or pebibytes (P
); for instance, setting+2G
as the last sector will specify a point 2GiB after the start sector. -
Type
43
(Linux LVM) as the partition's type id. If not promted, presst
to change a partition type, then pressEnter
to select default (latest) partition number and then type30
as the partition type. -
Press
w
to write table to disk and exit. -
Check out whether the partition was created successfuly.
$ lsblk
-
Check out existing physical volumes.
# pvs
-
Create a new PV for the created LVM partition (adjust the partition path).
# pvcreate /dev/sdX1
-
Check out whether the physical volume was created successfuly.
# pvs
-
Find out the name of the VG that will be extented (LV is in VG that will be extended).
# lvs
-
Extend the appropriate VG with the created PV.
# vgextend <VG-name> /dev/sdX1
-
Check out whether the VG was extended successfuly.
# vgs
-
Extend the approriate LV by the appropriate size (e.g. 5G).
# lvextend -L +5G /dev/<VG-name>/<LV-name>
-
Check out whether the LV was extented successfuly.
$ lsblk # pvs # vgs # lvs
-
Resize the file system.
# resize2fs /dev/<VG-name>/<LV-name>
-
Check out whether the file system was resized successfuly.
$ df -h
vifm
as vi file manager (also install ueberzug
for image preview)
thunar
, as GUI file manager
* `thunar-archive-plugin`
* `tumbler` as a photo thumbnails generator
* `ffmpegthumbnailer` as a video thumbnails generaator
spotify
as a digital music streaming service
sxiv
as a simple X image viewer
mpv
as a media player
playerctl
as a media players controller
gimp
as image manipulation program
libreoffice-fresh
as a office suite
thunderbird
as a e-mail client
pidgin
as a XMPP client
slack-desktop
as team communicator
whatsapp-for-linux
as WhatsApp
zip
as zip archive tool
rar
as rar archive tool
xarchiver
as GTK+ front end for managing archives
neofetch
as a command-line system information tool
cmatrix
as Matrix
bat
, bat-extras
, prettier
as a cat clone with wings (prettier
is needed for prettybat
)
fzf
as a command-line fuzzy finder
cht.sh-git
as the only cheat sheet you need
ncdu
as a command-line disk usage manager
openvpn
, networkmanager-openvpn
as a OpenVPN client
arandr
as visual front end for XRandR
zathura
, zathura-pdf-mupdf
as PDF viewer
prismatik-psieg
as control to Lightpack devices (ambilight control)