Difference between revisions of "Beginners' guide old"

From ArchWiki
Jump to: navigation, search
(Update link.)
(Extra renamed)
Line 42: Line 42:
 
{{:Beginners' Guide/Preparation}}
 
{{:Beginners' Guide/Preparation}}
 
{{:Beginners' Guide/Installation}}
 
{{:Beginners' Guide/Installation}}
{{:Beginners' Guide/Extra}}
+
{{:Beginners' Guide/Post-installation}}

Revision as of 12:42, 5 March 2013

Tip: This guide is also available in multiple pages, rather than one large copy. If you would rather follow it that way, please start here.

Template:Article summary start Template:Article summary text Template:Article summary heading Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary end This document is a guide for installing Arch Linux from the live system booted with the official installation image. Before installing, it would be advised to view the FAQ. For conventions used in this document, see Help:Reading.

For more detailed instructions, see the respective ArchWiki articles (accessible from the installation environment with ELinks), or the various programs' man pages; see archlinux(7) for an overview of the configuration. For interactive help, the IRC channel and the forums are also available.

Contents

Pre-installation

Arch Linux should run on any i686 compatible machine with a minimum of 256 MB RAM. A basic installation with all packages from the base group should take less than 800 MB of disk space.

Download and boot the installation medium as explained in Category:Getting and installing Arch. You will be logged in as the root user, and presented with a Zsh shell prompt; common commands such as systemctl(1) can be tab-completed.

To edit configuration files, nano, vi and vim are available.

The installation process needs to retrieve packages from a remote repository, therefore a working internet connection is required.

Verify the boot mode

As instructions differ for UEFI systems, verify the boot mode by checking efivars:

# ls /sys/firmware/efi/efivars

Set the keyboard layout

The default console keymap is US. Available choices can be listed with ls /usr/share/kbd/keymaps/**/*.map.gz.

The layout can be changed with loadkeys(1), appending a file name (path and file extension can be omitted). For example:

# loadkeys de-latin1

Console fonts are located in /usr/share/kbd/consolefonts/, and can likewise be set with setfont(8).

Connect to the Internet

Internet service via dhcpcd is enabled on boot for supported wired devices; check the connection using a tool such as ping.

If a different network configuration tool is needed, systemd-networkd and netctl are available. See systemd.network(5) and netctl.profile(5) for examples. When using either service, stop dhcpcd@interface.service first.

Update the system clock

Use timedatectl(1) to ensure the system clock is accurate:

# timedatectl set-ntp true

To check the service status, use timedatectl status.

Partition the disks

To modify and print partition tables, use fdisk or parted for both MBR and GPT, or gdisk for GPT only.

At least one partition must be available for the / directory. UEFI systems additionally require an EFI System Partition. Other partitions may be needed, such as a GRUB BIOS boot partition.

If wanting to create any stacked block devices for LVM, disk encryption or RAID, do it now.

Format the partitions

File systems are created using mkfs(8), or mkswap(8) in case of the swap area. See File systems#Create a file system for details.

Mount the partitions

mount(8) the root partition on /mnt. After that, create directories for and mount any other partitions (/mnt/boot, /mnt/home, ...) and activate your swap partition with swapon(8), if you want them to be detected later by genfstab.

Installation

Select the mirrors

Edit /etc/pacman.d/mirrorlist and select a download mirror(s). Regional mirrors usually work best; however, other criteria may be necessary to discern, read more on Mirrors.

This file will later be copied to the new system by pacstrap, so it is worth getting right.

Install the base packages

Use the pacstrap script to install the base package group:

# pacstrap /mnt base

The group does not include all tools from the live installation, such as btrfs-progs or specific wireless firmware; see packages.both for comparison.

To install other packages or groups to the new system, append their names to pacstrap (space separated) or to individual pacman(8) commands after the #Chroot step.

Configure the system

Fstab

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

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

Check the resulting file in /mnt/etc/fstab afterwards, and edit it in case of errors.

Chroot

Change root into the new system:

# arch-chroot /mnt

Time zone

Set the time zone:

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

Run hwclock(8) to generate /etc/adjtime. If the hardware clock is set to UTC, other operating systems should be configured accordingly.

# hwclock --systohc --utc

Locale

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

# locale-gen

Add LANG=your_locale to locale.conf(5), and if required, console keymap and font to vconsole.conf(5).

Hostname

Create an entry for your hostname in /etc/hostname:

# echo myhostname > /etc/hosts

A matching entry in /etc/hosts is recommended, see Network configuration#Set the hostname.

Network configuration

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

For Wireless configuration, install the iw, wpa_supplicant, and dialog packages, as well as needed firmware packages.

Initramfs

When making configuration changes to mkinitcpio.conf, create a new initial RAM disk with:

# mkinitcpio -p linux

Root password

Set the root password:

# passwd

Boot loader

See Category:Boot loaders for available choices and configurations. Choices include GRUB (BIOS/UEFI), systemd-boot (UEFI) and syslinux (BIOS).

If you have an Intel CPU, in addition to installing a boot loader, install the intel-ucode package and enable microcode updates.

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(1).

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.

Post-installation

See General recommendations for system management directions and post-installation tutorials (like setting up a graphical user interface, sound or a touchpad).

For a list of applications that may be of interest, see List of applications. This document is a guide for installing Arch Linux from the live system booted with the official installation image. Before installing, it would be advised to view the FAQ. For conventions used in this document, see Help:Reading.

For more detailed instructions, see the respective ArchWiki articles (accessible from the installation environment with ELinks), or the various programs' man pages; see archlinux(7) for an overview of the configuration. For interactive help, the IRC channel and the forums are also available.

Pre-installation

Arch Linux should run on any i686 compatible machine with a minimum of 256 MB RAM. A basic installation with all packages from the base group should take less than 800 MB of disk space.

Download and boot the installation medium as explained in Category:Getting and installing Arch. You will be logged in as the root user, and presented with a Zsh shell prompt; common commands such as systemctl(1) can be tab-completed.

To edit configuration files, nano, vi and vim are available.

The installation process needs to retrieve packages from a remote repository, therefore a working internet connection is required.

Verify the boot mode

As instructions differ for UEFI systems, verify the boot mode by checking efivars:

# ls /sys/firmware/efi/efivars

Set the keyboard layout

The default console keymap is US. Available choices can be listed with ls /usr/share/kbd/keymaps/**/*.map.gz.

The layout can be changed with loadkeys(1), appending a file name (path and file extension can be omitted). For example:

# loadkeys de-latin1

Console fonts are located in /usr/share/kbd/consolefonts/, and can likewise be set with setfont(8).

Connect to the Internet

Internet service via dhcpcd is enabled on boot for supported wired devices; check the connection using a tool such as ping.

If a different network configuration tool is needed, systemd-networkd and netctl are available. See systemd.network(5) and netctl.profile(5) for examples. When using either service, stop dhcpcd@interface.service first.

Update the system clock

Use timedatectl(1) to ensure the system clock is accurate:

# timedatectl set-ntp true

To check the service status, use timedatectl status.

Partition the disks

To modify and print partition tables, use fdisk or parted for both MBR and GPT, or gdisk for GPT only.

At least one partition must be available for the / directory. UEFI systems additionally require an EFI System Partition. Other partitions may be needed, such as a GRUB BIOS boot partition.

If wanting to create any stacked block devices for LVM, disk encryption or RAID, do it now.

Format the partitions

File systems are created using mkfs(8), or mkswap(8) in case of the swap area. See File systems#Create a file system for details.

Mount the partitions

mount(8) the root partition on /mnt. After that, create directories for and mount any other partitions (/mnt/boot, /mnt/home, ...) and activate your swap partition with swapon(8), if you want them to be detected later by genfstab.

Installation

Select the mirrors

Edit /etc/pacman.d/mirrorlist and select a download mirror(s). Regional mirrors usually work best; however, other criteria may be necessary to discern, read more on Mirrors.

This file will later be copied to the new system by pacstrap, so it is worth getting right.

Install the base packages

Use the pacstrap script to install the base package group:

# pacstrap /mnt base

The group does not include all tools from the live installation, such as btrfs-progs or specific wireless firmware; see packages.both for comparison.

To install other packages or groups to the new system, append their names to pacstrap (space separated) or to individual pacman(8) commands after the #Chroot step.

Configure the system

Fstab

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

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

Check the resulting file in /mnt/etc/fstab afterwards, and edit it in case of errors.

Chroot

Change root into the new system:

# arch-chroot /mnt

Time zone

Set the time zone:

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

Run hwclock(8) to generate /etc/adjtime. If the hardware clock is set to UTC, other operating systems should be configured accordingly.

# hwclock --systohc --utc

Locale

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

# locale-gen

Add LANG=your_locale to locale.conf(5), and if required, console keymap and font to vconsole.conf(5).

Hostname

Create an entry for your hostname in /etc/hostname:

# echo myhostname > /etc/hosts

A matching entry in /etc/hosts is recommended, see Network configuration#Set the hostname.

Network configuration

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

For Wireless configuration, install the iw, wpa_supplicant, and dialog packages, as well as needed firmware packages.

Initramfs

When making configuration changes to mkinitcpio.conf, create a new initial RAM disk with:

# mkinitcpio -p linux

Root password

Set the root password:

# passwd

Boot loader

See Category:Boot loaders for available choices and configurations. Choices include GRUB (BIOS/UEFI), systemd-boot (UEFI) and syslinux (BIOS).

If you have an Intel CPU, in addition to installing a boot loader, install the intel-ucode package and enable microcode updates.

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(1).

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.

Post-installation

See General recommendations for system management directions and post-installation tutorials (like setting up a graphical user interface, sound or a touchpad).

For a list of applications that may be of interest, see List of applications.

This document is an annotated index of popular articles and important information for improving and adding functionalities to the installed Arch system. Readers are assumed to have read and followed the Installation guide to obtain a basic Arch Linux installation. Having read and understood the concepts explained in #System administration and #Package management is required for following the other sections of this page and the other articles in the wiki.

System administration

This section deals with administrative tasks and system management. For more, please see Core utilities and Category:System administration.

Users and groups

A new installation leaves you with only the superuser account, better known as "root". Logging in as root for prolonged periods of time, possibly even exposing it via SSH on a server, is insecure. Instead, you should create and use unprivileged user account(s) for most tasks, only using the root account for system administration. See Users and groups#User management for details.

Users and groups are a mechanism for access control; administrators may fine-tune group membership and ownership to grant or deny users and services access to system resources. Read the Users and groups article for details and potential security risks.

Privilege escalation

The su (substitute user) command allows you to assume the identity of another user on the system (usually root) from an existing login, whereas the sudo (substitute user do) command grants temporary privilege escalation for a specific command.

Service management

Arch Linux uses systemd as the init process, which is a system and service manager for Linux. For maintaining your Arch Linux installation, it is a good idea to learn the basics about it. Interaction with systemd is done through the systemctl command. Read systemd#Basic systemctl usage for more information.

System maintenance

Arch is a rolling release system and has rapid package turnover, so users have to take some time to do system maintenance. Read Security for recommendations and best practices on hardening the system.

Package management

This section contains helpful information related to package management. For more, please see FAQ#Package management and Category:Package management.

Note: It is imperative to keep up to date with changes in Arch Linux that require manual intervention before upgrading your system. Subscribe to the arch-announce mailing list or check the front page Arch news every time before you update. Alternatively, you may find it useful to subscribe to this RSS feed or follow @archlinux on Twitter.

pacman

pacman is the Arch Linux package manager: all users are required to become familiar with it before reading any other articles.

See pacman tips for suggestions on how to improve your interaction with pacman and package management in general.

Repositories

See Official repositories for details about the purpose of each officially maintained repository.

If you installed Arch Linux x86_64 and plan on using 32-bit applications, you will want to enable the multilib repository.

Unofficial user repositories lists several other unsupported repositories.

Mirrors

Visit Mirrors for steps on taking full advantage of using the fastest and most up to date mirrors of the official repositories. As explained in the article, a particularly good advice is to routinely check the Mirror Status page for a list of mirrors that have been recently synced.

Arch Build System

Ports is a system initially used by BSD distributions consisting of build scripts that reside in a directory tree on the local system. Simply put, each port contains a script within a directory intuitively named after the installable third-party application.

The Arch Build System (ABS) tree offers the same functionality by providing build scripts called PKGBUILDs, which are populated with information for a given piece of software; integrity hashes, project URL, version, license and build instructions. These PKGBUILDs are later parsed by makepkg, the actual program that generates packages cleanly manageable by pacman.

Every package in the repositories along with those present in the AUR are subject to recompilation with makepkg.

Arch User Repository

While the ABS tree allows the ability of building software available in the official repositories, the Arch User Repository (AUR) is the equivalent for user submitted packages. It is an unsupported repository of build scripts accessible through the web interface or through AurJson.

Booting

This section contains information pertaining to the boot process. An overview of the Arch boot process can be found at Arch boot process. For more, please see Category:Boot process.

Hardware auto-recognition

Hardware should be auto-detected by udev during the boot process by default. A potential improvement in boot time can be achieved by disabling module auto-loading and specifying required modules manually, as described in Kernel modules. Additionally, Xorg should be able to auto-detect required drivers using udev, but users have the option to configure the X server manually too.

Microcode

Processors may have faulty behaviour, which the kernel can correct by updating the microcode on startup. Intel processors require a separate package to this effect. See Microcode for details.

Retaining boot messages

Once it concludes, the screen is cleared and the login prompt appears, leaving users unable to gather feedback from the boot process. Disable clearing of boot messages to overcome this limitation.

Num Lock activation

Num Lock is a toggle key found in most keyboards. For activating Num Lock's number key-assignment during startup, see Activating Numlock on Bootup.

Graphical user interface

This section provides orientation for users wishing to run graphical applications on their system. See Category:X server for additional resources.

Display server

Xorg is the public, open-source implementation of the X Window System (commonly X11, or X). It is required for running applications with graphical user interfaces (GUIs), and the majority of users will want to install it.

Wayland is a new, alternative display server protocol and the Weston reference implementation is available. There is very little support for it from applications at this early stage of development.

Display drivers

The default vesa display driver will work with most video cards, but performance can be significantly improved and additional features harnessed by installing the appropriate driver for ATI, Intel, or NVIDIA products.

Desktop environments

Although Xorg provides the basic framework for building a graphical environment, additional components may be considered necessary for a complete user experience. Desktop environments such as GNOME, KDE, LXDE, and Xfce bundle together a wide range of X clients, such as a window manager, panel, file manager, terminal emulator, text editor, icons, and other utilities. Users with less experience may wish to install a desktop environment for a more familiar environment. See Category:Desktop environments for additional resources.

Window managers

A full-fledged desktop environment provides a complete and consistent graphical user interface, but tends to consume a considerable amount of system resources. Users seeking to maximize performance or otherwise simplify their environment may opt to install a window manager alone and hand-pick desired extras. Most desktop environments allow use of an alternative window manager as well. Dynamic, stacking, and tiling window managers differ in their handling of window placement.

Display manager

Most desktop environment include a display manager for automatically starting the graphical environment and managing user logins. Users without a desktop environment can install one separately. Alternatively you may start X at login as a simple alternative to a display manager.

Power management

This section may be of use to laptop owners or users otherwise seeking power management controls. For more, please see Category:Power management.

See Power management for more general overview.

ACPI events

Users can configure how the system reacts to ACPI events such as pressing the power button or closing a laptop's lid. For the new (recommended) method using systemd, see Power management with systemd. For the old method, see acpid.

CPU frequency scaling

Modern processors can decrease their frequency and voltage to reduce heat and power consumption. Less heat leads to more quiet system and prolongs the life of hardware. See CPU frequency scaling for details.

Laptops

For articles related to portable computing along with model-specific installation guides, please see Category:Laptops. For a general overview of laptop-related articles and recommendations, see Laptop.

Suspend and Hibernate

See main article: Suspend and hibernate.

Multimedia

Category:Multimedia includes additional resources.

Sound

Sound is provided by kernel sound drivers:

  • ALSA is included with the kernel and is recommended because usually it works out of the box (it just needs to be unmuted).
  • OSS is a viable alternative in case ALSA does not work.

Users may additionally wish to install and configure a sound server such as PulseAudio. For advanced audio requirements, see professional audio.

Browser plugins

For access to certain web content, browser plugins such as Adobe Acrobat Reader, Adobe Flash Player, and Java can be installed.

Codecs

Codecs are utilized by multimedia applications to encode or decode audio or video streams. In order to play encoded streams, users must ensure an appropriate codec is installed.

Networking

This section is confined to small networking procedures. Head over to Network configuration for a full guide. For more, please see Category:Networking.

Clock synchronization

The Network Time Protocol (NTP) is a protocol for synchronizing the clocks of computer systems over packet-switched, variable-latency data networks. See Time#Time synchronization for implementations of such protocol.

DNS security

For better security while browsing web, paying online, connecting to SSH services and similar tasks consider using DNSSEC-enabled client software which can validate signed DNS records, and DNSCrypt to encrypt DNS traffic.

Setting up a firewall

A firewall can provide an extra layer of protection on top of the Linux networking stack. While the stock Arch kernel is capable of using Netfilter's iptables, it is not enabled by default. It is highly recommended to set up some form of firewall, see Firewalls for the available guides.

Resource sharing

To share files among the machines in a network, follow the NFS or the SSHFS article.

Use Samba to join a Windows network. To configure the machine to use Active Directory for authentication, read Active Directory Integration.

See also Category:Network sharing.

Input devices

This section contains popular input device configuration tips. For more, please see Category:Input devices.

Keyboard layouts

Non-English or otherwise non-standard keyboards may not function as expected by default. The necessary steps to configure the keymap are different for virtual console and Xorg, they are described in Keyboard configuration in console and Keyboard configuration in Xorg respectively.

Mouse buttons

Owners of advanced or unusual mice may find that not all mouse buttons are recognized by default, or may wish to assign different actions for extra buttons. Instructions can be found in All Mouse Buttons Working.

Laptop touchpads

Many laptops use Synaptics or ALPS "touchpad" pointing devices. These, and several other touchpad models, use the Synaptics input driver; see Touchpad Synaptics for installation and configuration details.

TrackPoints

See the TrackPoint article to configure your TrackPoint device.

Optimization

This section aims to summarize tweaks, tools and available options useful to improve system and application performance.

Benchmarking

Benchmarking is the act of measuring performance and comparing the results to another system's results or a widely accepted standard through a unified procedure.

Maximizing performance

The Maximizing performance article gathers information and is a basic rundown about gaining performance in Arch Linux.

Solid state drives

The Solid State Drives article covers many aspects of solid state drives, including configuring them to maximize their lifetimes.

System service

This section relates to daemons. For more, please see Category:Daemons and system services.

File index and search

Most distributions have a locate command available to be able to quickly search for files. To get this functionality in Arch Linux, mlocate is the recommended install. After the install you should run updatedb to index the filesystems.

Local mail delivery

A default base setup bestows no means for mail syncing. To configure Postfix for simple local mailbox delivery, see Postfix. Other options are SSMTP, msmtp and fdm.

Printing

CUPS is a standards-based, open source printing system developed by Apple. See Category:Printers for printer-specific articles.

Appearance

This section contains frequently-sought "eye candy" tweaks for an aesthetically pleasing Arch experience. For more, please see Category:Eye candy.

Fonts

You may wish to install a set of TrueType fonts, as only unscalable bitmap fonts are included in a basic Arch system. The ttf-dejavu package provides a set of high quality, general-purpose fonts with good Unicode coverage.

A plethora of information on the subject can be found in the Fonts and Font configuration articles.

If spending a significant amount of time working from the virtual console (i.e. outside an X server), users may wish to change the console font to improve readability; see Fonts#Console fonts.

GTK+ and Qt themes

A big part of the applications with a graphical interface for Linux systems are based on the GTK+ or the Qt toolkits. See those articles and Uniform look for Qt and GTK applications for ideas to improve the appearance of your installed programs and adapt it to your liking.

Console improvements

This section applies to small modifications that better console programs' practicality. For more, please see Category:Command shells.

Aliases

Aliasing a command, or a group thereof, is a way of saving time when using the console. This is specially helpful for repetitive tasks that do not need significant alteration to their parameters between executions. Common time-saving aliases can be found in Bash#Aliases, which are easily portable to zsh as well.

Alternative shells

Bash is the shell that is installed by default in an Arch system. The live installation media, however, uses zsh with the grml-zsh-config addon package. See Command-line shell#List of shells for more alternatives.

Bash additions

A list of miscellaneous Bash settings, including completion enhancements, history search and Readline macros is available in Bash#Tips and tricks.

Colored output

This section is covered in Color output in console.

Compressed files

Compressed files, or archives, are frequently encountered on a GNU/Linux system. Tar is one of the most commonly used archiving tools, and users should be familiar with its syntax (Arch Linux packages, for example, are simply xzipped tarballs). See Bash/Functions for other helpful commands.

Console prompt

The console prompt (PS1) can be customized to a great extent. See Color Bash Prompt or Zsh#Prompts if using Bash or Zsh, respectively.

Emacs shell

Emacs is known for featuring options beyond the duties of regular text editing, one of these being a full shell replacement. Consult Emacs#Colored output issues for a fix regarding garbled characters that may result from enabling colored output.

Mouse support

Using a mouse with the console for copy-paste operations can be preferred over GNU Screen's traditional copy mode. Refer to Console mouse support for comprehensive directions.

Scrollback buffer

To be able to save and view text which has scrolled off the screen, refer to Scrollback buffer.

Session management

Using terminal multiplexers like tmux or GNU Screen, programs may be run under sessions composed of tabs and panes that can be detached at will, so when the user either kills the terminal emulator, terminates X, or logs off, the programs associated with the session will continue to run in the background as long as the terminal multiplexer server is active. Interacting with the programs requires reattaching to the session.