Arch Handbook

From ArchWiki
Revision as of 20:22, 8 April 2010 by Thestinger (Talk | contribs) (changed {{stub}} --> {{expansion}})

Jump to: navigation, search

Tango-view-fullscreen.pngThis article or section needs expansion.Tango-view-fullscreen.png

Reason: please use the first argument of the template to provide a brief explanation. (Discuss in Talk:Arch Handbook#)

Notice

This handbook has only just been started. It's currently a rather bare outline. Please edit it and make it better! Look at the FreeBSD Handbook as a style guide.

Most sections should be a summary, with a link to the main article on the subject.

Getting Started

Introduction

Arch linux is a lightweight and flexible linux distribution that tries to Keep It Simple. There are official packages optimized for the i686 and x86-64 architectures. There is also a community-operated package repository. See the pages in this category

Installing Arch Linux

There are two types of install CD. The CORE CD holds the packages required to get a basic system running. The FTP CD pulls the latest packages from the repositories during the install. Both CDs have NCURSES installers. There are the following steps:

  1. Loading a non-US Keymap
  2. Running Setup
  3. Configure Network (FTP Install only)
  4. Prepare Hard Drive
    1. Auto-Prepare
    2. Partition Hard Drives
    3. Set Filesystem Mountpoints
  5. Select Packages
  6. Install Packages
  7. Configure System
  8. Install Kernel
  9. Install Bootloader
  10. Exit Install

The full install guide is here and the install CDs are available here. If you would like a more detailed installation guide, please see the Beginners' Guide.

Linux Basics

A few basics on the file system and command line, for people starting Unix/Linux with Arch.

Installing Software: Pacman

Some basics on Pacman options, how repositories work, etc.

Pacman is the Arch Linux package management tool. It is a command line tool which provides an easy way to install and manage applications, libraries and other software. It is extremely easy to use and powerful, and will be one of the main administrative tools you will use while running Arch Linux. The main operations are

pacman -S app # install package named app
pacman -Syu # update package database and upgrade any packages
pacman -R app # remove package name app

To get a full list of operations pacman can perform, open a terminal and type:

pacman --help

To get more detail on an operation, combine it with --help:

pacman --help -S

Or, for a more in-depth guide, consult the man page:

man pacman

See the wiki entry for pacman for a user-friendly guide.

X11 and Graphical Desktop Environments

Basics of X11 concepts, installation and configuration of Gnome, KDE, etc.

Xorg

Xorg is the public, open-source implementation of the X11 X Window System. Basically, if you want a GUI atop Arch, you will want xorg. It is installed by:

pacman -S xorg

Drivers for your video card are also needed. They are listed by this command:

pacman -Ss xf86-video

You also need a /etc/X11/xorg.conf file. This can be automatically generated by hwdetect:

pacman -S hwdetect
hwdetect -xa

You may want to edit this slightly before proceeding. Then test Xorg by executing

startx

This should give the basic WM.

Window Managers and Desktop Environments

Maintaining your system

Introduction

Installing, updating and removing software is a fairly common task and this chapter will introduce you to Pacman(8). Pacman is a package manager that will aid you in keeping your system up-to-date, installing new software and general house keeping. If this is your first time with Arch Linux you REALLY want to read this chapter at least once. Not reading it will severely impair your experience with Arch, so please read it carefully.

After reading this chapter you will know...

  • ... how to install, remove and update software.
  • ... how to search for software in the package database.
  • ... how to update every single software package on your computer.
  • ... how to query the package database for information about installed packages.

Let's get on with it shall we?

Pacman introduction

As mentioned previously Pacman(8) is a software utility that helps you keep your system up-to-date and install, remove or update software. Pacman will automatically resolve dependencies during installation of a software. A dependency is simply another software package required by the program you're trying to install.

Let's us fire up Pacman and see what it can do. In a console type the following:

sh$ pacman --help usage: pacman <operation> [...] options:

   pacman {-h --help}
   pacman {-V --version}
   pacman {-A --add}     [options] <file>
   pacman {-Q --query}   [options] [package]
   pacman {-R --remove}  [options] <package>
   pacman {-S --sync}    [options] [package]
   pacman {-U --upgrade} [options] <file>

use 'pacman --help' with other options for more syntax

Functionality in Pacman is split into a main action and a sub-action. Each action usually requires an argument to specify exactly what you're trying to achieve. For example --query (or -Q) will allow you to query the package database to see installed packages and other types of information related to the software installed. Let's assume we wanted to find out which package owns the file /etc/rc.conf. In a console type the following:

sh$ pacman --query --owns /etc/rc.conf /etc/rc.conf is owned by initscripts 2008.03-4

As we can see here rc.conf is owned by initscripts 2008.03-4. Most actions can be abbreviated such that '--query --owns' becomes '-Qo' . For clarity we'll however continue to use the longer version.

Searching for software

Pacman comes with powerful searching capabilities and that allows you to do searches using regular expressions. If you're unfamiliar with regular expressions there is no reason for concern as you'll do just fine without them.

Searching is done through the --sync (or -S) action and sub-action --search (or -s). Let's see if we can find a package called wpa_supplicant. In a console type the following:

sh$ pacman --sync --search wpa_supplicant core/wpa_supplicant 0.5.10-1 (base)

   A utility providing key negotiation for WPA wireless networks

extra/wpa_supplicant_gui 0.5.10-1

   A qt frontend to wpa_supplicant

The results displays two matching packages one from the 'core' respository and another from 'extra'. Should we want more detailed information about this package we can again use Pacman to query the database with --sync --info. In a console type the following:

sh$ pacman --sync --info wpa_supplicant Repository  : core Name  : wpa_supplicant Version  : 0.5.10-1 URL  : None Licences  : None Groups  : base Provides  : None Depends On  : openssl Optional Deps  : None Conflicts With : None Replaces  : None Download Size  : 193.46 K Installed Size : 193.46 K Packager  : None Architecture  : None Build Date  : None MD5 Sum  : 91b2beebb2abea973c18eb672057f128 Description  : A utility providing key negotiation for WPA wireless networks

Installing software

Now that you've found a package it's time to install it. Choose any package you're interested in and type the following in your console:

 # pacman -S muparser
 resolving dependencies...
 looking for inter-conflicts...
 
 Targets: muparser-1.28-1  
 
 Total Download Size:    0.15 MB
 
 Proceed with installation? [Y/n]

Pacman will check for dependencies and if all is good proceed to download required packages. Once all files are downloaded Pacman will proceed to install them. While installing the software Pacman might print messages during installation. It's VERY important that you read these messages as they usually contain important information about the software you're installing.

(!) Note: Remember to read any messages printed by Pacman during installation, they are printed for a reason and should be considered essential reading. Please don't forget! (!)

Removing software

So you've decided to remove a package from the system. Again Pacman will happily do this for you and also remove any non-explicitly (dependencies) installed packages as well. Pacman will obviously not remove depdencies if they are required by other packages, but if you want that Pacman can do that as well.

To remove a particular package and any dependencies no longer needed type the following in a console:

sh$ pacman --remove --recursive muparser

Pacman will remove any files belonging to the specified package and potential dependencies. It's important to understand that some files might remain on the system even after removing the package. There might for example be configuration files left in your home-folder and Pacman will NOT remove these files.

Updating software

Pacman will obviously not only install and remove software packages but also help you maintain the ones you have installed on your system. Keeping software up-to-date is useful for many reasons such as removing security vulnerabiltiies, bugs and perhaps even adding more functionality.

Before proceeding with any package updating you should first ensure that you have the most recent snapshop of currently available packages. This is done through a simple command to Pacman. Type the following in your console:

sh$ pacman --sync --refresh

Pacman will connect to each repository and update, if necessary, information about available software packages. Once Pacman has updated your respositories it's time to check if you've got any outdated packages that may be upgraded to a later version.

Generally you'll want to update the entire system in one go, but we'll first walk through the steps of updating just one package. To find out what packages may be updated we'll use Pacman to query the package database. In a console type the following:

sh$ pacman --query --upgrades

Choose a package you'd like to update and type the following in a console:

sh$ pacman --sync <package_to_upgrade>

Confirm the procedure and Pacman will begin downloading new packages and any necessary dependencies. Should you want to avoid updating of dependencies you'd also want to add --nodeps (or -d).

Clearly this is not a particularily quick and efficient way of updating your entire system, especially if you've got more than ten available package updates. Pacman does solve this problem as well so keep reading and you'll learn how you can update your entire system in just one command.

Updating the entire system

If you've not already run your repository update, please do so now. (In case you don't remember: pacman --sync --refresh) In a console type the following:

