<<

REVIEWS Arch

Getting back to basics with ARCH SIMPLICITY

If you’re looking for a fast, stable system without the GUI goo, try new to Linux. The Arch philosophy is to scribes a few of Arch’s more interesting Arch Linux. keep the user close to the underlying features. system. Users are expected to tinker di- BY JON KENT rectly with configuration files (like in the Installation old days). But Arch also provides some Unlike most major distributions, Arch’s he recent emphasis of the Linux advantages over other simplicity distros installation program is text based. If you community has been on desktop such as , including hotplug in- have installed Slackware or , this Tdistros that make it easy to install novations and a more versatile text-based installation will be very famil- and configure the system without ven- management system. Also, turing beyond the GUI. Despite the suc- because Arch is specifically cess of these beginner-friendly systems, optimized for the i686 , it a significant segment of the Linux popu- offers performance benefits lation prefers a simpler approach. These over distros designed for a back-to-basics users want clarity, stabil- broader range of architec- ity, and speed, and they do not care tures. Fans of Arch say it pro- about the proliferation of redundant vides “…the stability and tools and glossy configuration helpers simplicity of Slackware and that populate the GUI-based systems. In the speed of Gentoo [2].” The the past, no-frills Linux users gravitated box titled “Arch on Arch” to systems such as Slackware, Gentoo, gives an indication of how or Debian, but another back-to-basics the Arch developers compare distro is gaining favor among the Linux their own product with other faithful: Arch Linux. distributions. Arch Linux [1] was started by Judd Although it may seem that Vinet in 2001 when he discovered that a distribution like Arch he couldn’t find any other distribution would be more difficult for a that met his ideals. Arch has taken ideas beginning user to learn to from Debian, Gentoo and Slackware, use, the advantage of a sys- and has gradually evolved into a simple, tem like Arch is that, once powerful, and stable distribution with an you learn it, you really know active user and developer population. something about Linux. This Figure 1: Arch expects you to configure your system the Arch provides few configuration tools article helps you get started old fashioned way: through text-based configuration and is not designed for users who are with Arch Linux and de- files.

44 ISSUE 64 MARCH 2006 WWW.LINUX - MAGAZINE.COM Arch Linux REVIEWS

