💾 Archived View for envs.net › ~pulzar › arch-notes › post-installation.gmi captured on 2023-04-26 at 13:44:13. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2021-12-04)

-=-=-=-=-=-=-

                -@               
               .##@              
              .####@             
              @#####@            
            . *######@           
           .##@o@#####@          Arch-notes
          /############@         Post-Installation
         /##############@        
        @######@**%######@       
       @######`     %#####o      
      @######@       ######%     
    -@#######h       ######@.`   
   /#####h**``       `**%@####@  
  @H@*`                    `*%#@ 
 *`                            `*

Home

Installation

Other software

Generating the filesystem table

Creating the fstab file:

genfstab -U /mnt >> /mnt/etc/fstab

Chroot into the installed system

With the chroot command you leave the live enviroment and enter the newly installed system.

arch-chroot /mnt

Timezone and locale

Choose your timezone:

ln -sf /usr/share/zoneinfo/Europe/Budapest /etc/localtime

Run hwclock to generate /etc/adjtime:

hwclock --systohc

Uncomment the needed locales in /etc/locale.gen (eg. en_US.UTF-8):

vim /etc/locale.gen

Generate the locales:

locale-gen

Set the LANG variable in locale.conf:

echo LANG=en_US.UTF-8 >> /etc/locale.conf

Network configuration

Choose a hostname (eg. arch):

echo arch >> /etc/hostname

To edit the hosts file:

vim /etc/hosts

Enter the following information (replace arch with your hostname):

127.0.0.1   localhost
::1         localhost
127.0.1.1   arch.localdomain    arch

Installing important packages

pacman -S grub efibootmgr networkmanager wireless_tools wpa_supplicant dhcpcd os-prober mtools dosfstools base-devel linux-headers

Setting up GRUB (Grand Unified Bootloader)

Installing GRUB:

UEFI:

grub-install --target=x86_64-efi --efi-directory=/boot/EFI --bootloader-id=GRUB

MBR (use the device name the system is installed on):

grub-install --target=i386-pc /dev/sda

Creating the configuration file:

grub-mkconfig -o /boot/grub/grub.cfg

User account settings

Set the root password:

passwd

Create a user (replace username with your own username):

useradd -m username

Set a password for the new user:

passwd username

Add the user to some important groups (no spaces after the commas):

usermod -aG wheel,audio,video,optical,storage username

To let the new user gain root privileges when needed, we have to edit a file called sudoers. Open the file with the following command:

visudo

Uncomment this line:

%wheel ALL=(ALL) ALL

Save and exit the editor.

Exiting and rebooting

To exit the installation back to the live enviroment:

exit

To unmount all partitions:

umount -a

Ignore the warning messages about the busy partitions.

Now reboot the system and log in with the newly created user.

reboot

Network services and WiFi

Starting and eanbling network services:

systemctl enable --now NetworkManager

Fix for wireless driver problems, in case your card is not recognized:

Installing pre-requirements:

sudo pacman -S dkms git

Installing the wireless driver:

git clone https://github.com/lwfinger/rtw88.git
cd rtw88
make
sudo make install

Installing the driver as a kerne module with dkms, so it will be rebuilt automatically at kernel updates:

sudo dkms add ./rtw88
sudo dkms install rtlwifi-new/0.6

Accessing the AUR

The Arch User Repository - as the name suggests - is a repository which contains software made by the community. You can not access this repository directly with pacman. Install an AUR helper to be able to install packages from this repo. Install paru with the following commands:

git clone https://aur.archlinux.org/paru.git
cd paru
makepkg -si

Setting up a graphical environment (xorg)

To install graphical drivers:

For Intel cards:

sudo pacman -S xf86-video-intel

For AMD cards:

sudo pacman -S xf86-video-amdgpu

Install xorg and xorg-xinit:

sudo pacman -S xorg xorg-xinit

I am going to install my build of DWM, which needs the following two fonts to work properly:

sudo pacman -S ttf-font-awesome ttf-dejavu

A notification daemon, called dunst, is also required:

sudo pacman -S dunst

To clone my config files from github:

git clone --bare https://github.com/laszloszurok/config $HOME/.cfg
/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME config --local status.showUntrackedFiles no
/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME checkout -f

The .cfg folder will be a bare repo. This is a great way of managing config files, because you can basicly forget about it after the setup. You don't have to deal with the .cfg folder, just leave it there in your home directory.

Set an alias:

alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'

With the alias, you can use commands like this to manage your files:

