Base system installation

In this section, we will install Arch Linux from a system already running. You should have partitions where you want install already created. Most of documentation presented here is from Arch Linux Wiki, Install from Existing Linux and Installation Guide.

If you want install from scratch, you should follow the tutorial from the Arch Linux Wiki, Installation Guide

Creating the chroot using the Bootstrap Image (recommended)

Download the bootstrap image from a mirror (latest image):

$ curl -O https://mirrors.kernel.org/archlinux/iso/latest/archlinux-bootstrap-<release date>-x86_64.tar.gz

Extract the tarball:

# cd /tmp
# tar xzf <path-to-bootstrap-image>/archlinux-bootstrap-<release date>-x86_64.tar.gz

Select a repository server:

# nano /tmp/root.x86_64/etc/pacman.d/mirrorlist

Note: If bootstrapping an i686 image from an x86_64 host system, also edit /tmp/root.i686/etc/pacman.conf and explicitly define Architecture = i686 in order for pacman to pull the proper i686 packages.

Enter the chroot

  • If bash 4 or later is installed:

    # /tmp/root.x86_64/bin/arch-chroot /tmp/root.x86_64/
    
  • Else run the following commands:

    # cd /tmp/root.x86_64
    # cp /etc/resolv.conf etc
    # mount --rbind /proc proc
    # mount --rbind /sys sys
    # mount --rbind /dev dev
    # mount --rbind /run run
      (assuming /run exists on the system)
    # chroot /tmp/root.x86_64 /bin/bash
    

Using the chroot Environment

Initializing pacman keyring

Before starting the installation, pacman keys need to be setup. Before running the following two commands read pacman-key#Initializing the keyring to understand the entropy requirements (the init step could take up to 2 minutes to complete):

# pacman-key --init
# pacman-key --populate archlinux

Installation

Follow Installation guide#Mount the partitions and Installation guide#Install the base packages.

Use the pacstrap script to install the base group:

# pacstrap /mnt base

On Debian-based host systems, pacstrap produces the following error:

# pacstrap /mnt base
# ==> Creating install root at /mnt
# mount: mount point /mnt/dev/shm is a symbolic link to nowhere
# ==> ERROR: failed to setup API filesystems in new root

In Debian, /dev/shm points to /run/shm. However, in the Arch-based chroot, /run/shm does not exist and the link is broken. To correct this error, create a directory /run/shm:

# mkdir /run/shm

Configure the system

Generate an fstab file (use -U or -L to define by UUID or labels):

# genfstab -p /mnt >> /mnt/etc/fstab

Change root into the new system:

# arch-chroot /mnt

Set the hostname:

# echo computer_name > /etc/hostname

Set the time zone:

# ln -sf /usr/share/zoneinfo/zone/subzone /etc/localtime

Uncomment the needed locales in /etc/locale.gen, then generate them with:

# locale-gen

Set locale preferences in /etc/locale.conf and possibly $HOME/.config/locale.conf:

# echo LANG=yourlocale > /etc/locale.conf

Add console keymap and font preferences in /etc/vconsole.conf.

Configure the network again for the newly installed environment: see Network configuration and Wireless network configuration.

Configure /etc/mkinitcpio.conf if additional features are needed. Create a new initial RAM disk with:

# mkinitcpio -p linux

Set the root password:

# passwd

Install a bootloader

See Boot loaders for the available choices and configuration.

Install software

At this point, you can take advantage of having a fully working linux and install useful tools that can be needed. You just have install the applications normally using pacman -Syu followed by the list of package names. Usually, is useful install editors and a display manager. It will ve very useful to install tools for networking, otherwise, you will not be able to download packages to install:

pacman -S net-tools wpa_supplicant wireless_tools

Reboot

Exit the chroot environment by typing exit or pressing Ctrl+D.

Optionally manually unmount all the partitions with umount -R /mnt: this allows noticing any “busy” partitions, and finding the cause with fuser.

Finally, restart the machine by typing reboot: any partitions still mounted will be automatically unmounted by systemd. Remember to remove the installation media and then login into the new system with the root account.