iar. Arch will happily install alongside Listing 1: Arch Start The order of the services in rc.conf is any other operating systems you have in- important, as they are started in the Scripts stalled already, although you should al- exact order entered. There is no check- ways back up any important data. It is 01 /etc/rc.sysinit - takes care ing to verify any dependences, so if a worth having access to another PC to of loading and setting up the service does not start up as expected, it view, or print out, the well written in- system. is worth checking that the order is cor- stallation documentation [4] on Arch’s rect. Lastly, it is worth double checking 02 /etc/rc.single - script file web site. the configuration changes you have for single user system level As with most installations, you first made, and that you have made all the re- 03 /etc/rc.multi - script file need to partition your disk, which is per- quired modifications, as the installer will for multiple users system formed using cfdisk, or you can let Arch allow you to carry on even if you have level take over the entire disk if you wish. not edited all the files. Once you have created the partitions and 04 /etc/rc.local - script file When you are finished with the instal- set the points, the next task is to for local-multi users system lation, reboot the system, and you should select the packages to install. It is recom- level have a minimal Arch system. The next mended that you install the base pack- 05 /etc/rc.shutdown - script file step is to update your system via the pac- ages only at this stage and install any re- for shutdown system level man tool (outlined later) to ensure the maining packages once the system is 06 /etc/rc.d/* - configured system is up to date before adding addi- running correctly. deamons for the system. tional packages. If you selected over Once the base system is installed, se- devfs, this upgrade will be straight for- lect a kernel configured for IDE or SCSI ward, but if you used devfs, you’ll find (which you’ll need if you have any SATA You are presented with a list of config- you need to perform additional steps to devices), or you can even build your uration files that need to be edited. convert from devfs to udev. own kernel if you wish. However, at this There are useful comments inside these stage, it is probably more sensible to se- files, but it does help to have an under- System Startup lect a kernel rather than build you own, standing of their function. These files The main philosophy of Arch is to give as it is best to have a fully operating sys- will be familiar to users who have con- you complete control over the configura- tem before making a fundamental figured Linux systems without the help tion. As you will have seen during instal- change. Make sure you select a udev ker- of a GUI installer. For instance, you’ll use lation, nothing is configured automati- nel, not a devfs kernel, as Arch has now the rc.conf file to configure the network, cally for you and no services are moved from devfs to udev. The last stage hostname, kernel modules to load, and switched on unless you have configured in the installation process is to configure services to start. You will need to be able them to be. This approach means that the system, and this is where access to to use a text editor such as or nano to you come to understand the Arch sys- the documentation will come in handy. edit these files. tem, and Linux itself, very quickly.

Arch on Arch A page at the Arch Linux website com- wrote pacman and makepkg to replace spect. Arch is i686 only, whereas Slack- pares Arch with other popular Linux dis- my pseudo packaging scripts. (I ware can run on i486 systems. Arch is a tributions [3]. The comparison, of course, built Arch as an LFS system.) So the two very good system for Slack users who is courtesy of Arch, and the other distros are completely separate distros, but want more robust package management may see it differently, but this summary technically, they’re almost the same. We or more current packages. (which is excerpted below) provides have dependency support (officially) for Arch vs. Debian some insights on the goals and context example, although Crux has a commu- Arch is simpler than Debian. Arch has for Arch Linux. nity that provides other features. CLC’s fewer packages. Arch provides better prt-get will do rudimentary dependency Arch vs. Gentoo support for building your own packages logic. Crux gets to ignore lots of prob- Gentoo has more packages. Arch allows than Debian does. Arch is more lenient lems we have too, since it’s a very mini- both binary and source based distribu- when it comes to “non-free” packages, malistic package set, basically what Per tion. PKGBUILDs are easier to create than as defined by GNU. Arch is i686 opti- uses and nothing else.” ebuilds. Gentoo is more portable out of mized. Arch packages are more bleeding the box, as packages will get compiled to Arch vs. Slackware edge than Debian packages. your specific architecture, whereas as Slackware and Arch are both “simple” Arch vs. Graphical Distros Arch is i686 only (although i586 and x64 distributions. Both use BSD-style init The graphical distros have a lot of simi- user-based spinoff projects are under- scripts. Arch supplies a much more ro- larities, and Arch is very different from way). There is no documented proof that bust package management system in any of them. Arch is text based and com- Gentoo is any faster than Arch. pacman, which, unlike Slackware’s stan- mand-line oriented. Arch is a better dis- Arch vs. Crux dard tools, allows simple automatic sys- tro if you want to truly learn Linux. Arch Linux is descended from Crux. tem upgrades. Slackware is seen as Graphical-based distros tend to ship with Judd once summarized the differences: more conservative in its release cycle, GUI installers (like Fedora’s Anaconda) “I used Crux before starting Arch. Arch preferring proven stable packages. Arch and GUI system configuration tools (like started out as Crux, pretty much. Then I is much more “bleeding edge” in this re- Suse’s Yast).

WWW.LINUX - MAGAZINE.COM ISSUE 64 MARCH 2006 45 REVIEWS Arch Linux

and so on. pac- wish to synchronize against. You can man provides an also specify the configuration files that easy way to man- are not to be modified by a package in- age and install stallation. Additionally if you wish to packages from ei- freeze a package at the current version, ther the official you can configure pacman to put a pack- Arch repositories age on hold within this file. or from user re- positories. NoUpgrade = U User reposito- etc/passwd etc/group U ries, referred to as etc/shadow etc/sudoers AUR (Arch User HoldPkg = pacman glibc Repositories) are a very useful feature In the repository section, you define of Arch, allowing which repositories to use. You can define a user to supply a these repositories directly or include Figure 2: Although Arch emphasizes text file-based configuration, package not found them from another file. The latter option you can still use it with a desktop like Gnome or KDE. in the standard is useful for the official repositories, Arch repositories. which have a lot of mirrors. Arch has chosen to use a BSD style A good example of this is the fouiny_ init system, which is also used with repo repository, which provides pack- Source Package Slackware. For some, this is the true init ages for the E17 version of Enlighten- Management system, although others prefer the Sys- ment. In addition, you can create your Arch also provides a source management tem V init approach used by a high pro- own local repository for any packages tool ABS (Arch Build System), which is portion of Linux distributions. That you want to control. almost like Gentoo’s emerge. ABS is de- aside, you can still use System V init Like any good , pac- signed to package new that is scripts, which are located in /etc/rc.d. man allows you to easily update your not yet available elsewhere, customize system. You simply synchronize the existing packages to your requirements, Binary Package package list held on your system, and if or even re-build the entire system using Management you ask pacman to synchronize and up- your compiler flags. Arch provides the binary package man- date, pacman will then update all pack- When you use ABS, it builds a pack- agement tool pacman, which is analo- ages to the latest version. Installing age that can be installed via the pacman gous to Debian’s -get tool. pacman packages is equally simple; pacman will tool. You do not need to use ABS to have uses .gz files as a and download any dependencies that the a fully functional system, but it does give maintains a text-based package database. package requires. you the ability to tune software packages As with apt-get, pacman provides you Pacman is configured via the configu- to your liking. with the ability to install and remove ration file ABS uses the cvsup and wget pack- packages, query installation status of a /etc/pacman.conf. Within this configura- ages, so these need to be installed before package, update the package database, tion file, you specify the repositories you ABS can be used:

Listing 2: pacman Command Options pacman -Sy cvsup wget

01 pacman -Sy - synchronize local packages database It is always sensible to use the -Sy flag 02 pacman -S package_name - installing, reinstalling or upgrading a when installing any software to ensure package that you are installing the latest version, 03 pacman -S extra/package_name - install package from extra repository as this option updates your package list 04 pacman -Su - upgrade all packages installed if required before starting any installation. 05 pacman -A //package_name-version.pkg.tar.gz - Run the abs command to synchronize installing a local package the ABS tree with the arch using CVS, which is then mirrored into /var/ 06 abs. The directory structure is straight 07 pacman - package_name - remove package forward. The base level of /var/abs rep- 08 pacman -Rs package_name - remove package and its dependencies if it resents each category, and the next level is safe to do so has directories for each package. Each 09 directory contains a PKGBUILD file for 10 pacman -Ss package - search for a package the package. 11 pacman -Si package - display package information To install software from ABS, change to the directory of the software package 12 pacman -Scc - clear all downloaded file from pacman's cache in the ABS tree and then execute the

46 ISSUE 64 MARCH 2006 WWW.LINUX - MAGAZINE.COM REVIEWS Arch Linux

makepkg command. The makepkg com- not have to wait mand expects the PKGBUILD file to be in for modprobe to the local directory. Once the source code load each module is compiled, you can then install the new before it can con- software tree via pacman as follows: tinue. hwd is for both Install new new package: devfs and udev pacman -A U device systems. [package name].pkg.tar.gz Because hwd is Upgrade an existing package: not a configura- pacman -U U tion utility, it does [package name].pkg.tar.gz not change config- uration files, as In addition to these directories, there is a that would go directory called local below /var/abs. against Arch phi- Figure 3: hwd detects hardware and displays system information. This is for you to create your own pack- losophy. Instead ages, rather than modifying the PKG- hwd detects hardware and provides in- which you can use to create your final X BUILD files you have synchronized. If formation how to manually configure configuration. the current PKGBUILD file does not have your hardware. the settings you require, create a direc- You do not have to install hwd if you Desktop tory under local, copy the file to this di- are happy with hotplug: as with all Arch uses X.org as its X-Server and has rectory, add or remove settings, and then things Arch, use of hwd is completely packages for all major desktops. For run the makepkg command to compile optional. If you rarely reboot your sys- each desktop, you will find all of the and install the software. tem, or if you can live with the slight in- major applications, including non-free To control which gcc optimizations crease in boot up time, there is no rea- applications such as Flash and Acrobat. you will use, makepkg has a configura- son why you cannot stay with hotplug. Some applications will add themselves tion file called /etc/makepkg.conf. If you Installing hwd is easy: to the desktop menu, while others will have used Gentoo, the options within require you to manually add them. In this file will make sense. By default, pacman -Sy hwd lshwd this area there does not seem to be a Arch uses -march=i686 -O2 -pipe gcc standard for Arch, which can be a bit an- flags, but if you prefer to live danger- Even though hwd is now installed, you noying. However, the speed at which ously, you could change this to -O3. As still need to configure the hwd service to GNOME or E17 run is quite impressive, Arch is firmly i686 based, it makes little start at boot time and disable hotplug. and this must be due in part to the focus sense to change the -march option un- As you’d expect, this option is controlled on i686 as the standard base for all Arch. less you are feeling very adventurous. within the rc.conf file and is simply a case of adding the following line to this Conclusion hwd file: Arch Linux is a fast and lightweight dis- By default, Arch uses the hotplug hard- tribution that takes the stripped down ware detection scripts used in most !hotplug hwd approach and is the better for it. Even if Linux distributions. Hotplug simplifies you have little Linux experience, you the module configuration, autodetects The ! in front of hotplug disables the should be able to get Arch up and run- hardware, and loads necessary modules. hotplug service. The next step is to ning, and the knowledge you gain tin- However Arch’s developers felt that hot- download the latest pci/ pcmcia tables, kering with Arch will deepen your un- plug was too slow and set about devel- which hwd uses to identify the hard- derstanding of Linux. ■ oping their own approach, which they ware, by running: call hwd. Unlike hotplug, hwd executes INFO modprobe in child processes, so it does hwd -u [1] Arch Linux main site: Arch Linux: http:// www. archlinux. org Listing 3: /etc/ pacman.conf Now when you reboot your system, hwd [2] http:// michael-and-mary. net/ intro/ entries will run instead of hotplug. node/ 260/ 380 In addition to hardware detection, [3] Arch vs. Others: http:// wiki. archlinux. 01 [repository-name] hwd and lshwd can also be used to org/ index. php/ Arch_vs_Others 02 Server = ftp://server.net/repo setup an initial X configuration file or to [4] Arch installation guide: 03 [current] help you set up X. http:// archlinux. org/ docs/ en/ guide/ install/ arch-install-guide. html 04 # Add your preferred servers [5] Arch forums: http:// bbs. archlinux. org here, they will be used first hwd -x [6] Arch user contributions: 05 Include = /etc/pacman.d/ This command will create a sample http:// user-contributions. org/ home/ current index. php X.org configuration file in /etc/X11,

48 ISSUE 64 MARCH 2006 WWW.LINUX - MAGAZINE.COM