Arch Linux

From XennisWiki
Jump to: navigation, search

Arch Linux (or Arch) is a Linux distribution for computers based on i686 and x86-64 architectures. Arch Linux is composed predominantly of free and open-source software, and supports community involvement. (Wikipedia)

Setup

Further information: Installation guide

Pre-installation

Preparation

Set the keyboard layout (here to de-latin1, output available layouts by ls /usr/share/kbd/keymaps/**/*.map.gz)

loadkeys de-latin1

Verify the boot mode. If the directory exists, it's UEFI otherwise BIOS.

ls /sys/firmware/efi/efivars

Verify internet connection

ping -c 3 google.de

Update the system clock

timedatectl set-ntp true

Check the time is correct by timedatectl status.

Partition the disk

Use fdisk to create a normal partition and a swap partition.

Format and mount partition

Format the partition(s)

mkfs.ext4 /dev/sda1

If a swap partion (here dev/sda2) was created, initialize it (for details read Swap)

mkswap /dev/sda2
swapon /dev/sda2

Mount the file systems

mount /dev/sda1 /mnt

Installation

Optional edit the mirror list in /etc/pacman.d/mirrorlist. The first entry will be checked first, then the second one and so one.

Install the base packes

pacstrap /mnt base

Basic configuration

Generate an fstab file

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

Change root into the installed system

arch-chroot /mnt

Timezone

Set the time zone and generate /etc/adjtime

ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
hwclock --systohc

Hostname

Configure a hostname and it's local resolution, see Hostname.

Locale

Uncomment your locale in /etc/locale.gen (for instance de_DE.UTF-8 UTF-8 and en_GB.UTF-8 UTF-8) and generate locale

locale-gen

Set the LANG variable in /etc/locale.conf

LANG=en_GB.UTF-8

Set the keyboard layout in /etc/vconsole.conf

KEYMAP=de-latin1

Root password

Set the root password

passwd

Additional packages

Linux headers (must) and Linux LTS and it's headers (recommended)

pacman -S linux-headers linux-lts linux-lts-headers

Boot loader

see Grub

Reboot

(1) Exit the chroot by the command, (2) unmount the partition(s) and (3) reboot

exit
umount /mnt
reboot

Additional configuration

Network

Check if you already got an IP by enter ip a. Use dhcpcd to get a IP.

Install for instance NetworkManager or Wicd.

Sudo

Install the sudo package

pacman -S sudo

Enter visudo and uncomment the line (use [x] to remove a character)

%wheel ALL=(ALL) ALL

Create a user

Create a user with a home directory (-m), which is allowed to execute sudo (is member of the group wheel) and a Bash as login shell.

useradd -m -G wheel -s /bin/bash <name>

Create a password

passwd <name>

Setup desktop environment

Video card

Install the X.Org Server and setup the video card.

Login manager and desktop environment

Install one of instance Deepin with LightDM or MATE with LightDM.

If the font in the terminal looks wired, install the package ttf-liberation.

Tips

Recommended packages

Recommended packages
Package Description
ntfs-3g Mount partition with Microsoft's NTFS file system (e.g. external drives)
openssh SSH support
wireless_tools, wpa_supplicant, wpa_actiond, dialog WIFI support
(xf86-input-libinput) Support for older touch and track pads
dnsutils DNS Utils like host
(gtk3-print-backends) Print backends for GTK3 (e.g. to list printers in Chromium)
bash-completion
xorg-xrandr
net-tools Tools like ifconfig
ttf-liberation, ttf-freefont, ttf-arphic-uming, ttf-baekmuk, ttf-dejavu More fonts to see less squares

Connect a Android device

Further information: Media Transfer Protocol

  • Enable Media Transfer Protocol support by installing the mtpfs package
  • Enhance the MTP support by installing the jmtpfs package
  • Optional install gvfs-mtp for a file manager integration (e.g. Deepin)

Use Bluetooth headphones

Setup Bluetooth

Configure audio

  • Install the required packages: pacman -S pulseaudio-bluetooth
  • Load the required modules by adding them in the /etc/pulse/system.pa file
    ### Enable Bluetooth
    load-module module-bluetooth-policy
    load-module module-bluetooth-discover

Errors and problems

No internet connection

No IP address

Check if you already got an IP by enter ip a. Use dhcpcd to get a IP.

No HDMI sound output

Install the also-utils

pacman -S alsa-utils

Discover the card and device number

aplay -l

Send sound to device 3 of card 1

aplay -D plughw:1,3 /usr/share/sounds/alsa/Front_Center.wav

Chromium and other programs does not detect local printer

see recommended packages

Blurred font

Problem

Font is blurred (for instance in the terminal.

Solution

Further information: X resources

Install xorg-xrdb and create the ~/.Xresources with:

Xft.lcdfilter: lcddefault
Xft.antialias: true
Xft.autohint: 0
Xft.hinting: true
Xft.hintstyle: hintslight
Xft.rgba: rgb
Xft.dpi: 96

Run xrdb -merge ~/.Xresources to load the resource file and merge it with the current settings. Log out and in again will work for the most display managers.

Recover corrupt upgrade (module not found - ignoring)

Further information: Recovering from a Corrupted Arch Linux Upgrade

Error message
Warning: /lib/modules/4.9.64-1-ARCH/modules.devname not found - ignoring
starting version 232
ERROR: device 'UUID=<uuid>' not found. Skipping fsck.
mount: /new_root: can't find UUID=<uuid>.
You are now being dropped into an emergency shell.
Solution

Run Arch live version from e.g. an USB device. Mount your Linux partition, here sda5. (Hint: To change the keyboard layout enter for instance loadkeys de-latin1 first.)

mount /dev/sda5 /mnt
arch-chroot /mnt

Check the Pacmans log file. Maybe reinstall the packages Pacman was trying to upgrade. For details see further information section. Run the following command to upgrade packages. (Hint: Run dhcpcd to receive a IP and check the connection by ping google.com)

pacman -Syu

If Pacman is locked, delete Pacmans lock file.

Regenerate initramfs (in /boot)

mkinitcpio -p linux
mkinitcpio -p linux-lts

Exit and reboot.

Arch installation from USB: Device did not show up

Error message
:: Mounting '/dev/disk/by-label/ARCH_201810' to 'run/archiso/bootmnt'
Waiting 30 seconds for device /dev/disk/by-label/ARCH_201212 ...
ERROR: '/dev/disk/by-label/ARCH_201810' device did not show up after 30 seconds...
Falling back to interactive prompt
You can try to fix the problem manually, log out when you are finished
sh: can't access tty; job control turned off
Solution

The label of the UBS device is wrong, that's why /dev/disk/by-label/ARCH_201810 as device never shows up. The solution is to rename the label of the USB stick, here to ARCH_201810.

See also

External links