Xorg

Installation

Install xorg-server from the official repositories.

Additionally, some packages from the xorg-server-utils meta-package are necessary for certain configuration tasks, they are pointed out in the relevant sections. Other useful packages are in the xorg-apps group.

pacman -S xorg-server xorg-server-utils xorg-apps

Tip: You will typically seek to install a window manager or a desktop environment to supplement X.

Driver installation

You should install the appropriate driver for your graphics card. You could follow the instructions in Driver installation.

Using proprietary NVIDIA driver

Instructions from Using NVidia.

The proprietary NVIDIA driver does not support dynamic switching like the nouveau driver (meaning it can only use the NVIDIA device). It also has notable screen-tearing issues that NVIDIA recognizes but has not fixed. However, it does allow use of the discrete GPU and has (as of October 2013) a marked edge in performance over the nouveau driver.

To install NVIDIA drivers, you should install:

pacman -S nvidia lib32-nvidia-libgl

Next, you must create a custom xorg.conf. You will need to know the PCI address of the NVIDIA card, which you can find by issuing:

lspci | grep -E "VGA|3D"

The PCI address is the first 7 characters of the line that mentions NVIDIA. It will look something like 01:00.0. In the xorg.conf, you will need to format it as #:#:#; e.g. 01:00.0 would be formatted as 1:0:0.

Then configure your /etc/X11/xorg.conf as follows:

Section "ServerLayout"
    Identifier "layout"
    Screen 0 "nvidia"
    Inactive "intel"
EndSection

Section "Device"
    Identifier "nvidia"
    Driver "nvidia"
    BusID "PCI:PCI address determined earlier"
    # e.g. BusID "PCI:1:0:0"
EndSection

Section "Screen"
    Identifier "nvidia"
    Device "nvidia"
    Option "AllowEmptyInitialConfiguration" "Yes"
EndSection

Section "Device"
    Identifier "intel"
    Driver "modesetting"
    Option "AccelMethod"  "none"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection

Next, install xorg-xrandr:

pacman -S xorg-xrandr

and add the following two lines to the beginning of your ~/.xinitrc:

xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto

But if you are using a display manager then you will need to create or edit a display setup script for your display manager instead of using ~/.xinitrc. If you are using XDM you should instead add those lines to the beginning of the file /etc/X11/xdm/Xsetup_0.

Running

Display manager

A convenient way to start X is using a display manager, but that requires additional applications and dependencies.

Manually

Install the xorg-xinit package, which provides xinit and its front-end, startx. To determine which client to run, startx will first look for ~/.xinitrc to run as a shell script. In case the user file does not exist, the system default at /etc/X11/xinit/xinitrc will be used. This will start a basic environment with Twm, xclock and Xterm (assuming that the necessary packages are installed). See xinitrc for configuration details.

To launch the X server and clients, run:

$ startx

XDM

This tutorial is available from Arch Linux Wiki, XDM.

Installation

Install xorg-xdm, available in the official repositories, then enable the xdm systemd service.

If you would like to use an Arch Linux theme for XDM, you can optionally install the xdm-archlinux package, also available in the official repositories. If installing the latter package, then do not enable the xdm service, but instead enable the xdm-archlinux service.

Configuration

Defining the session

Unlike many more modern display managers such as GDM or LightDM, XDM does not source available sessions from .desktop files located in the /usr/share/xsessions directory. As such, XDM does not have a ‘session menu’. Instead, XDM will source the .xsession file in the home directory (if this does not exist it will source the .xsession file in /etc/skel.) The .xsession file will normally direct XDM to the .xinitrc file where sessions and startup commands can be defined however the .xsession file can be used to define sessions directly.

If you wish to define sessions using the .xinitrc file, execute the following command to copy the default .xsession and .xinitrc files to your home directory:

$ cp /etc/skel/.xsession /etc/skel/.xinitrc ~

Ensure that the .xinitrc and .xsession files in your home directory are executable. Then edit the .xinitrc file to define your session as appropriate, e.g. exec gnome-session. See the xinitrc article for more information.

