Difference between revisions of "Arch Handbook"

From ArchWiki
Jump to: navigation, search
(System Administration)
(45 intermediate revisions by 10 users not shown)
Line 1: Line 1:
[[Category:Desktop user's guide (English)]]
+
[[Category:Getting and installing Arch]]
 
+
{{out of date}}
{{stub}}
+
 
+
 
== Notice ==
 
== 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 [http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ FreeBSD Handbook] as a style guide.
 
This handbook has only just been started. It's currently a rather bare outline. Please edit it and make it better! Look at the [http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ FreeBSD Handbook] as a style guide.
Line 13: Line 11:
 
Arch linux is a lightweight and flexible linux distribution that tries to Keep It Simple.
 
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.
 
There are official packages optimized for the i686 and x86-64 architectures. There is also a community-operated package repository.
See the pages in [[:Category: About Arch (English)|this category]]
+
See the pages in [[:Category:About Arch|this category]]
  
 
=== Installing Arch Linux ===
 
=== 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:
+
The full install guide is [[Installation Guide|here]] and the install CDs are available [https://www.archlinux.org/download/ here]. If you would like a more detailed installation guide, please see the [[Beginners' Guide]].
#Loading a non-US Keymap
+
#Running Setup
+
#Configure Network (FTP Install only)
+
#Prepare Hard Drive
+
##Auto-Prepare
+
##Partition Hard Drives
+
##Set Filesystem Mountpoints
+
#Select Packages
+
#Install Packages
+
#Configure System
+
#Install Kernel
+
#Install Bootloader
+
#Exit Install
+
 
+
The full install guide is [[Official Arch Linux Install Guide|here]] and the install CDs are available [http://www.archlinux.org/download/ here]. If you would like a more detailed installation guide, please see the [[Beginners Guide|Beginners' Guide]].
+
  
 
=== Linux Basics ===
 
=== Linux Basics ===
 
A few basics on the file system and command line, for people starting Unix/Linux with Arch.
 
A few basics on the file system and command line, for people starting Unix/Linux with Arch.
  
=== Installing Software: Pacman ===
+
'''How to change directory:'''
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.
+
  cd /name/of/directory
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:
+
e.g.
 
+
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 <code>/etc/X11/xorg.conf</code> 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
+
cd /etc/pacman.d
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 make a directory:'''
* ... 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?
+
mkdir /path/to/new/directory
  
=== Pacman introduction ===
+
e.g.
  
As mentioned previously Pacman(8) is a software utility that helps you keep your system
+
mkdir /home/archuser/newfolder
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
+
'''How to remove an (empty) directory:'''
it can do. In a console type the following:
+
  
sh$ pacman --help
+
  rmdir /path/to/empty/directory
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
+
'''How to remove a non-empty directory:'''
  
Functionality in Pacman is split into a main action and a sub-action. Each action usually
+
rmdir --ignore-fail-on-non-empty /path/to/non_empty/directory
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
+
'''How to list files in a directory:'''
/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
+
All files: (except hidden files)
such that '--query --owns' becomes '-Qo' . For clarity we'll however continue to use the longer
+
version.
+
  
=== Searching for software ===
+
ls
  
Pacman comes with powerful searching capabilities and that allows you to do searches using
+
All files: (including hidden files)
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).
+
ls -a
Let's see if we can find a package called wpa_supplicant. In a console type the following:
+
  
sh$ pacman --sync --search wpa_supplicant
+
All files, hidden files and their properties:
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
+
ls -la
'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
+
Files with the .avi file extension only:
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 ===
+
ls *.avi
  
Now that you've found a package it's time to install it. Choose any package you're interested
+
'''How to move a file:'''
in and type the following in your console:
+
  
sh$ pacman --sync muparser
+
mv /path/to/old/file.ext /path/to/new/file.ext
resolving dependencies...
+
looking for inter-conflicts...
+
  
Targets: muparser-1.28-1 
+
e.g.
  
Total Download Size:    0.15 MB
+
mv /home/archuser/compressed.zip /home/archuser/myfiles/compressed2.zip
  
Proceed with installation? [Y/n]
+
'''How to copy a file:'''
  
Pacman will check for dependencies and if all is good proceed to download required packages.
+
cp /path/to/file.txt /path/to/copied/file.txt
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
+
'''How to remove a file:'''
for a reason and should be considered essential reading. Please don't forget! (!)
+
  
=== Removing software ===
+
rm /path/to/file.txt
  
So you've decided to remove a package from the system. Again Pacman will happily do this for
+
e.g.
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
+
rm /home/archuser/file.txt
console:
+
  
sh$ pacman --remove --recursive muparser
+
'''How to show the contents of a file:'''
  
Pacman will remove any files belonging to the specified package and potential dependencies. It's
+
cat /path/to/file.txt
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 ===
+
'''How to make a file executable:'''
  
Pacman will obviously not only install and remove software packages but also help you maintain
+
chmod +x /path/to/script.sh
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
+
'''How to (search the entire filesystem for) a file called euwfh.avi'''
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
+
cd /
  
Pacman will connect to each repository and update, if necessary, information about available
+
find -name euwfh.avi
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
+
'''How to mount a partition:'''
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
+
mount /dev/sdX1 /media/mountpoint
  
Choose a package you'd like to update and type the following in a console:
+
e.g.
  
sh$ pacman --sync <package_to_upgrade>
+
mount /dev/sda1 /media/folder
  
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,
+
'''How to show how much space is left/used on (all mounted) partitions:'''
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 ===
+
df -h
  
If you've not already run your repository update, please do so now. (In case you don't remember:
+
'''How to show all running processes:'''
pacman --sync --refresh) In a console type the following:
+
  
sh$ pacman --sync --sysupgrade
+
ps -A
  
Pacman will now begin a possibly lengthy process of downloading and updating your entire
+
'''How to stop an annoying process called "EvilTrojan":'''
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
+
killall EvilTrojan
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
+
'''How to show an unintelligible manual for a program "ultracompressor"'''
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 ===
+
man ultracompressor
  
This chapter introduced you to some of the basic functionality of Pacman. There is much more
+
=== Installing, removing, updating and managing software: pacman ===
functionality in Pacman and we've only really scratched the surface. If you'd like a more
+
See [[pacman]].
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
+
=== Graphical Desktop Environments ===
a powerful, yet simple Linux distribution. In the next chapter we'll talk about how to various
+
{{Graphical user interface overview}}
aspects of Arch Linux. See you there!
+
  
 
== Common Tasks ==
 
== Common Tasks ==
Line 292: Line 140:
  
 
=== Configuration and Tuning ===
 
=== 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.
+
[[Systemd]] is used for most administrative tasks.
Details on some common configuration (init, cron).
+
  
 
=== Users and Basic Account Management ===
 
=== Users and Basic Account Management ===
 
Creating and managing users with command-line utilities.
 
Creating and managing users with command-line utilities.
  
Users are created with <code>adduser</code>. Users must also be added to [[groups]] to make them useful.
+
Users are created with <code>useradd</code>. See [[Users and Groups]] for more information.
  
 
== Networking ==
 
== Networking ==
Line 309: Line 156:
  
 
=== Firewalls ===
 
=== Firewalls ===
Basic firewall concepts, how to use iptables.
+
See [[Firewalls]], [[iptables]], [[Simple Stateful Firewall]].

Revision as of 20:22, 18 January 2013

Tango-view-refresh-red.pngThis article or section is out of date.Tango-view-refresh-red.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

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.

How to change directory:

cd /name/of/directory

e.g.

cd /etc/pacman.d

How to make a directory:

mkdir /path/to/new/directory

e.g.

mkdir /home/archuser/newfolder

How to remove an (empty) directory:

rmdir /path/to/empty/directory

How to remove a non-empty directory:

rmdir --ignore-fail-on-non-empty /path/to/non_empty/directory

How to list files in a directory:

All files: (except hidden files)

ls

All files: (including hidden files)

ls -a

All files, hidden files and their properties:

ls -la

Files with the .avi file extension only:

ls *.avi

How to move a file:

mv /path/to/old/file.ext /path/to/new/file.ext

e.g.

mv /home/archuser/compressed.zip /home/archuser/myfiles/compressed2.zip

How to copy a file:

cp /path/to/file.txt /path/to/copied/file.txt

How to remove a file:

rm /path/to/file.txt

e.g.

rm /home/archuser/file.txt

How to show the contents of a file:

cat /path/to/file.txt

How to make a file executable:

chmod +x /path/to/script.sh

How to (search the entire filesystem for) a file called euwfh.avi

cd /
find -name euwfh.avi

How to mount a partition:

mount /dev/sdX1 /media/mountpoint

e.g.

mount /dev/sda1 /media/folder


How to show how much space is left/used on (all mounted) partitions:

df -h

How to show all running processes:

ps -A

How to stop an annoying process called "EvilTrojan":

killall EvilTrojan

How to show an unintelligible manual for a program "ultracompressor"

man ultracompressor

Installing, removing, updating and managing software: pacman

See pacman.

Graphical Desktop Environments

Template:Graphical user interface overview

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

Systemd is used for most administrative tasks.

Users and Basic Account Management

Creating and managing users with command-line utilities.

Users are created with useradd. See Users and Groups for more information.

Networking

Network Configuration

How networks are set up in Arch.

Servers

Mail, web, SSH server installation and configuration.

Firewalls

See Firewalls, iptables, Simple Stateful Firewall.