config status
config add .bashrc
config commit -m "updated .bashrc"
config push

Write this alias in your .bashrc or .zshrc to make it permanent. If you want to set up a new bare repo, you can do it like this:

git init --bare $HOME/.myconf
alias config='/usr/bin/git --git-dir=$HOME/.myconf/ --work-tree=$HOME'
config config status.showUntrackedFiles no

Then set a remote url for the repository.

Cloning my suckless builds:

git clone https://github.com/laszloszurok/dwm.git source/suckless-builds/dwm
git clone https://github.com/laszloszurok/dwmblocks.git source/suckless-builds/dwmblocks
git clone https://github.com/laszloszurok/dmenu.git source/suckless-builds/dmenu
git clone https://github.com/laszloszurok/st.git source/suckless-builds/st
git clone https://github.com/laszloszurok/slock.git source/suckless-builds/slock
git clone https://github.com/laszloszurok/wmname.git source/suckless-builds/wmname

Go into the suckless-builds/dwm directory and execute the following command:

sudo make install

Execute the above command for all of my suckless builds to install them. Now that DWM is installed we need a way to launch it. For this, you have to copy a configuration file to your home folder and edit it, as follows:

cp /etc/X11/xinit/xinitrc /home/youruser/.xinitrc

Replace 'youruser' with your username. Open the copied file and delete the last five lines containing twm, xclock, etc. Replace it with with the following:

exec dwm

Save the file and exit the editor. Now you should be able to launch dwm with this command:

startx

Make sure you have a terminal emulator installed before running startx. If you installed all of my suckless builds you have st.

If you don't want to launch the X server manually with the startx command every time you start up your computer, you have to install a display manager. I can recommend lightdm.

You will also need a greeter (a graphical login screen). My favourite one is called lightdm-slick-greeter. It's in the AUR, so you have to install it with an AUR helper, like paru.

You have to do some configurations to make lightdm work. Open the file located at /etc/lightdm/lightdm.conf with a texteditor and uncomment the following line under the [LightDM] section:

[LightDM]
...
sessions-directory=/usr/share/lightdm/sessions:/usr/share/xsessions:/usr/share/wayland-sessions
...

Under the [Seat:\*] section, set the default greeter to lightdm-slick-greeter and also set the user-session to dwm:

[Seat:*]
...
greeter-session=lightdm-slick-greeter
...
user-session=dwm
...

For the user-session to work we have to create a file called dwm.desktop. Place this file to the following location: /usr/share/xsessions/ . Open the file with a texteditor and write the following configuration into it:

[Desktop Entry]
Encoding=UTF-8
Name=dwm
Comment=Dynamic Window Manager
Exec=/usr/local/bin/dwm
Type=Application

Now lightdm is configured, but you have to enable it with systemctl, so it will automatically launch after boot:

systemctl enable lightdm

If you want to set a wallpaper for the greeter, you can set it through the lightdm-slick-greeter configuration file, but there is a nice graphical tool in the AUR called lightdm-settings which lets you manage the greeter's settings in an easy way.

To lock the screen after inactivity, you can use light-locker (install it with pacman).

You can find slock between my suckless builds, which is a very lightweight screen locker utility, but I recommend light-locker if you use lightdm.

If you don't want a display manager you can just log in through the tty and use startx to launch a graphical session.

To install the ArcDark theme:

sudo pacman -S arc-gtk-theme arc-icon-theme

Use lxappearance to manage themes:

sudo pacman -S lxappearance

To apply a theme for every user, add these environmental variables to /etc/environment:

GTK_THEME=Arc-Dark
QT_QPA_PLATFORMTHEME=gtk2

Configuring the touchpad

To enable tap-to-click and natural scrolling, create a file, called 30-touchpad.conf at /etc/X11/xorg.conf.d/ with the following lines:

Section "InputClass"
    Identifier "touchpad"
    Driver "libinput"
    MatchIsTouchpad "on"
    Option "Tapping" "on"
    Option "NaturalScrolling" "true"
EndSection

Restart the X server for the changes to take effect.

Enabling sound

I'm using the ALSA sound system on my machine. Install alsa-utils with the following command. This will provide a program called alsa-mixer which you can use to control sound.

sudo pacman -S alsa-utils

I have media control buttons on my laptop (they can control for eg. switching to next/prev. song on Spotify). For these to work I'm going to install playerctl.

sudo pacman -S playerctl

I have alsamixer and playerctl commands binded to the volume level controlling and media controlling keys in my DWM config, thats how I make these keys functional.