If you would prefer to define your session in the .xsession file itself, simply create the file and define the session as appropriate (the syntax is the same as in the .xinitrc file.)

Then make the file executable by running the following command:

$ chmod 744 ~/.xsession

.x configuration example files

Here are shown examples of configuration files. Each user, you should configure your display manager.

Example of ~/.xsession:

#!/bin/sh

#
# ~/.xsession
#
# Executed by xdm/gdm/kdm at login
#

/bin/bash --login -i ~/.xinitrc

Example of ~/.xinitrc:

#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)

if [ -d /etc/X11/xinit/xinitrc.d ]; then
    for f in /etc/X11/xinit/xinitrc.d/*; do
        [ -x "$f" ] && . "$f"
    done
    unset f
fi

# exec gnome-session
# exec startkde
# exec startxfce4
# exec wmaker
# exec icewm
# exec blackbox
# exec fluxbox
# exec openbox-session
# exec cinnamon-session
# exec xterm
# exec wmii
# exec mate-session
# ...or the Window Manager of your choice

Autostart XDM

To start XDM automatically at boot time, you have to enable XDM service. To do that, run the command:

systemctl enable xdm

You can run XDM as a service with the command:

systemctl start xdm

or simply as an application:

xdm

Bash configuration

It is useful to make some adjustments to the bash to make it more user friendly. This is accomplished by editing ~/.bashrc.

On possible configuration is:

#
# ~/.bashrc
#

# If not running interactively, don't do anything
[[ $- != *i* ]] && return

alias ls='ls --color=auto'
alias ll='ls -lha'
alias grep='grep --color=always -n'
alias less='less -r'

PS1='[\u@\h \W]\$ '

export PATH=$PATH:$HOME/bin
export GTK_THEME="DeLorean-Dark"

Here you can find an archive with all necessary modifications, just extract it on your home folder.

MATE Desktop Environment

The following steps are from Arch Linux Wiki, MATE.

Installation

MATE is available in the official repositories and can be installed with one of the following:

  • The mate-panel package provides a minimal desktop shell.
  • The mate group contains the core desktop environment required for the standard MATE experience.
  • The mate-extra group contains additional utilities and applications that integrate well with the MATE desktop. Installing just the mate-extra group will not pull in the whole mate group via dependencies. If you want to install all MATE packages then you will need to explicitly install both groups.

Additional MATE packages

There is an additional package not included in the mate or mate-extra because it is not neccessarily useful to everyone.

  • The mate-netbook package provides a MATE panel applet that might be useful to owners of small screen devices, such as a Netbook. The applet will automatically maximize all windows and provides an application switcher applet.

There are also a number of other MATE applications that are contributed and maintained by the MATE community and therefore not included in the mate or mate-extra groups.

  • mate-applet-lockkeys - A MATE panel applet that shows which of the CapsLock, NumLock and ScrollLock keys are on and which are off.
  • mate-applet-softupd - A MATE panel applet to notify when software updates become available.
  • mate-applet-streamer - A MATE panel applet to let you play your favourite online radio station with a single click.
  • mate-color-manager - Color management application for MATE.
  • mate-accountsdialog - An application to view and modify user accounts information for MATE.
  • mate-disk-utility - Disk management application for MATE.
  • mate-mplayer - mplayer frontend for MATE
  • mate-nettool - MATE interface for various networking tools.
  • mate-themes-extras - Collection of GTK2/3 desktop themes for MATE.
  • gnome-main-menu - A mate-panel applet similar to the traditional main-menu, but with a few additions.
  • variety - Variety changes the wallpaper on a regular interval using user-specified or automatically downloaded images.

The following is also available via the AUR and integrates with MATE but the package is not maintained by the MATE team.

Starting MATE

MATE can be started via a display manager or manually.

Graphical log-in

Choose MATE from the menu in a display manager of choice. The MATE team recommends LightDM as the display manager with the GTK+ (2) greeter, which can be installed with the lightdm-gtk2-greeter package.

Manually

If you prefer to start MATE manually from the console, add the following line to your ~/.xinitrc file:

exec mate-session

Then MATE can be launched by typing startx.

See xinitrc for details, such as preserving the logind session.

Touchpad Synaptics

The following steps are from Arch Linux Wiki, Touchpad Synaptics

Installation

The Synaptics driver can be installed with the package xf86-input-synaptics, available in the official repositories:

pacman -S xf86-input-synaptics

MATE Customization

Themes

Install:

pacman -S mate-themes mate-icon-theme numix-themes xcursor-bluecurve xcursor-neutral xcursor-vanilla-dmz xcursor-vanilla-dmz-aa

QT theming by application

The run QT applications with a specific theme, you can specify the theme that you want to use by issuing:

<QT_application> -style [cde|cleanlooks|gtk|motif|plastique|windows]

You can also specify a custom CSS theme issuing:

<QT_application> -stylesheet <path_to_stylesheet>

A nice dark theme is Qt-Creator Darcula theme (Local copy).

Cursor themes

For the full article, can be found in Cursor themes.

The xcursor-themes package comes with the ‘redglass’ and ‘whiteglass’ themes in /usr/share/icons.

The official repositories (search “xcursor-“) and AUR (search cursor) have more cursor themes available. Other sources include:

Using an index.theme file (recommended)

From the article Using an index.theme file (recommended).

You can choose any cursor theme from the directory: /usr/share/icons/

Create the following file /usr/share/icons/default/index.theme (you may also need to create the directory):

[Icon Theme]
Inherits=my-cursor-theme

Replace my-cursor-theme with the name of the cursor theme.

Cursor theme for QT

You can choose any cursor theme from the directory: /usr/share/icons/

Create the following file ~/.icons/default/index.theme (you may also need to create the directory):

[Icon Theme]
Inherits=my-cursor-theme

Replace my-cursor-theme with the name of the cursor theme.

Network autoconfig

netctl uses profiles to manage network connections and different modes of operation to start profiles automatically or manually on demand.
Profile configuration

The netctl profile files are stored in /etc/netctl/ and example configuration files are available in /etc/netctl/examples/. Common configurations include:

  • ethernet-dhcp
  • ethernet-static
  • wireless-wpa
  • wireless-wpa-static

To use an example profile, simply copy it from /etc/netctl/examples/ to /etc/netctl/ and configure it to your needs.

Once you have created your profile, attempt to establish a connection (use only the profile name, not the full path):

netctl start <profile>

Then it can be enabled using:

netctl enable <profile>

Applications

UTC and Localtime

Windows utilizes localtime, meanwhile linux uses UTC, making this incompatible. According with ArchLinux Wiki it is recommended change Windows to use UTC.

To change that, add the following DWORD key with hexadecimal value 1 to the Windows Registry:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\RealTimeIsUniversal

You can instead run this file to achieve that. After you have to reboot to apply the new settings.

qmmp

qmmp is a music player similar to Winamp. To install:

pacman -S qmmp

In order to use skins, you have to install unzip:

pacman -S unzip

List with some skins: http://qmmp.ylsoftware.com/files/skins/qmmp-skins/

The Winamp Classic skin can be downloaded from here: http://gnome-look.org/content/show.php/Winamp+Classic+Skin?content=64790 (Local copy)

LaTeX

Texmaker editor:

pacman -S texmaker

LaTeX libraries packages:

pacman -S texlive-bibtexextra texlive-bin texlive-core texlive-fontsextra texlive-formatsextra texlive-games texlive-genericextra texlive-htmlxml texlive-humanities texlive-langgreek texlive-latexextra texlive-music texlive-pictures texlive-plainextra texlive-pstricks texlive-publishers texlive-science

Android storage support

To access to the storage of Android devices, you should support for MTP protocol. To achive this, you should install:

pacman -S mtpfs gvfs-mtp

Mount ISO automatically when open

To mount ISOs automatically when open, you should install a utility to do that:

pacman -S gnome-disk-utility

After, you should select as default application Disk Image Mounter.