sh$ pacman --sync --sysupgrade

Pacman will now begin a possibly lengthy process of downloading and updating your entire system. Depending on things such as download speed, processor power it might take anything from a few seconds to a half an hour. Not too bad considering your entire system will be completely updated after it finishes.

(!) Note: During installation Pacman might print messages on the screen. It's VERY important that you do not ignore these messages as they are printed for a reason. Read them, please! If you don't understand the meaning of them, write them down and use ask the forum for help. (!)

Sometimes Pacman may update important packages that contain updates to some of your configuration files in for example /etc. It's important to always keep an eye out for .pacnew files in this folder. Pacman will only produce these files (.pacnew/.pacsave) if you've made any changes to the files being updated. If no changes have been made Pacman will automatically replace the old files with the new ones. We'll talk more about this in a later chapter.

Summary

This chapter introduced you to some of the basic functionality of Pacman. There is much more functionality in Pacman and we've only really scratched the surface. If you'd like a more thorough description of all the options Pacman provide we recommend reading the man pages for Pacman(8).

Hopefully this chapter have demonstrated some of the Pacman power and why it makes Arch Linux a powerful, yet simple Linux distribution. In the next chapter we'll talk about how to various aspects of Arch Linux. See you there!

Common Tasks

Desktop Applications

Web browsers, office suites, etc.

Multimedia

Video players, music jukeboxes, photo management, how to get codecs.

Printing

CUPS installation and configuration, finding drivers.

System Administration

Configuration and Tuning

A lot of the configuration of Arch is done in /etc/rc.conf. This may sound daunting , but it is well commented and allows you to set modules for auto-loading and blacklisting, along with daemons and some network configuration. Details on some common configuration (init, cron).

Users and Basic Account Management

Creating and managing users with command-line utilities.

Users are created with adduser. Users must also be added to groups to make them useful.

Networking

Network Configuration

How networks are set up in Arch.

Servers

Mail, web, SSH server installation and configuration.

Firewalls

Basic firewall concepts, how to use iptables.