Skip to content

First steps

Eduardo Flores edited this page Dec 7, 2024 · 7 revisions

Arch

Updates

After a fresh install, it's important to update your system. Run # pacman -Syu, and you should be all set.

Display

Install Xorg by running:

# pacman -S xorg-server xorg-xinit xorg-xrandr

This display server will help you start your window manager later on. After installing it, you will have the xrandr command. Use it to list all connected monitors and their resolutions. You can set your monitors like this:

xrandr --output DP-1 --rotate left
xrandr --output DP-1 --left-of HDMI-1

In the above example, I'm setting my monitor DP-1 to be left of my HDMI-1 monitor and then setting it to be vertically oriented.

Finally, make the X server start your desired window manager by making a copy of a configuration file located at /etc/X11/xinit/xinitrc and appending exec [wm] to the end of it. You may need to comment out some of the last lines depending if you have the apps configured to start up at that file. Example:

$ cp /etc/X11/xinit/xinitrc ~/.xinitrc
# ... rest of the code

#twm &
#xclock -geometry 50x50-1+1 &
#xterm -geometry 80x50+494+51 &
#xterm -geometry 80x20+494-0 &
#exec xterm -geometry 80x66+0+0 -name login

exec i3

Keyboard Layout

You can use the setxkbmap [layout] to change the default keyboard layout. However, to make it persistent you may append it to the ~/.xinitrc file mentioned above. Example:

# ... rest of the code

exec i3
setxkbmap us

GRUB

If you have GRUB installed and want to alter its resolution, you can use the command:

# nano /etc/default/grub

Modify the line where the resolution is set, for example:

GRUB_GFXMODE=1920x1080x32

Make sure the resolution is supported by your monitor; otherwise, it may crash. Confirm this using xrandr. Finally, run # grub-mkconfig -o /boot/grub/grub.cfg to save changes.

Shell

To set your desired shell as the default one, first, confirm that it is installed by running:

$ cat /etc/shells

Afterwards, you can do:

# chsh -s $(which zsh)

In the example provided above, I used zsh. Note that for this change to take effect, you may need to reboot.

Audio

To set up audio, run:

# pacman -S alsa-utils pulseaudio playerctl

The last package will come in handy when switching audio media through key bindings (e.g., for Spotify). After installing those, you can run:

$ alsamixer

This will open an audio mixer where you can adjust your computer's volume. You may need to reboot your computer after installing the packages.

GPU Drivers

Nvidia

To install the proprietary Nvidia drivers (replacing the nouveau ones), assuming you have the linux kernel (not linux-lts, etc.) and a Maxwell or newer graphics card architecture, follow these steps:

  1. Install the nvidia package: # pacman -S nvidia.
  2. Edit the /etc/mkinitcpio.conf file and modify the modules array to: MODULES=(nvidia nvidia_modeset nvidia_uvm nvidia_drm).
  3. Edit the /etc/default/grub file and modify the following like by adding the last two kernel parameters shown here: GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet nvidia-drm.modeset=1 nvidia-drm.fbdev=0".
  4. Save the previous changes by running sudo grub-mkconfig -o /boot/grub/grub.cfg and sudo mkinitcpio -P.
  5. Reboot.

To be sure, you can also blacklist the nouveau driver to ensure the proprietary one gets used instead. Do this by creating the file /etc/modprobe.d/blacklist-nouveau.conf and adding:

blacklist nouveau
options nouveau modeset=0

Lastly, create a pacman hook to be run everytime the linux kernel updates, or the nvidia drivers get updated. Do this in /etc/pacman.d/hooks/nvidia.hook. Result:

[Trigger]
Operation=Install
Operation=Upgrade
Operation=Remove
Type=Package
Target=nvidia
Target=linux

[Action]
Description=Updating NVIDIA module in initcpio
Depends=mkinitcpio
When=PostTransaction
NeedsTargets
Exec=/bin/sh -c 'while read -r trg; do case $trg in linux*) exit 0; esac; done; /usr/bin/mkinitcpio -P'

After being done, run nvidia-smi to verify the correct installation of the drivers. If you do this before rebooting, an error may appear instead, but that doesn't mean the installation was unsuccessful.

Debian

Updates

After a fresh install, it's important to update and upgrade your packages. If you encounter an error related to sources where Debian looks for packages, you can resolve it by running:

$ su -
# nano /etc/apt/sources.list

Then, comment out the first line, which should look something like this:

#deb cdrom:[Debian GNU/Linux 12.4.0 _Bookworm_ - Official amd64 DVD Binary-1 with firmware 20231210-1>

Finally, run # apt update && apt upgrade, and you should be all set.

Superuser

The sudo command may not be initially recognized. To solve this, install it with:

$ apt install sudo

After installation, edit the sudoers file by running # visudo and add yourself to it. For example:

# User privilege specification
root    ALL=(ALL:ALL) ALL
eduardo ALL=(ALL:ALL) ALL

Display

Install Xorg by running:

# apt install xorg

This display server will help you start your window manager later on. After installing it, you may have the xrandr command (if not, install it with # apt install xrandr). Use this command to list all connected monitors and their resolutions. You can set your monitors like this:

xrandr --output DP-1 --rotate left
xrandr --output DP-1 --left-of HDMI-1

In the above example, I'm setting my monitor DP-1 to be left of my HDMI-1 monitor and then setting it to be vertically oriented.

GRUB

If you have GRUB installed and want to alter its resolution, you can use the command:

# nano /etc/default/grub

Modify the line where the resolution is set, for example:

GRUB_GFXMODE="1920x1080"

Make sure the resolution is supported by your monitor; otherwise, it may crash. Confirm this using xrandr. Finally, run # update-grub to save changes.

Shell

To set your desired shell as the default one, first, confirm that it is installed by running:

$ cat /etc/shells

Afterwards, you can do:

# chsh -s $(which zsh)

In the example provided above, I used zsh. Note that for this change to take effect, you may need to reboot.

Audio

To set up audio, run:

# apt install alsa-utils pulseaudio playerctl

The last package will come in handy when switching audio media through key bindings (e.g., for Spotify). After installing those, you can run:

$ alsamixer

This will open an audio mixer where you can adjust your computer's volume. You may need to reboot your computer after installing the packages.

Finally, pulseaudio may cause some cracking or popping noises when leaving your computer idle for a couple of minutes. To fix this, run:

$ nano ~/.config/pulse/default.pa

Add the following lines to that file (create it if it doesn't exist):

.include /etc/pulse/default.pa
.nofail
unload-module module-suspend-on-idle
.fail
Clone this wiki locally