Difference between revisions of "User:PeterSR"

From ArchWiki
Jump to navigation Jump to search
m (Made hostname ic)
m (Remove # changed to uncomment (semantically better))
Line 163: Line 163:
Allow the {{ic|wheel}} group to perform sudo by editing {{ic|/etc/sudoers}}:
Allow the {{ic|wheel}} group to perform sudo by editing {{ic|/etc/sudoers}}:
  # visudo
  # visudo
Go to the line {{ic|1=# %wheel ALL=(ALL) ALL}} and remove the {{ic|#}}.
Go to the line {{ic|1=# %wheel ALL=(ALL) ALL}} and uncomment it.

Revision as of 10:29, 29 January 2015

Real name: Peter Severin Rasmussen

GitHub: PeterSR

BitBucket: PeterSR

Arch level: Just started.

Personal setup

Here my personal setup will be explained.


Using a GPT partition table, the partitions are as follows: [1]

Every storage device reference below will be corresponding to this layout.

Note: Use GParted live-USB if in doubt. [2]


Set the keyboard to the Danish Dvorak keyboard layout:

# loadkeys no-dvorak
Note: There is currently no Danish Dvorak built in, so we use the Norwegian as it is almost identical

Don't bother setting up locale on the live system.

Also use a wired connection with DHCP, and the internet will most likely just work. Wireless connection can always be configured when the system is installed.

Activate swap partition

# mkswap /dev/sda3
# swapon /dev/sda3

Mount partitions

# mount /dev/sda1 /mnt

# mkdir -p /mnt/boot
# mount /dev/sda2 /mnt/boot

# mkdir -p /mnt/boot/efi
# mount /dev/sda5 /mnt/boot/efi

# mkdir -p /mnt/home
# mount /dev/sda4 /mnt/home

Edit /etc/pacman.conf

# vi /etc/pacman.conf

Find the line with #Color and uncomment it

Edit the mirrorlist

# vi /etc/pacman.d/mirrorlist

Find first occurrence of Denmark and move it to the top.

Install the base system

# pacstrap -i /mnt base base-devel

Generate fstab file

# genfstab -U -p /mnt >> /mnt/etc/fstab
# vi /mnt/etc/fstab
Note: Remember to verify the correctness of the generated file using the second line in the code above


Chroot into the system

# arch-chroot /mnt /bin/bash


Edit /etc/locale.gen

# vi /etc/locale.gen

and uncomment da_DK.UTF-8 UTF-8 as well as en_US.UTF-8 UTF-8.

Note: The recommended way is to search for DK using vi's search /. Remove the #. Search for US. Remove the #.


# locale-gen

and edit the file /etc/locale.conf (which does not exist)

# vi /etc/locale.conf

and write


This will use the Danish locale in terms of dates, currency etc., but keep the system language in English.

Edit the file /etc/vconsole.conf:

# vi /etc/vconsole.conf

and write

Note: This keyboard layout should match the one in the installation. If another font is desired, use FONT= here as well. This only affects the virtual console which is used when no GUI is present. To change keyboard layout etc. in GUI, edit X configuration (see later)

Set timezone and hardware clock:

# pacman -S ntp
# timedatectl set-timezone Europe/Copenhagen
# ntpd -qg
# hwclock --systohc

Computer and network

Add hostname pc to /etc/hostname:

# echo pc > /etc/hostname

and edit /etc/hosts accordingly:

# vi /etc/hosts

#<ip-address> <hostname.domain.org> <hostname> localhost.localdomain localhost pc
::1   localhost.localdomain localhost pc

Configure wired connection using DHCP:

# ip link

# systemctl enable dhcpcd@interface_name.service

Here, read the output of ip link and find the ethernet interface name, properly enp3s0 or something similar.

Remove PC case speaker beep:

# echo "blacklist pcspkr" > /etc/modprobe.d/nobeep.conf


Install zsh and change the default shell of the root:

# pacman -S zsh
# chsh
Changing shell for root.
New shell [/bin/bash]: /bin/zsh

Create new user called user:

# useradd -m -g users -G wheel,storage,power -s /bin/zsh user
# passwd user

Allow the wheel group to perform sudo by editing /etc/sudoers:

# visudo

Go to the line # %wheel ALL=(ALL) ALL and uncomment it.

Lock the root user:

# passwd -l root
Warning: Do not lock the root user before you are sure that another user can use sudo. Also make sure that you have set the password of that other user.
Note: Restore root user with sudo passwd -u root.

Boot loader

The currently used boot loader is GRUB with UEFI. First install the packages:

# pacman -S grub efibootmgr

Install GRUB to the ESP partition:

# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub_uefi --recheck

Create the configuration file

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

Further reading: GRUB#Installation_2, Unified_Extensible_Firmware_Interface#EFI_System_Partition

The moment of truth

Exit the chroot

# exit

and reboot

# reboot

Now, in BIOS edit the default boot device to grub_uefi and cross your fingers.


Here we set up the system as we actually want it to be. First login as the newly created user:

pc login: user

If you are presented with a Z Shell screen, simply press q. You should now see a command prompt.

First and foremost, update the system

# sudo pacman -Syu

Next, install the most important packages

# sudo pacman -S vim git openssh

Now fetch the dotfiles using HTTPS (we will change this to SSH later):

# git clone https://PeterSR@bitbucket.org/PeterSR/dotfiles.git
# cd dotfiles
# git submodule init
# git submodule update --recursive
# ./install.sh symlink
Note: Using HTTPS requires authentication via password if the repo is private.


Install ALSA

# sudo pacman -S alsa-utils

Go inside the alsamixer and max the different volumes.

# alsamixer


Install Xorg packages

# sudo pacman -S xorg-xinit xorg-server xorg-server-utils

Further reading: Xorg

Note: Xorg might be replaced by Wayland in the future.

Install Nvidia packages

# sudo pacman -S nvidia

Further reading: NVIDIA

Note: If using another graphics card, find the appropriate package. Xorg requires libgl which can also come from mesa.

OR (in case of Intel graphics)

Install Intel packages

# sudo pacman -S xf86-video-intel mesa-libgl

Install i3 packages

# sudo pacman -S i3

Further reading: i3

Copy the .xinitrc and edit it

# cp /etc/skel/.xinitrc ~

# vim .xinitrc

Add the lines

setxkbmap dk dvorak
exec i3

to the end of the file.

Note: Here we use the same keyboard layout as in the virtual console. And Danish Dvorak is actually a supported Xorg keyboard layout.


# sudo pacman -S firefox terminator


# sudo pacman -S python3 jdk8-openjdk nodejs