https://wiki.archlinux.org/api.php?action=feedcontributions&user=Listdata&feedformat=atom
ArchWiki - User contributions [en]
2024-03-28T20:14:18Z
User contributions
MediaWiki 1.41.0
https://wiki.archlinux.org/index.php?title=Frandom&diff=310177
Frandom
2014-04-12T07:40:10Z
<p>Listdata: /* Wiping a disk */ remove erroneous "sdx1" instruction; wiping a disk should refer to the entire disk, not a particular partition</p>
<hr />
<div>[[Category:Security]]<br />
[[Category:File systems]]<br />
{{Out of date|Needs updating to SystemD}}<br />
'''frandom''' is a fast alternative to [[Random number generation|/dev/urandom]]. It can be used wherever fast random number generation is required, eg for randomising large hard drives prior to [[System_Encryption_with_LUKS_for_dm-crypt|encryption]].<br />
<br />
From the [http://billauer.co.il/frandom.html frandom page]:<br />
"The frandom suite comes as a Linux kernel module for several kernels, or a kernel patch for 2.4.22. It implements a random number generator, which is 10-50 times faster than what you get from Linux' built-in {{ic|/dev/urandom}}."<br />
<br />
Does frandom generate good random numbers? Refer to the frandom page for this and other technical info.<br />
<br />
Beneath in the example section, you'll find 'real', 'user' and 'sys' information, what they mean you can find [http://stackoverflow.com/questions/556405/what-do-real-user-and-sys-mean-in-the-output-of-time1?answertab=active#tab-top here].<br />
<br />
== Installation ==<br />
Frandom is available as a package from the [https://aur.archlinux.org/packages.php?ID=9869 AUR].<br />
<br />
After installing frandom, you can make it available with:<br />
# sudo modprobe frandom<br />
<br />
The {{ic|/dev/frandom}} device should now exist on the filesystem.<br />
<br />
== Wiping a disk ==<br />
To use frandom to wipe a disk, use the {{ic|dd}} command:<br />
<br />
# dd if=/dev/frandom of=/dev/sdX<br />
<br />
Here, X refers to the drive you want to wipe.<br />
<br />
Refer to [[Securely wipe disk]] for more general info on this topic.<br />
<br />
== Example ==<br />
{{Merge|Benchmarking disk wipes|Maybe anyone can bring this to nicer Formatting, move it there and link to it?}}<br />
1) On a 1.73 GHZ Thinkpad T43 with 2 GB ram:<br />
# time dd if=/dev/frandom of=/dev/sdb2<br />
dd: writing to `/dev/sdb2': No space left on device<br />
587384596+0 records in<br />
587384595+0 records out<br />
300740912640 bytes (301 GB) copied, 12844.6 s, 23.4 MB/s<br />
real 214m4.620s<br />
user 3m34.693s<br />
sys 77m28.660s<br />
Summary: 300 GB in approx 3.5 hours<br />
<br />
<br />
2) On a 2.4 GHZ (T8300 Core 2 Duo) Thinkpad T61 with 2 GB ram:<br />
# dd if=/dev/frandom of=/dev/sdb bs=1M<br />
dd: writing `/dev/sdb': No space left on device<br />
476941+0 records in<br />
476940+0 records out<br />
500107862016 bytes (500 GB) copied, 5954.52 s, 84.0 MB/s<br />
Summary: 500 GB in approx 1.65 hours<br />
<br />
<br />
3) On a 2.8 GHz (Athlon2 X4) with 4 GB ram:<br />
# dd if=/dev/frandom of=/dev/sdc3 bs=1M seek=100KB<br />
dd: writing `/dev/sdc3': No space left on device<br />
1807429+0 records in<br />
1807428+0 records out<br />
1895225712640 bytes (1.9 TB) copied, 20300.3 s, 93.4 MB/s<br />
Summary: ~2TB in ~5.64 hours. However, on the same machine:<br />
# dd if=/dev/frandom of=/dev/null bs=1M count=1000<br />
1000+0 records in<br />
1000+0 records out<br />
1048576000 bytes (1.0 GB) copied, 7.81581 s, 134 MB/s<br />
versus<br />
# dd if=/dev/urandom of=/dev/null bs=1M count=1000<br />
1000+0 records in<br />
1000+0 records out<br />
1048576000 bytes (1.0 GB) copied, 144.296 s, 7.3 MB/s<br />
This makes frandom 10-20 times faster on this machine, meaning it would take approx 50-120 hours (2-5 days!) to randomize 2TB using urandom.<br />
<br />
4) On a 2.70GHz (i7-2620M) ThinkPad x220 with 8GB Ram:<br />
<br />
# time dd if=/dev/frandom of=/dev/sdc<br />
dd: writing to `/dev/sdc': No space left on device<br />
625140336+0 records in<br />
625140335+0 records out<br />
320071851520 bytes (320 GB) copied, 9618.12 s, 33.3 MB/s<br />
real 160m18.126s<br />
user 1m8.916s<br />
sys 36m16.401s<br />
<br />
'''Summary:''' 320 GB in approx. 2.67 hours<br />
<br />
5) On a 2.70GHz (i7-2620M) ThinkPad x220 with 8GB Ram:<br />
<br />
# time dd if=/dev/frandom of=/dev/sdc<br />
dd: writing to `/dev/sde': Input/output error<br />
467085833+0 records in<br />
467085832+0 records out<br />
239147945984 bytes (239 GB) copied, 24675.2 s, 9.7 MB/s<br />
real 411m15.208s<br />
user 2m58.028s<br />
sys 83m14.188s<br />
<br />
'''Summary:''' 500 GB in approx. 6.85 hours (connected on USB3)</div>
Listdata
https://wiki.archlinux.org/index.php?title=Frandom&diff=310176
Frandom
2014-04-12T07:35:36Z
<p>Listdata: /* Installation */ remove old references to /etc/rc.d</p>
<hr />
<div>[[Category:Security]]<br />
[[Category:File systems]]<br />
{{Out of date|Needs updating to SystemD}}<br />
'''frandom''' is a fast alternative to [[Random number generation|/dev/urandom]]. It can be used wherever fast random number generation is required, eg for randomising large hard drives prior to [[System_Encryption_with_LUKS_for_dm-crypt|encryption]].<br />
<br />
From the [http://billauer.co.il/frandom.html frandom page]:<br />
"The frandom suite comes as a Linux kernel module for several kernels, or a kernel patch for 2.4.22. It implements a random number generator, which is 10-50 times faster than what you get from Linux' built-in {{ic|/dev/urandom}}."<br />
<br />
Does frandom generate good random numbers? Refer to the frandom page for this and other technical info.<br />
<br />
Beneath in the example section, you'll find 'real', 'user' and 'sys' information, what they mean you can find [http://stackoverflow.com/questions/556405/what-do-real-user-and-sys-mean-in-the-output-of-time1?answertab=active#tab-top here].<br />
<br />
== Installation ==<br />
Frandom is available as a package from the [https://aur.archlinux.org/packages.php?ID=9869 AUR].<br />
<br />
After installing frandom, you can make it available with:<br />
# sudo modprobe frandom<br />
<br />
The {{ic|/dev/frandom}} device should now exist on the filesystem.<br />
<br />
== Wiping a disk ==<br />
Use the following dd command. This will wipe all the data on the specified device, take care!<br />
<br />
# dd if=/dev/frandom of=/dev/sdx1<br />
<br />
Refer to [[Securely wipe disk]] for more general info on this topic.<br />
<br />
== Example ==<br />
{{Merge|Benchmarking disk wipes|Maybe anyone can bring this to nicer Formatting, move it there and link to it?}}<br />
1) On a 1.73 GHZ Thinkpad T43 with 2 GB ram:<br />
# time dd if=/dev/frandom of=/dev/sdb2<br />
dd: writing to `/dev/sdb2': No space left on device<br />
587384596+0 records in<br />
587384595+0 records out<br />
300740912640 bytes (301 GB) copied, 12844.6 s, 23.4 MB/s<br />
real 214m4.620s<br />
user 3m34.693s<br />
sys 77m28.660s<br />
Summary: 300 GB in approx 3.5 hours<br />
<br />
<br />
2) On a 2.4 GHZ (T8300 Core 2 Duo) Thinkpad T61 with 2 GB ram:<br />
# dd if=/dev/frandom of=/dev/sdb bs=1M<br />
dd: writing `/dev/sdb': No space left on device<br />
476941+0 records in<br />
476940+0 records out<br />
500107862016 bytes (500 GB) copied, 5954.52 s, 84.0 MB/s<br />
Summary: 500 GB in approx 1.65 hours<br />
<br />
<br />
3) On a 2.8 GHz (Athlon2 X4) with 4 GB ram:<br />
# dd if=/dev/frandom of=/dev/sdc3 bs=1M seek=100KB<br />
dd: writing `/dev/sdc3': No space left on device<br />
1807429+0 records in<br />
1807428+0 records out<br />
1895225712640 bytes (1.9 TB) copied, 20300.3 s, 93.4 MB/s<br />
Summary: ~2TB in ~5.64 hours. However, on the same machine:<br />
# dd if=/dev/frandom of=/dev/null bs=1M count=1000<br />
1000+0 records in<br />
1000+0 records out<br />
1048576000 bytes (1.0 GB) copied, 7.81581 s, 134 MB/s<br />
versus<br />
# dd if=/dev/urandom of=/dev/null bs=1M count=1000<br />
1000+0 records in<br />
1000+0 records out<br />
1048576000 bytes (1.0 GB) copied, 144.296 s, 7.3 MB/s<br />
This makes frandom 10-20 times faster on this machine, meaning it would take approx 50-120 hours (2-5 days!) to randomize 2TB using urandom.<br />
<br />
4) On a 2.70GHz (i7-2620M) ThinkPad x220 with 8GB Ram:<br />
<br />
# time dd if=/dev/frandom of=/dev/sdc<br />
dd: writing to `/dev/sdc': No space left on device<br />
625140336+0 records in<br />
625140335+0 records out<br />
320071851520 bytes (320 GB) copied, 9618.12 s, 33.3 MB/s<br />
real 160m18.126s<br />
user 1m8.916s<br />
sys 36m16.401s<br />
<br />
'''Summary:''' 320 GB in approx. 2.67 hours<br />
<br />
5) On a 2.70GHz (i7-2620M) ThinkPad x220 with 8GB Ram:<br />
<br />
# time dd if=/dev/frandom of=/dev/sdc<br />
dd: writing to `/dev/sde': Input/output error<br />
467085833+0 records in<br />
467085832+0 records out<br />
239147945984 bytes (239 GB) copied, 24675.2 s, 9.7 MB/s<br />
real 411m15.208s<br />
user 2m58.028s<br />
sys 83m14.188s<br />
<br />
'''Summary:''' 500 GB in approx. 6.85 hours (connected on USB3)</div>
Listdata
https://wiki.archlinux.org/index.php?title=Haskell&diff=294693
Haskell
2014-01-27T20:45:05Z
<p>Listdata: Mention cblrepo wrapper cabal2pkgbuild</p>
<hr />
<div>[[Category:Programming language]]<br />
<br />
[http://www.haskell.org Haskell] is a general purpose, purely functional, programming language.<br />
<br />
== Installation ==<br />
<br />
Haskell generates machine code that can be run natively on Linux. There is nothing special required to run a binary (already compiled) software, like the ones provided in the [[official repositories]] or by the [[ArchHaskell|ArchHaskell group]]. On the other side, [[Arch User Repository|AUR]] packages or source codes requires a compiler to build the software.<br />
<br />
Installing the compiler alone permits to build Haskell source code. For development there is a ''Haskell-Platform'' bundle which offers the complete set of tools to get started with Haskell.<br />
<br />
=== Compiler ===<br />
<br />
To build a Haskell source–code into native–code, a compiler must be installed. There are several [http://www.haskell.org/haskellwiki/Implementations implementations available], but the most used one (which became ''de facto'' the reference) is the GHC (Glasgow Haskell Compiler). It is available in the official repositories as {{Pkg|ghc}}.<br />
<br />
You can try it with the following file:<br />
<br />
{{hc|Main.hs|main &#61; putStrLn "Hello, World"}}<br />
<br />
and by running:<br />
<br />
{{hc|<br />
$ ghc Main.hs<br />
$ ./Main |<br />
Hello, World<br />
}}<br />
<br />
=== Haskell platform ===<br />
<br />
To start developing in Haskell easily, there is a [http://www.haskell.org/platform/ haskell-platform] bundle which is described as:<br />
<br />
:''The easiest way to get started with programming Haskell. It comes with all you need to get up and running. Think of it as "Haskell: batteries included".''<br />
<br />
An [[Arch User Repository|AUR]] package exists ({{Aur|haskell-platform}}), but can advantageously be replaced by [[pacman|installing]] the [https://bbs.archlinux.org/viewtopic.php?pid=1151382#p1151382 following packages] from the [[official repositories]]:<br />
<br />
* ghc ({{Pkg|ghc}}) — The compiler<br />
* cabal-install ({{Pkg|cabal-install}}) — A command line interface for ''Cabal'' and ''Hackage''<br />
* haddock ({{Pkg|haddock}}) — Tools for generating documentation<br />
* happy ({{Pkg|happy}}) — Parser generator<br />
* alex ({{Pkg|alex}}) — Lexical analyzer generator<br />
<br />
== Managing Haskell packages ==<br />
<br />
There are a lot of Haskell libraries and executables grouped in packages. They are all available on [http://hackage.haskell.org Hackage]. To install and manage these packages, several methods are available and unusual ones are explained in the rest of this section.<br />
<br />
The recommended workflow is the following:<br />
* [[Official repositories]] or [[#ArchHaskell repository|ArchHaskell repository]] as principal source of Haskell packages (the ''or'' is exclusive here)<br />
* [[#cabal-install|cabal-install]] (possibly with sandboxes) for Haskell development<br />
* [[Arch User Repository]] for packages that are not available elsewhere<br />
<br />
A wrapper around cblrepo exists, called [https://aur.archlinux.org/packages/cabal2pkgbuild-git/ cabal2pkgbuild], that you can use to create PKGBUILD files for Hackage packages.<br />
<br />
=== Pros/Cons of the different methods ===<br />
<br />
* [[pacman|Official repositories]]<br />
: '''Pros''': Provided by ArchLinux developers, consistent versions of packages, already compiled<br />
: '''Cons''': Only a few packages available<br />
* [[#ArchHaskell repository|ArchHaskell repository]]<br />
: '''Pros''': Provided by ArchHaskell group, consistent versions of packages, already compiled<br />
: '''Cons''': Need manual intervention to get started with<br />
* [[#cabal-install|cabal-install]]<br />
: '''Pros''': All packages available<br />
: '''Cons''': Installed in home folder, {{Pkg|cabal-install}} [https://ivanmiljenovic.wordpress.com/2010/03/15/repeat-after-me-cabal-is-not-a-package-manager is not a package manager], incompatible versions of packages possible (aka. [http://www.haskell.org/haskellwiki/Cabal/Survival#What_is_the_difficulty_caused_by_Cabal-install.3F cabal hell])<br />
* [[Arch User Repository]]<br />
: '''Pros''': Simple to get started<br />
: '''Cons''': Risk of unmaintained or orphaned packages, incompatible versions of packages possible<br />
<br />
=== ArchHaskell repository ===<br />
<br />
==== Preparation ====<br />
<br />
Add the [[Unofficial_User_Repositories#haskell-core|haskell-core]] [[unofficial user repositories|unofficial user repository]] to your configuration. Be sure to put [haskell-core] above [extra] to ensure that the packages from [haskell-core] take precedence, in case of duplicate packages in the two repositories. <br />
<br />
{{Note|A note for xmonad users: if you switch to this option, you need to install the haskell-xmonad package instead of {{Pkg|xmonad}} (which is in the official community repo and has different dependencies).}}<br />
<br />
You also need need to do the following to add Magnus Therning's key (the maintainer of the repository):<br />
<br />
{{bc|# pacman-key -r 4209170B<br />
# pacman-key --lsign-key 4209170B<br />
}}<br />
<br />
and then force the refresh of the package list:<br />
<br />
{{bc|# pacman -Syy}}<br />
<br />
==== Installing and removing packages ====<br />
<br />
Use [[pacman]] for installing or removing packages.<br />
<br />
=== cabal-install ===<br />
<br />
{{warning|Discouraged method, keep in mind that {{Pkg|cabal-install}} [https://ivanmiljenovic.wordpress.com/2010/03/15/repeat-after-me-cabal-is-not-a-package-manager is not a package manager].}}<br />
<br />
{{Note|The only exception is for Haskell development, where {{Pkg|cabal-install}} is the recommended tool. Since version 1.18, cabal provides a ''sandbox'' system that permits to isolate different versions of libraries for different projects. There is an introduction to cabal sandbox [http://coldwa.st/e/blog/2013-08-20-Cabal-sandbox.html here].}}<br />
<br />
==== Preparation ====<br />
Install {{Pkg|cabal-install}} from the [[official repositories]].<br />
<br />
To run installed executables without specifying the path, the cabal binary folder {{ic|~/.cabal/bin}} must be added to the {{ic|$PATH}} variable. That can be done by putting the following line in your shell configuration file, for instance {{ic|~/.bashrc}} for {{Pkg|bash}} or {{ic|~/.zshrc}} for {{Pkg|zsh}}:<br />
{{bc|PATH&#61;$PATH:~/.cabal/bin}}<br />
<br />
==== Installing packages ====<br />
{{bc|<br />
$ cabal update<br />
$ cabal install <pkg>}}<br />
<br />
You can add {{ic|-j}} for parallel compilation. It is also possible to install a package system–wide with the {{ic|--global}} flag, but this is '''strongly discouraged'''. With the user–wide install, all files are kept in {{ic|~/.cabal}} and libraries are registered to {{ic|~/.ghc}}, offering the possibility to do a clean-up easily by simply removing these folders. With system–wide install, the files will be dispersed in the file system and difficult to manage.<br />
<br />
==== Removing packages ====<br />
There is no easy way to do it.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Switching to ArchHaskell repository ===<br />
<br />
There can be some problems switching to [[#ArchHaskell repository|ArchHaskell repository]] when some Haskell packages are already installed from [[official repositories]]. The surest way is to remove all Haskell related packages, synchronize the [[pacman]] packages database, and reinstall all the needed packages. Also for Xmonad users, be sure to install {{ic|haskell-xmonad}} package instead of {{Pkg|xmonad}}.</div>
Listdata
https://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=252043
Haskell package guidelines
2013-03-27T03:11:29Z
<p>Listdata: /* [haskell-core] */</p>
<hr />
<div>[[Category:Package development]]<br />
[[it:Haskell Package Guidelines]]<br />
{{Package Guidelines}}<br />
<br />
[[Wikipedia:Haskell|Haskell]] is well supported on Arch Linux.<br />
GHC and a few core packages are available in the [[Official Repositories|official repositories]].<br />
For more serious Haskellers, the [[ArchHaskell]] community project provides many packages from [http://hackage.haskell.org Hackage], and the number is growing.<br />
<br />
See the [[ArchHaskell]] community page for contact details and ways to help.<br />
<br />
== Haskell Packages ==<br />
To use Haskell on Arch Linux, you have two mutually exclusive options:<br />
# Use packages from the official Arch Linux repositories. These are a well maintained small subset of all Haskell packages. Just install them the way you would install anything else on Arch Linux. Examples of what is available: in the [https://www.archlinux.org/packages/?arch=x86_64&repo=Extra&q=haskell&last_update=&limit=50 extra] and [https://www.archlinux.org/packages/?arch=x86_64&repo=Community&q=haskell&last_update=&limit=50 community] repositories. The packages here should satisfy people who just want to use the Haskell Platform. You may also combine this option with other packages from unofficial sources like the AUR.<br />
# Use the ArchHaskell project's unofficial repositories. These contain a much larger subset of what's available on Hackage. As a community effort, we often need volunteers to help maintain and add more packages to these repositories. Read on for information about using them.<br />
<br />
=== [haskell-core] ===<br />
The [haskell-core] repository is the base repository of packages maintained by the ArchHaskell team.<br />
[haskell-core] can be accessed by adding the following entry to {{ic|/etc/pacman.conf}} (above [extra]):<br />
<br />
[haskell-core]<br />
Server = http://xsounds.org/~haskell/core/$arch<br />
<br />
or<br />
<br />
[haskell-core]<br />
Server = http://www.kiwilight.com/haskell/core/$arch<br />
<br />
The set of packages in the [haskell-core] repository is derived from the '''habs''' tree officially located [https://github.com/archhaskell/habs here]. A tool called [https://github.com/magthe/cblrepo cblrepo] is used to keep the '''habs''' tree synchronized with the official Haskell packages from [http://hackage.haskell.org/packages/hackage.html Hackage].<br />
<br />
Putting [haskell-core] above [extra] will ensure that the packages from [haskell-core] take precedence, in case of duplicate packages in the two repositories.<br />
<br />
The repositories provide both file listings (by using {{ic|repo-add --files}}), package deltas ({{ic|repo-add --delta}}), and both packages and the database are signed. The fingerprint of the key used for signing is:<br />
<br />
pub 2048D/4209170B 2012-12-26<br />
Key fingerprint = F310 4992 EBF2 4EB8 72B9 7B9C 32B0 B453 4209 170B<br />
uid ArchHaskell (Magnus Therning) <magnus@therning.org><br />
sub 2048D/A418C0FE 2012-12-26<br />
<br />
If you use {{ic|SigLevel &#61; Required TrustedOnly}} in {{ic|/etc/pacman.conf}} for [haskell-core], then you need to do {{ic|sudo pacman-key --lsign-key 4209170B}} to add Magnus Therning's key.<br />
<br />
=== [haskell-web] ===<br />
The [haskell-web] repository builds on [haskell-core], providing several more packages, especially those useful for web applications.<br />
<br />
[haskell-web]<br />
Server = http://archhaskell.mynerdside.com/$repo/$arch<br />
<br />
Add it after [haskell-core].<br />
<br />
=== Last resorts ===<br />
* [https://aur.archlinux.org/packages.php?O=0&K=haskell- Haskell packages in the AUR]<br />
* cabal-install directly<br />
<br />
Unfortunately, many of the packages in the AUR are outdated due to a lack of resources.<br />
If you have the time, it is recommended to use cblrepo and create something like [haskell-web], which can then be added to the collection of haskell-providing repositories.<br />
<br />
== Improving ArchHaskell ==<br />
<br />
=== Community ===<br />
See the [[ArchHaskell]] community page and get in touch via the mailing list or the IRC channel.<br />
<br />
=== Overview ===<br />
The plan is to have one user-facing repository, [haskell], which merges the packages available in various satellite repositories (like [haskell-web]), thereby distributing the maintenance load.<br />
One satellite repo is special, the [haskell-core] repository, which provides packages that are dependencies of all the other satellites.<br />
<br />
=== [haskell-core] maintenance ===<br />
Ensure:<br />
* [haskell-core] is an Arch repo hosted at kiwilight and xsounds.<br />
* [haskell-core] is in sync with the [https://github.com/archhaskell/habs habs] cblrepo database.<br />
<br />
=== Other repo maintenance ===<br />
For example, for haskell-foo, ensure:<br />
* haskell-foo is a cblrepo database, possibly using packages from [haskell-core] as DistroPkgs.<br />
* Whenever [haskell-core] is updated, haskell-foo's database is updated to match within a reasonable time.<br />
<br />
=== Creating another repo ===<br />
<br />
=== List of satellite repos ===</div>
Listdata
https://wiki.archlinux.org/index.php?title=Xmonad&diff=175169
Xmonad
2011-12-19T19:06:36Z
<p>Listdata: /* Configuring xmonad */ official configuration file to use if no internet connection</p>
<hr />
<div>[[Category:X Server (English)]]<br />
[[Category:Tiling WMs (English)]]<br />
[[fr:Xmonad]]<br />
{{i18n|Xmonad}}<br />
<br />
[http://xmonad.org/ xmonad] is a tiling window manager for X. Windows are arranged automatically to tile the screen without gaps or overlap, maximizing screen use. Window manager features are accessible from the keyboard: a mouse is optional.<br />
<br />
xmonad is written, configured and extensible in [http://haskell.org/ Haskell]. Custom layout algorithms, key bindings and other extensions may be written by the user in config files.<br />
<br />
Layouts are applied dynamically, and different layouts may be used on each workspace. [[Xinerama]] is fully supported, allowing windows to be tiled on several physical screens.<br />
<br />
For more information, please visit the xmonad website: http://xmonad.org/<br />
<br />
==Installation==<br />
<br />
{{Pkg|xmonad}} and {{Pkg|xmonad-contrib}} are currently available in the [[Official Repositories|official repositories]]. A build for the current development snapshot (darcs) is in the [[Arch User Repository|AUR]]. The following instructions are for {{AUR|xmonad-darcs}}, the development snapshot.<br />
<br />
===Development version (xmonad-darcs)===<br />
<br />
The xmonad-darcs development version can be installed from the [[Arch User Repository|AUR]], with some additional dependencies in the [[Official Repositories|official repositories]]. [[pacman|Install]] them in the following order:<br />
<br />
* {{AUR|xmonad-darcs}} -- The core window manager<br />
* {{AUR|xmonad-contrib-darcs}} -- Contributed extensions providing custom layouts, configurations, etc.<br />
<br />
==Configuration==<br />
<br />
===Starting xmonad===<br />
To start xmonad automatically, simply add the command {{Ic|xmonad}} to your startup script (e.g. {{ic|~/.xinitrc}}). GDM and KDM users can create a new session file and then select xmonad from the appropriate Session menu.<br />
<br />
{{Note|Recently, users in #xmonad have stated that {{Ic|exec}} is not required before {{Ic|xmonad}}; simply adding {{Ic|xmonad}} as the last line in your startup script is the proper way to start this WM. Please use whichever method works for you. If using {{Ic|ck-launch-session}}, the {{Ic|exec}} is probably still required.}}<br />
<br />
{{Note|By default, xmonad does not set an X cursor, therefore the "cross" cursor is usually displayed which can be confusing for new users (thinking that xmonad has not launched correctly). To set the expected left-pointer, add the following to your startup file (e.g. {{ic|~/.xinitrc}}):<br><br />
{{bc|xsetroot -cursor_name left_ptr}}}}<br />
<br />
Also, xmonad defaults to the U.S. keyboard layout, so if you want, for example, the German keyboard layout, add the following to {{ic|~/.xinitrc}} or read more about setting keyboard layouts [[Xorg#Keyboard_settings|here]]:<br />
setxkbmap -layout de<br />
<br />
Example {{ic|~/.xinitrc}}:<br />
# set the cursor<br />
xsetroot -cursor_name left_ptr<br />
# set German keyboard layout<br />
setxkbmap -layout de<br />
# start xmonad<br />
exec ck-launch-session xmonad<br />
<br />
If, for some reason, xmonad does not start, check if you have an {{ic|.xmonad}} directory in your home directory. If not, create it:<br />
mkdir ~/.xmonad<br />
<br />
===Configuring xmonad===<br />
<br />
xmonad users can modify, override or extend the default settings with the {{ic|~/.xmonad/xmonad.hs}} configuration file. Recompiling is done on the fly, with the Mod+q shortcut.<br />
<br />
If you find you do not have a directory at {{ic|~/.xmonad}}, run {{Ic|xmonad --recompile}} to create it.<br />
<br />
The "default config" for xmonad is quite usable and it is achieved by simply running without an {{ic|xmonad.hs}} entirely. Therefore, even after you run {{Ic|xmonad --recompile}} you will most likely not have an {{ic|~/.xmonad/xmonad.hs}} file. If you would like to start tweaking things, simply create the file and edit it as described below.<br />
<br />
Because the xmonad configuration file is written in Haskell, non-programmers may have a difficult time adjusting settings. For detailed HOWTO's and example configs, we refer you to the following resources:<br />
<br />
* [http://haskell.org/haskellwiki/Xmonad xmonad wiki]<br />
* [http://haskell.org/haskellwiki/Xmonad/Config_archive xmonad config archive]<br />
* [http://haskell.org/haskellwiki/Xmonad/Frequently_asked_questions xmonad FAQ]<br />
* Arch Linux [http://bbs.archlinux.org/viewtopic.php?id=40636 forum thread]<br />
<br />
The best approach is to only place your changes and customizations in {{ic|~/.xmonad/xmonad.hs}} and write it such that any unset parameters are picked up from the built-in defaultConfig.<br />
<br />
This is achieved by writing an {{ic|xmonad.hs}} like this:<br />
<br />
import XMonad<br />
<br />
main = do<br />
xmonad $ defaultConfig<br />
{ terminal = "urxvt"<br />
, modMask = mod4Mask<br />
, borderWidth = 3<br />
}<br />
<br />
This simply overrides the default terminal and borderWidth while leaving all other settings at their defaults (inherited from the function defaultConfig).<br />
<br />
As things get more complicated, it can be handy to call configuration options by function name inside the main function, and define these separately in their own sections of your {{ic|~/.xmonad/xmonad.hs}}. This makes large customizations like your layout and manage hooks easier to visualize and maintain.<br />
<br />
The simple {{ic|xmonad.hs}} from above could have been written like this:<br />
<br />
import XMonad<br />
<br />
main = do<br />
xmonad $ defaultConfig<br />
{ terminal = myTerminal<br />
, modMask = myModMask<br />
, borderWidth = myBorderWidth<br />
}<br />
<br />
-- yes, these are functions; just very simple ones<br />
-- that accept no input and return static values<br />
myTerminal = "urxvt"<br />
myModMask = mod4Mask -- Win key or Super_L<br />
myBorderWidth = 3<br />
<br />
Also, order at top level (main, myTerminal, myModMask etc.), or within the {} does not matter in Haskell, as long as imports come first.<br />
<br />
The following is taken from the 0.9 config file template found [http://haskell.org/haskellwiki/Xmonad/Config_archive/Template_xmonad.hs_(0.9) here]. It is an example of the most common functions one might want to define in their main do block.<br />
<br />
{<br />
terminal = myTerminal,<br />
focusFollowsMouse = myFocusFollowsMouse,<br />
borderWidth = myBorderWidth,<br />
modMask = myModMask,<br />
-- numlockMask deprecated in 0.9.1<br />
-- numlockMask = myNumlockMask,<br />
workspaces = myWorkspaces,<br />
normalBorderColor = myNormalBorderColor,<br />
focusedBorderColor = myFocusedBorderColor,<br />
<br />
-- key bindings<br />
keys = myKeys,<br />
mouseBindings = myMouseBindings,<br />
<br />
-- hooks, layouts<br />
layoutHook = myLayout,<br />
manageHook = myManageHook,<br />
handleEventHook = myEventHook,<br />
logHook = myLogHook,<br />
startupHook = myStartupHook<br />
}<br />
<br />
Also consider copying/starting with {{ic|/usr/share/xmonad-VERSION/man/xmonad.hs}}, which is the latest official example xmonad.hs that comes with the '''xmonad''' Haskell module.<br />
<br />
===Exiting xmonad===<br />
To end the current xmonad session, press {{Keypress|Mod+Shift+Q}}. By default, {{Keypress|Mod}} is the {{Keypress|Alt}} key.<br />
<br />
==Tips and tricks==<br />
===Complementary applications===<br />
There are number of complementary utilities that work well with xmonad. The most common of these include:<br />
<br />
* [[dmenu]]<br />
* [[xmobar]]<br />
* [[dzen]]<br />
* [[Conky]] and {{AUR|conky-cli}}<br />
* [[gmrun]]<br />
* [[Unclutter]] - a small utility to hide the mouse pointer<br />
* [http://uhsure.com/xmonad-log-applet.html XMonad-log-applet] - a GNOME applet for the gnome-panel (the package is in the [[Official Repositories]])<br />
<br />
===Making room for conky or tray apps===<br />
Wrap your layouts with avoidStruts from XMonad.Hooks.ManageDocks for automatic dock/panel/trayer spacing:<br />
<br />
import XMonad<br />
import XMonad.Hooks.ManageDocks<br />
<br />
main=do<br />
xmonad $ defaultConfig<br />
{ ...<br />
, layoutHook=avoidStruts $ layoutHook defaultConfig<br />
, manageHook=manageHook defaultConfig <+> manageDocks<br />
, ...<br />
}<br />
<br />
If you ever want to toggle the gaps, this action can be added to your key bindings:<br />
,((modMask x, xK_b ), sendMessage ToggleStruts)<br />
<br />
===Using xmobar with xmonad===<br />
'''[[xmobar]]''' is a light and minimalistic text-based bar, designed to work with xmonad.<br />
To use xmobar with xmonad, you will need two packages in addition to the {{Pkg|xmonad}} package. These packages are {{Pkg|xmonad-contrib}} and {{Pkg|xmobar}} from the [[Official Repositories|official repositories]], or you can use {{AUR|xmobar-git}} from the [[Arch User Repository|AUR]] instead of the official {{Pkg|xmobar}} package.<br />
<br />
Here we will start xmobar from within xmonad, which reloads xmobar whenever you reload xmonad.<br />
<br />
Open {{ic|~/.xmonad/xmonad.hs}} in your favorite editor, and choose one of the two following options:<br />
<br />
====Option 1: Quick, less flexible====<br />
{{Note|There is also {{Pkg|dzen2}} which you can substitute for {{Pkg|xmobar}} in either case.}}<br />
<br />
Common imports:<br />
import XMonad<br />
import XMonad.Hooks.DynamicLog<br />
<br />
The xmobar action starts xmobar and returns a modified configuration that includes all of the options described in the [[xmonad#Option 2: More configurable|xmonad:Option2: More configurable]] choice.<br />
main = xmonad =<< xmobar defaultConfig { modMask = mod4Mask {- or any other configurations here ... -}}<br />
<br />
==== Option 2: More Configurable ====<br />
As of xmonad(-contrib) 0.9, there is a new [http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Hooks-DynamicLog.html#v%3AstatusBar statusBar] function in [http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Hooks-DynamicLog.html XMonad.Hooks.DynamicLog]. It allows you to use your own configuration for:<br />
* The command used to execute the bar<br />
* The PP that determines what is being written to the bar<br />
* The key binding to toggle the gap for the bar<br />
<br />
The following is an example of how to use it:<br />
{{hc|~/.xmonad/xmonad.hs|<nowiki><br />
-- Imports.<br />
import XMonad<br />
import XMonad.Hooks.DynamicLog<br />
<br />
-- The main function.<br />
main = xmonad =<< statusBar myBar myPP toggleStrutsKey myConfig<br />
<br />
-- Command to launch the bar.<br />
myBar = "xmobar"<br />
<br />
-- Custom PP, configure it as you like. It determines what is being written to the bar.<br />
myPP = xmobarPP { ppCurrent = xmobarColor "#429942" "" . wrap "<" ">" }<br />
<br />
-- Key binding to toggle the gap for the bar.<br />
toggleStrutsKey XConfig {XMonad.modMask = modMask} = (modMask, xK_b)<br />
<br />
-- Main configuration, override the defaults to your liking.<br />
myConfig = defaultConfig { modMask = mod4Mask }<br />
</nowiki>}}<br />
<br />
==== Verify XMobar Config ====<br />
The template and default xmobarrc contains this.<br />
<br />
At last, open up {{ic|~/.xmobarrc}} and make sure you have {{ic|StdinReader}} in the template and run the plugin. E.g.<br />
{{hc|~/.xmobarrc|<nowiki><br />
Config { ...<br />
, commands = [ Run StdinReader .... ]<br />
...<br />
, template = " %StdinReader% ... "<br />
}<br />
</nowiki>}}<br />
<br />
Now, all you should have to do is either to start, or restart, xmonad.<br />
<br />
===Controlling xmonad with external scripts===<br />
There are at least two ways to do this.<br />
<br />
Firstly, you can use the following xmonad extension, [http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Hooks-ServerMode.html XMonad.Hooks.ServerMode].<br />
<br />
Secondly, you can simulate keypress events using {{Pkg|xdotool}} or similar programs. See this [http://ubuntuforums.org/archive/index.php/t-658040.html Ubuntu forums thread]. The following command would simulate the keypress {{Keypress|Super+n}}:<br />
xdotool key Super+n<br />
<br />
===Launching another window manager within xmonad===<br />
If you are using {{AUR|xmonad-darcs}}, as of January of 2011, you can restart to another window manager from within xmonad. You just need to write a small script, and add stuff to your {{ic|~/.xmonad/xmonad.hs}}. Here is the script.<br />
<br />
{{hc|~/bin/obtoxmd|<nowiki><br />
#!/bin/sh<br />
openbox<br />
xmonad<br />
</nowiki>}}<br />
<br />
And here are the modifications you need to add to your {{ic|~/.xmonad/xmonad.hs}}:<br />
<br />
{{hc|~/.xmonad/xmonad.hs|<nowiki><br />
import XMonad<br />
--You need to add this import<br />
import XMonad.Util.Replace<br />
<br />
main do<br />
-- And this "replace"<br />
replace<br />
xmonad $ defaultConfig<br />
{<br />
--Add the usual here<br />
}<br />
<br />
</nowiki>}}<br />
<br />
You also need to add the following key binding:<br />
{{hc|~/xmonad/xmonad.hs|<nowiki><br />
--Add a keybinding as follows:<br />
((modm .|. shiftMask, xK_o ), restart "/home/abijr/bin/obtoxmd" True)<br />
</nowiki>}}<br />
<br />
Just remember to add a comma before or after and change the path to your actual script path. Now just {{Keypress|Mod+q}} (restart xmonad to refresh the config), and then hit {{Keypress|Mod+Shift+o}} and you should have Openbox running with the same windows open as in xmonad. To return to xmonad you should just exit Openbox. Here is a link to adamvo's {{ic|~/.xmonad/xmonad.hs}} which uses this setup [http://www.haskell.org/haskellwiki/Xmonad/Config_archive/adamvo%27s_xmonad.hs Adamvo's xmonad.hs]<br />
<br />
===Example configurations===<br />
Below are some example configurations from fellow xmonad users. Feel free to add links to your own.<br />
* brisbin33 :: complex and simpler branches, importable dzen and scratchpad modules, very readable :: [https://github.com/pbrisbin/xmonad-config config] [http://pbrisbin.com/static/screenshots/current_desktop.png screenshot]<br />
* jelly :: Configuration with prompt, different layouts, twinview with xmobar :: [http://github.com/jelly/dotfiles/tree/master/.xmonad/xmonad.hs xmonad.hs]<br />
* MrElendig :: Simple configuration, with xmobar :: [http://github.com/MrElendig/dotfiles-alice/blob/master/.xmonad/xmonad.hs xmonad.hs], [http://github.com/MrElendig/dotfiles-alice/blob/master/.xmobarrc .xmobarrc], [http://arch.har-ikkje.net/gfx/ss/2010-09-05-163305_2960x1050_scrot.png screenshot].<br />
* thayer :: A minimal mouse-friendly config ideal for netbooks :: [http://haskell.org/haskellwiki/Xmonad/Config_archive/Thayer_Williams%27_xmonad.hs configs] [http://haskell.org/haskellwiki/Image:Thayer-xmonad-20110511.png screenshot]<br />
* vicfryzel :: Beautiful and usable xmonad configuration, along with xmobar configuration, xinitrc, dmenu, and other scripts that make xmonad more usable. :: [https://github.com/vicfryzel/xmonad-config git repository], [https://github.com/vicfryzel/xmonad-config/raw/master/screenshot.png screenshot].<br />
* vogt :: Check out adamvo's config and many others in the official [http://haskell.org/haskellwiki/Xmonad/Config_archive Xmonad/Config archive]<br />
<br />
==Troubleshooting==<br />
===GNOME 3 and xmonad===<br />
With the release of [[GNOME]] 3, some additional steps are necessary to make GNOME play nicely with xmonad.<br />
<br />
First, add an xmonad session file for use by gnome-session ({{ic|/usr/share/gnome-session/sessions/xmonad.session}}):<br />
<br />
{{bc|1=<br />
[GNOME Session]<br />
Name=Xmonad session<br />
RequiredComponents=gnome-panel;gnome-settings-daemon;<br />
RequiredProviders=windowmanager;notifications;<br />
DefaultProvider-windowmanager=xmonad<br />
DefaultProvider-notifications=notification-daemon<br />
}}<br />
<br />
Now create a desktop file for GDM ({{ic|/usr/share/xsessions/xmonad-gnome-session.desktop}}):<br />
{{bc|1=<br />
[Desktop Entry]<br />
Name=Xmonad GNOME<br />
Comment=Tiling window manager<br />
TryExec=/usr/bin/gnome-session<br />
Exec=gnome-session --session=xmonad<br />
Type=XSession<br />
}}<br />
<br />
Then install {{pkg|xmonad-contrib}} and create or edit {{ic|~/.xmonad/xmonad.hs}} to have the following<br />
<br />
{{bc|1=<br />
import XMonad<br />
import XMonad.Config.Gnome<br />
<br />
main = xmonad gnomeConfig<br />
}}<br />
<br />
Xmonad should now appear in the list of GDM sessions and also play nicely with gnome-session itself.<br />
<br />
===GDM 2.x/KDM cannot find xmonad===<br />
You can force GDM to launch xmonad by creating the file {{ic|xmonad.desktop}} in the {{ic|/usr/share/xsessions}} directory and add the contents:<br />
<br />
[Desktop Entry]<br />
Encoding=UTF-8<br />
Name=xmonad<br />
Comment=This session starts xmonad<br />
Exec=/usr/bin/xmonad<br />
Type=Application<br />
<br />
Now xmonad will show in your GDM session menu. Thanks to [http://santanuchatterjee.blogspot.com/2009/03/making-xmonad-to-show-up-in-gdm-session.html Santanu Chatterjee] for the hint.<br />
<br />
For KDM, you will need to create the file here as {{ic|/usr/share/apps/kdm/sessions/xmonad.desktop}}<br />
<br />
Official documentation can be found here:<br />
[http://www.haskell.org/haskellwiki/Xmonad/Frequently_asked_questions#How_can_I_use_xmonad_with_a_display_manager.3F_.28xdm.2C_kdm.2C_gdm.29 Haskell Documentation Page]<br />
<br />
===Missing xmonad-i386-linux or xmonad-x86_64-linux===<br />
Xmonad should automatically create the {{ic|xmonad-i386-linux}} file (in {{ic|~/.xmonad/}}). If this it not the case you can grab a cool looking config file from the [http://haskell.org/haskellwiki/Xmonad/Config_archive xmonad wiki] or create your [http://haskell.org/haskellwiki/Xmonad/Config_archive/John_Goerzen's_Configuration own]. Put the {{ic|.hs}} and all others files in {{ic|~/.xmonad/}} and run this command from the folder:<br />
xmonad --recompile<br />
<br />
Now you should see the file.<br />
<br />
{{Note|A reason you may get an error message saying that xmonad-x86_64-linux is missing is that {{Pkg|xmonad-contrib}} is not installed.}}<br />
<br />
===Problems with Java applications===<br />
The standard Java GUI toolkit has a hard-coded list of "non-reparenting" window managers. Since xmonad is not in that list, there can be some problems with running some Java applications. One of the most common problems is "gray blobs", when the Java application renders as a plain gray box instead of rendering the GUI.<br />
<br />
There are several things that may help:<br />
* If you are using {{Pkg|openjdk6}}, you can export {{Ic|_JAVA_AWT_WM_NONREPARENTING<nowiki>=</nowiki>1}} in {{ic|/etc/profile.d/openjdk6.sh}}.<br />
* If you are using {{Pkg|jre7-openjdk}}, you can export {{Ic|_JAVA_AWT_WM_NONREPARENTING<nowiki>=</nowiki>1}} in {{ic|/etc/profile.d/jre.sh}}.<br />
* If you are using Oracle's JRE/JDK, the best solution is usually to use [http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Hooks-SetWMName.html SetWMName.] However, its effect may be nullified if one also uses XMonad.Hooks.EwmhDesktops, in which case<br />
>> setWMName "LG3D"<br />
added to the LogHook may help.<br />
<br />
For more details about the problem, refer to the [http://haskell.org/haskellwiki/Xmonad/Frequently_asked_questions#Problems_with_Java_applications.2C_Applet_java_console xmonad FAQ.]<br />
<br />
===Empty space at the bottom of gvim or terminals===<br />
See [[Vim#Empty space at the bottom of gvim windows]] for a solution which makes the area match the background color.<br />
<br />
For [[rxvt-unicode]], you can use {{AUR|rxvt-unicode-patched}}.<br />
<br />
You can also configure xmonad to respect size hints, but this will leave a gap instead. See [http://www.eng.uwaterloo.ca/~aavogt/xmonad/docs/xmonad-contrib/XMonad-Layout-LayoutHints.html the documentation on Xmonad.Layout.LayoutHints].<br />
<br />
===Chromium/Chrome will not go fullscreen===<br />
If Chrome fails to go fullscreen when {{Keypress|F11}} is pressed, you can use the [http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Hooks-EwmhDesktops.html XMonad.Hooks.EwmhDesktops] extension found in the {{Pkg|xmonad-contrib}} package. Simply add the {{ic|import}} statement to your {{ic|~/.xmonad/xmonad.hs}}:<br />
import XMonad.Hooks.EwmhDesktops<br />
<br />
and then add {{ic|handleEventHook <nowiki>=</nowiki> fullscreenEventHook}} to the appropriate place; for example:<br />
{{bc|<nowiki><br />
...<br />
xmonad $ defaultConfig<br />
{ modMask = mod4Mask<br />
, handleEventHook = fullscreenEventHook<br />
}<br />
...<br />
</nowiki>}}<br />
<br />
After a recompile/restart of xmonad, Chromium should now respond to {{Keypress|F11}} (fullscreen) as expected.<br />
<br />
===Multitouch / touchegg===<br />
Touchégg polls the window manager for the _NET_CLIENT_LIST (in order to fetch a list of windows it should listen for mouse events on.) By default, xmonad does not supply this property. To enable this, use the [http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Hooks-EwmhDesktops.html XMonad.Hooks.EwmhDesktops] extension found in the {{Pkg|xmonad-contrib}} package.<br />
<br />
==Other Resources==<br />
[http://xmonad.org/ xmonad] - The official xmonad website<br />
<br />
[http://haskell.org/haskellwiki/Xmonad/Config_archive/Template_xmonad.hs_(0.9) xmonad.hs] - Template xmonad.hs<br />
<br />
[http://xmonad.org/tour.html xmonad: a guided tour]<br />
<br />
[[dzen]] - General purpose messaging and notification program<br />
<br />
[[dmenu]] - Dynamic X menu for the quick launching of programs<br />
<br />
[[Comparison of Tiling Window Managers]] - Arch wiki article providing an overview of mainstream tiling window managers</div>
Listdata
https://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=170842
Haskell package guidelines
2011-11-22T19:56:53Z
<p>Listdata: /* Haskell Packages */ mention [community] and also some misc changes</p>
<hr />
<div>[[Category:Package development (English)]]<br />
<br />
{{i18n|Haskell package guidelines}}<br />
<br />
'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, a growing number of packages made available by the ArchHaskell group, and a large part of [http://hackage.haskell.org hackage.haskell.org] library database [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=arch-haskell&SeB=m&SB=n&SO=a&PP=100&do_Search=Go available via AUR].<br />
<br />
The community around Haskell on Arch is active and well organized but your help is always welcome.<br />
<br />
== Community ==<br />
<br />
All the details on the [[ArchHaskell]] group is available on its own page.<br />
<br />
== Haskell Packages ==<br />
<br />
The core Haskell tools are available in the core system (extra):<br />
<br />
==== <nowiki>[extra]</nowiki> ====<br />
<br />
* [http://www.archlinux.org/packages/?arch=x86_64&repo=Extra&q=haskell&last_update=&limit=50 Haskell packages in the core system]<br />
<br />
Our policy for [extra] is to provide the Haskell platform, and popular Haskell applications.<br />
<br />
==== <nowiki>[community]</nowiki> ====<br />
<br />
* [http://www.archlinux.org/packages/?arch=x86_64&repo=Community&q=haskell&last_update=&limit=50 other popular Haskell packages]<br />
<br />
[community] provides additional packages that are popular and not part of the Haskell platform, such as xmonad.<br />
<br />
==== <nowiki>[haskell]</nowiki> ====<br />
<br />
The [haskell] repository is the official repository of packages maintained by the ArchHaskell team. This repository represents the last tier of stability, before resorting to the packages on AUR, or perhaps building packages yourself with cabal2arch. [haskell] can be accessed by adding the following entry to pacman.conf:<br />
<br />
[haskell]<br />
Server = http://www.kiwilight.com/$repo/$arch<br />
<br />
The set of packages in the [haskell] repository is derived from the '''habs''' tree officially located at https://github.com/archhaskell/habs. A tool called [https://github.com/magthe/cblrepo cblrepo] is used to keep the '''habs''' tree synchronized with the official Haskell packages from [http://hackage.haskell.org/packages/hackage.html Hackage].<br />
<br />
==== <nowiki>AUR</nowiki> ====<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=arch-haskell&SeB=m&SB=n&SO=a&PP=100&do_Search=Go Haskell packages in AUR]<br />
<br />
A huge number (almost 2000) packages built from http://hackage.haskell.org.<br />
<br />
These generally improve on installing directly from Hackage as they resolve required C libraries. They can be installed as, for example:<br />
<br />
sudo paktahn -S haskell-csv<br />
<br />
Anything not found here can be installed via [http://aur.archlinux.org/packages.php?ID=17411 cabal-install] direct from Hackage.<br />
<br />
Unfortunately, many of the packages on AUR are outdated due to a lack of resources. In practice, one uses the cabal2arch program to create PKGBUILDs directly from Hackage.<br />
<br />
== Guidelines ==<br />
<br />
In almost all cases cabalised Haskell packages can be automatically translated into Arch packages, via the cabal2arch tool. It is strongly recommended that you use the latest released version of this tool, as it implements the packaging policy for Haskell packages. You can get it in several ways:<br />
<br />
* Add the <nowiki>[haskell]</nowiki> repository to pacman.conf and use pacman do install the latest release.<br />
* Download and build the [http://aur.archlinux.org/packages.php?ID=17471 source from AUR], either manually or using one of the many [[AUR Helpers]].<br />
* Install directly from Hackage using "cabal install cabal2arch".<br />
<br />
===cabal2arch: an example===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a new package for the delimited continuations library, CC-delcont:<br />
<br />
First, set the name and email address to be used in the generated PKGBUILD:<br />
<br />
export ARCH_HASKELL='My Name <my.name@domain.org>'<br />
<br />
Second, find [http://hackage.haskell.org/cgi-bin/hackage-scripts/package/CC-delcont the hackage page for CC-delcont], then identify the link to the .cabal file. Use this link as an argument to cabal2arch:<br />
<br />
<pre><br />
% cd /tmp<br />
% cabal2arch http://hackage.haskell.org/packages/archive/pandoc/1.6.0.1/pandoc.cabal<br />
Using /tmp/tmp.D7HAJJx2js/pandoc.cabal<br />
Feeding the PKGBUILD to `makepkg -g`...<br />
==> Retrieving Sources...<br />
-> Downloading pandoc-1.6.0.1.tar.gz...<br />
--2011-05-14 07:25:39-- http://hackage.haskell.org/packages/archive/pandoc/1.6.0.1/pandoc-1.6.0.1.tar.gz<br />
Resolving hackage.haskell.org... 69.30.63.204<br />
Connecting to hackage.haskell.org|69.30.63.204|:80... connected.<br />
HTTP request sent, awaiting response... 200 OK<br />
Length: 355477 (347K) [application/x-tar]<br />
Saving to: “pandoc-1.6.0.1.tar.gz.part”<br />
<br />
0K .......... .......... .......... .......... .......... 14% 210K 1s<br />
50K .......... .......... .......... .......... .......... 28% 393K 1s<br />
100K .......... .......... .......... .......... .......... 43% 338K 1s<br />
150K .......... .......... .......... .......... .......... 57% 419K 0s<br />
200K .......... .......... .......... .......... .......... 72% 404K 0s<br />
250K .......... .......... .......... .......... .......... 86% 554K 0s<br />
300K .......... .......... .......... .......... ....... 100% 506K=0.9s<br />
<br />
2011-05-14 07:25:40 (369 KB/s) - “pandoc-1.6.0.1.tar.gz.part” saved [355477/355477]<br />
<br />
==> Generating checksums for source files...<br />
</pre><br />
<br />
Checking what was created:<br />
<br />
% ls<br />
haskell-pandoc<br />
% cd haskell-pandoc<br />
% ls<br />
haskell-pandoc.install PKGBUILD<br />
<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
<pre><br />
# Maintainer: <br />
_hkgname=pandoc<br />
pkgname=haskell-pandoc<br />
pkgver=1.6.0.1<br />
pkgrel=1<br />
pkgdesc="Conversion between markup formats"<br />
url="http://hackage.haskell.org/package/${_hkgname}"<br />
license=('GPL')<br />
arch=('i686' 'x86_64')<br />
makedepends=()<br />
depends=('ghc' 'haskell-http=4000.1.1' 'haskell-bytestring=0.9.1.10' 'haskell-containers=0.4.0.0' 'haskell-directory=1.1.0.0' 'haskell-extensible-exceptions=0.1.1.2' 'haskell-filepath=1.2.0.0' 'haskell-mtl=2.0.1.0' 'haskell-network=2.3.0.2' 'haskell-old-time=1.0.0.6' 'haskell-parsec=3.1.1' 'haskell-pretty=1.0.1.2' 'haskell-process=1.0.1.5' 'haskell-random=1.0.0.3' 'haskell-syb=0.3' 'haskell-texmath<0.5' 'haskell-utf8-string>=0.3' 'haskell-xhtml=3000.2.0.1' 'haskell-xml<1.4' 'haskell-zip-archive<0.2')<br />
options=('strip')<br />
source=(http://hackage.haskell.org/packages/archive/${_hkgname}/${pkgver}/${_hkgname}-${pkgver}.tar.gz)<br />
install=${pkgname}.install<br />
md5sums=('d19a630462595941b3100dff6f839aa3')<br />
build() {<br />
cd ${srcdir}/${_hkgname}-${pkgver}<br />
runhaskell Setup configure -O ${PKGBUILD_HASKELL_ENABLE_PROFILING:+-p } --enable-split-objs --enable-shared \<br />
--prefix=/usr --docdir=/usr/share/doc/${pkgname} --libsubdir=\$compiler/site-local/\$pkgid<br />
runhaskell Setup build<br />
runhaskell Setup haddock<br />
runhaskell Setup register --gen-script<br />
runhaskell Setup unregister --gen-script<br />
sed -i -r -e "s|ghc-pkg.*unregister[^ ]* |&'--force' |" unregister.sh<br />
}<br />
package() {<br />
cd ${srcdir}/${_hkgname}-${pkgver}<br />
install -D -m744 register.sh ${pkgdir}/usr/share/haskell/${pkgname}/register.sh<br />
install -m744 unregister.sh ${pkgdir}/usr/share/haskell/${pkgname}/unregister.sh<br />
install -d -m755 ${pkgdir}/usr/share/doc/ghc/html/libraries<br />
ln -s /usr/share/doc/${pkgname}/html ${pkgdir}/usr/share/doc/ghc/html/libraries/${_hkgname}<br />
runhaskell Setup copy --destdir=${pkgdir}<br />
}<br />
</pre><br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* Libraries are prefixed with "haskell-"<br />
* All libraries that the package depend on are listed (libraries shipped with ghc are dealt with by having the ghc package provide them)<br />
* It uses cabal to generate a post-install register/unregister script, with a standard name.<br />
* We use haddock to build the documentation.<br />
<br />
All Haskell libraries should follow these naming conventions, and using the latest release of cabal2arch will ensure this is the case.<br />
<br />
NOTE: Beginning with cabal2arch 1.1-2, a new environment variable, '''PKGBUILD_HASKELL_ENABLE_PROFILING''', is generated into the PKGBUILD. If this variable is of non-zero length, such as "1" or "true", then profiling builds will occur. Thus, if a user desires profiling, then it is advised to export this environment variable in a file such as ~/.bashrc or ~/.zshrc.<br />
<br />
===Guidelines for Libraries===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all libraries have a dependency on 'ghc'<br />
* all libraries that are depended on must be listed in the depends-array in the PKGBUILD<br />
* be careful about dependencies from gtk2hs: cairo, svg, glib, gtk. These are all provided by the 'gtk2hs' package, not , e.g. "haskell-cairo"<br />
<br />
Registering Haskell libraries is done via a register hook, see above.<br />
<br />
===Guidelines for Programs ===<br />
<br />
* Have their normal name. Examples: hmp3, xmonad, ghc, cabal-install<br />
<br />
* Be careful about dynamically linked runtime dependencies on C. For example, all GHC-produced binaries have a runtime dependency on 'gmp'. OpenGL or GtT-based binaries will have additional 'depends'. cabal2arch will attempt to work out the C dependencies, but there may be others implied by Haskell dependencies that are missed.<br />
<br />
* Use executable stripping, --enable-executable-stripping. cabal2arch will do this automatically.<br />
<br />
== Automatic local building of Hackage Packages with cabal2arch using Bauerbill ==<br />
{{Warning|''Bauerbill'' development has been officially discontinued: its latest version does not work with ''pacman>&#61;3.5''. See [https://bbs.archlinux.org/viewtopic.php?id&#61;115660].}}<br />
Although there are a number of haskell packages on AUR, there will always be outdated packages on AUR. If this happens and you want to create a fully updated package you would normally use cabal2arch. This however can become painful/time consuming if you have numerous packages with different dependencies (some of which may/may not be updated). Instead you can automatic this process by using [[Bauerbill]] which has the --hackage flag, allowing you to create AUR packages from Hackage locally. Below is an example of some common commands<br />
<br />
bauerbill -S --hackage [pkgs] : build [pkgs] directly from Hackage*<br />
bauerbill -Si --hackage [pkgs] : look up information about [pkgs]<br />
bauerbill -Ss --hackage [args] : search for [args]<br />
bauerbill -Qu --hackage : list upgradable Hackage packages<br />
<br />
Syncing packages with the --hackage flag will interactively download all dependencies of the package from Hackage, convert them using cabal2arch and then build/install them (while checking dependencies). You can combine this with the --aur flag to give precedence to Hackage packages that are on AUR</div>
Listdata
https://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=170841
Haskell package guidelines
2011-11-22T19:38:03Z
<p>Listdata: /* [haskell] */ fix [haskell] repo address and discuss its origins</p>
<hr />
<div>[[Category:Package development (English)]]<br />
<br />
{{i18n|Haskell package guidelines}}<br />
<br />
'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, a growing number of packages made available by the ArchHaskell group, and a large part of [http://hackage.haskell.org hackage.haskell.org] library database [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=arch-haskell&SeB=m&SB=n&SO=a&PP=100&do_Search=Go available via AUR].<br />
<br />
The community around Haskell on Arch is active and well organized but your help is always welcome.<br />
<br />
== Community ==<br />
<br />
All the details on the [[ArchHaskell]] group is available on its own page.<br />
<br />
== Haskell Packages ==<br />
<br />
The core Haskell tools are available in the core system (extra):<br />
<br />
==== <nowiki>[Extra]</nowiki> ====<br />
<br />
* [http://www.archlinux.org/packages/?arch=x86_64&repo=Extra&q=haskell&last_update=&limit=50 Haskell packages in the core system]<br />
<br />
Our policy for [extra] is to provide the Haskell platform, and popular Haskell applications.<br />
<br />
==== <nowiki>[haskell]</nowiki> ====<br />
<br />
The packages maintained by the ArchHaskell group can be accessed by adding the following entry to pacman.conf:<br />
<br />
[haskell]<br />
Server = http://www.kiwilight.com/$repo/$arch<br />
<br />
The set of packages in the [haskell] repository is derived from the '''habs''' tree officially located at https://github.com/archhaskell/habs. A tool called [https://github.com/magthe/cblrepo cblrepo] is used to keep the '''habs''' tree synchronized with the official Haskell packages from [http://hackage.haskell.org/packages/hackage.html Hackage].<br />
<br />
==== <nowiki>AUR</nowiki> ====<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=arch-haskell&SeB=m&SB=n&SO=a&PP=100&do_Search=Go Haskell packages in AUR]<br />
<br />
A huge number (almost 2000) packages built from http://hackage.haskell.org<br />
<br />
These generally improve on installing directly from Hackage as they resolve required C libraries. They can be installed as, for example:<br />
<br />
sudo paktahn -S haskell-csv<br />
<br />
Anything not found here can be installed via [http://aur.archlinux.org/packages.php?ID=17411 cabal-install] direct from Hackage.<br />
<br />
== Guidelines ==<br />
<br />
In almost all cases cabalised Haskell packages can be automatically translated into Arch packages, via the cabal2arch tool. It is strongly recommended that you use the latest released version of this tool, as it implements the packaging policy for Haskell packages. You can get it in several ways:<br />
<br />
* Add the <nowiki>[haskell]</nowiki> repository to pacman.conf and use pacman do install the latest release.<br />
* Download and build the [http://aur.archlinux.org/packages.php?ID=17471 source from AUR], either manually or using one of the many [[AUR Helpers]].<br />
* Install directly from Hackage using "cabal install cabal2arch".<br />
<br />
===cabal2arch: an example===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a new package for the delimited continuations library, CC-delcont:<br />
<br />
First, set the name and email address to be used in the generated PKGBUILD:<br />
<br />
export ARCH_HASKELL='My Name <my.name@domain.org>'<br />
<br />
Second, find [http://hackage.haskell.org/cgi-bin/hackage-scripts/package/CC-delcont the hackage page for CC-delcont], then identify the link to the .cabal file. Use this link as an argument to cabal2arch:<br />
<br />
<pre><br />
% cd /tmp<br />
% cabal2arch http://hackage.haskell.org/packages/archive/pandoc/1.6.0.1/pandoc.cabal<br />
Using /tmp/tmp.D7HAJJx2js/pandoc.cabal<br />
Feeding the PKGBUILD to `makepkg -g`...<br />
==> Retrieving Sources...<br />
-> Downloading pandoc-1.6.0.1.tar.gz...<br />
--2011-05-14 07:25:39-- http://hackage.haskell.org/packages/archive/pandoc/1.6.0.1/pandoc-1.6.0.1.tar.gz<br />
Resolving hackage.haskell.org... 69.30.63.204<br />
Connecting to hackage.haskell.org|69.30.63.204|:80... connected.<br />
HTTP request sent, awaiting response... 200 OK<br />
Length: 355477 (347K) [application/x-tar]<br />
Saving to: “pandoc-1.6.0.1.tar.gz.part”<br />
<br />
0K .......... .......... .......... .......... .......... 14% 210K 1s<br />
50K .......... .......... .......... .......... .......... 28% 393K 1s<br />
100K .......... .......... .......... .......... .......... 43% 338K 1s<br />
150K .......... .......... .......... .......... .......... 57% 419K 0s<br />
200K .......... .......... .......... .......... .......... 72% 404K 0s<br />
250K .......... .......... .......... .......... .......... 86% 554K 0s<br />
300K .......... .......... .......... .......... ....... 100% 506K=0.9s<br />
<br />
2011-05-14 07:25:40 (369 KB/s) - “pandoc-1.6.0.1.tar.gz.part” saved [355477/355477]<br />
<br />
==> Generating checksums for source files...<br />
</pre><br />
<br />
Checking what was created:<br />
<br />
% ls<br />
haskell-pandoc<br />
% cd haskell-pandoc<br />
% ls<br />
haskell-pandoc.install PKGBUILD<br />
<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
<pre><br />
# Maintainer: <br />
_hkgname=pandoc<br />
pkgname=haskell-pandoc<br />
pkgver=1.6.0.1<br />
pkgrel=1<br />
pkgdesc="Conversion between markup formats"<br />
url="http://hackage.haskell.org/package/${_hkgname}"<br />
license=('GPL')<br />
arch=('i686' 'x86_64')<br />
makedepends=()<br />
depends=('ghc' 'haskell-http=4000.1.1' 'haskell-bytestring=0.9.1.10' 'haskell-containers=0.4.0.0' 'haskell-directory=1.1.0.0' 'haskell-extensible-exceptions=0.1.1.2' 'haskell-filepath=1.2.0.0' 'haskell-mtl=2.0.1.0' 'haskell-network=2.3.0.2' 'haskell-old-time=1.0.0.6' 'haskell-parsec=3.1.1' 'haskell-pretty=1.0.1.2' 'haskell-process=1.0.1.5' 'haskell-random=1.0.0.3' 'haskell-syb=0.3' 'haskell-texmath<0.5' 'haskell-utf8-string>=0.3' 'haskell-xhtml=3000.2.0.1' 'haskell-xml<1.4' 'haskell-zip-archive<0.2')<br />
options=('strip')<br />
source=(http://hackage.haskell.org/packages/archive/${_hkgname}/${pkgver}/${_hkgname}-${pkgver}.tar.gz)<br />
install=${pkgname}.install<br />
md5sums=('d19a630462595941b3100dff6f839aa3')<br />
build() {<br />
cd ${srcdir}/${_hkgname}-${pkgver}<br />
runhaskell Setup configure -O ${PKGBUILD_HASKELL_ENABLE_PROFILING:+-p } --enable-split-objs --enable-shared \<br />
--prefix=/usr --docdir=/usr/share/doc/${pkgname} --libsubdir=\$compiler/site-local/\$pkgid<br />
runhaskell Setup build<br />
runhaskell Setup haddock<br />
runhaskell Setup register --gen-script<br />
runhaskell Setup unregister --gen-script<br />
sed -i -r -e "s|ghc-pkg.*unregister[^ ]* |&'--force' |" unregister.sh<br />
}<br />
package() {<br />
cd ${srcdir}/${_hkgname}-${pkgver}<br />
install -D -m744 register.sh ${pkgdir}/usr/share/haskell/${pkgname}/register.sh<br />
install -m744 unregister.sh ${pkgdir}/usr/share/haskell/${pkgname}/unregister.sh<br />
install -d -m755 ${pkgdir}/usr/share/doc/ghc/html/libraries<br />
ln -s /usr/share/doc/${pkgname}/html ${pkgdir}/usr/share/doc/ghc/html/libraries/${_hkgname}<br />
runhaskell Setup copy --destdir=${pkgdir}<br />
}<br />
</pre><br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* Libraries are prefixed with "haskell-"<br />
* All libraries that the package depend on are listed (libraries shipped with ghc are dealt with by having the ghc package provide them)<br />
* It uses cabal to generate a post-install register/unregister script, with a standard name.<br />
* We use haddock to build the documentation.<br />
<br />
All Haskell libraries should follow these naming conventions, and using the latest release of cabal2arch will ensure this is the case.<br />
<br />
NOTE: Beginning with cabal2arch 1.1-2, a new environment variable, '''PKGBUILD_HASKELL_ENABLE_PROFILING''', is generated into the PKGBUILD. If this variable is of non-zero length, such as "1" or "true", then profiling builds will occur. Thus, if a user desires profiling, then it is advised to export this environment variable in a file such as ~/.bashrc or ~/.zshrc.<br />
<br />
===Guidelines for Libraries===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all libraries have a dependency on 'ghc'<br />
* all libraries that are depended on must be listed in the depends-array in the PKGBUILD<br />
* be careful about dependencies from gtk2hs: cairo, svg, glib, gtk. These are all provided by the 'gtk2hs' package, not , e.g. "haskell-cairo"<br />
<br />
Registering Haskell libraries is done via a register hook, see above.<br />
<br />
===Guidelines for Programs ===<br />
<br />
* Have their normal name. Examples: hmp3, xmonad, ghc, cabal-install<br />
<br />
* Be careful about dynamically linked runtime dependencies on C. For example, all GHC-produced binaries have a runtime dependency on 'gmp'. OpenGL or GtT-based binaries will have additional 'depends'. cabal2arch will attempt to work out the C dependencies, but there may be others implied by Haskell dependencies that are missed.<br />
<br />
* Use executable stripping, --enable-executable-stripping. cabal2arch will do this automatically.<br />
<br />
== Automatic local building of Hackage Packages with cabal2arch using Bauerbill ==<br />
{{Warning|''Bauerbill'' development has been officially discontinued: its latest version does not work with ''pacman>&#61;3.5''. See [https://bbs.archlinux.org/viewtopic.php?id&#61;115660].}}<br />
Although there are a number of haskell packages on AUR, there will always be outdated packages on AUR. If this happens and you want to create a fully updated package you would normally use cabal2arch. This however can become painful/time consuming if you have numerous packages with different dependencies (some of which may/may not be updated). Instead you can automatic this process by using [[Bauerbill]] which has the --hackage flag, allowing you to create AUR packages from Hackage locally. Below is an example of some common commands<br />
<br />
bauerbill -S --hackage [pkgs] : build [pkgs] directly from Hackage*<br />
bauerbill -Si --hackage [pkgs] : look up information about [pkgs]<br />
bauerbill -Ss --hackage [args] : search for [args]<br />
bauerbill -Qu --hackage : list upgradable Hackage packages<br />
<br />
Syncing packages with the --hackage flag will interactively download all dependencies of the package from Hackage, convert them using cabal2arch and then build/install them (while checking dependencies). You can combine this with the --aur flag to give precedence to Hackage packages that are on AUR</div>
Listdata
https://wiki.archlinux.org/index.php?title=VCS_package_guidelines&diff=168491
VCS package guidelines
2011-11-02T22:00:49Z
<p>Listdata: /* Tips */ git: fix build error for initial clones if we're not in the $_gitname directory already</p>
<hr />
<div>[[Category:Package development (English)]]<br />
{{i18n|VCS PKGBUILD Guidelines}}<br />
{{Article summary start}}<br />
{{Article summary text|Creating PKGBUILDs for software managed with version control systems.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Arch Build System}}<br />
{{Article summary wiki|Arch User Repository}}<br />
{{Article summary wiki|Creating Packages}}<br />
{{Article summary wiki|makepkg}}<br />
{{Article summary wiki|pacman}}<br />
{{Article summary wiki|PKGBUILD}}<br />
{{Article summary end}}<br />
<br />
Guidelines for creating PKGBUILDs for software managed with version control systems.<br />
<br />
== Prototypes ==<br />
<br />
The {{Package Official|abs}} package provides prototypes for cvs, svn, git, mercurial, and darcs PKGBUILDs. When abs is installed, you can find them in {{Filename|/usr/share/pacman}}. Or browse the [https://projects.archlinux.org/abs.git/tree/prototypes prototypes] directory in the [[ABS]] Git repository.<br />
<br />
== Guidelines ==<br />
<br />
* Properly suffix {{Codeline|pkgname}} with {{Codeline|-cvs}}, {{Codeline|-svn}}, {{Codeline|-hg}}, {{Codeline|-darcs}}, {{Codeline|-bzr}} or {{Codeline|-git}}. If the package tracks a moving development trunk it should be given a suffix. If the package fetches a release from a VCS tag then it should not be given a suffix. Use this rule of thumb: if the output of the package depends on the time at which it was compiled, append a suffix; otherwise do not.<br />
<br />
* A VCS package may be updated as and when needed to adopt changes to the build system, including ammendments to dependencies, URL, sources, etc. If the revision number remains the same after such an update, but produces a resulting binary which is different, increasing the {{Codeline|pkgrel}} is mandatory. If both the revision number and the resulting binary remain the same, {{Codeline|pkgrel}} should be kept intact. There is no need to update the VCS package just to accommodate a revision bump, but one may choose to do so.<br />
<br />
* When [[makepkg]] is run, by default it will check for newer revisions and then update the {{Codeline|pkgver}} in the PKGBUILD. Look at {{Codeline|--holdver}} in [http://www.archlinux.org/pacman/makepkg.8.html man makepkg] if you want otherwise. {{Codeline|--holdver}} only works for cvs and svn, which allow checkout of older revisions.<br />
<br />
* Check for package conflicts. For example ''fluxbox-svn'' will conflict with ''fluxbox''. In this case, you need to use {{Codeline|1=conflicts=('fluxbox')}}.<br />
<br />
* Use the {{Codeline|provides}} field so that packages that require the non-VCS package can be installed ({{Codeline|1=provides=('fluxbox')}}).<br />
<br />
* You should AVOID using {{Codeline|1=replaces=...}} as it generally causes unnecessary problems.<br />
<br />
* When using/defining the cvsroot, use {{Codeline|anonymous:@}} rather than {{Codeline|anonymous@}} to avoid a password prompt and having to enter a blank password ''OR'' use {{Codeline|anonymous:password@}} if a password is required.<br />
<br />
* Don't forget to include the appropriate VCS tool (cvs, subversion, git, ...) in {{Codeline|1=makedepends=...}}.<br />
<br />
* To preserve the integrity of the checked-out code consider copying the original build directory if you have to make edits. For example, having checked out source code to {{Filename|src/$_cvsmod}} from {{Filename|$startdir}} you can use:<br />
<br />
mkdir src/$_cvsmod-build<br />
<br />
cd src/$_cvsmod-build<br />
../$_cvsmod/configure<br />
<br />
or:<br />
<br />
cp -r src/$_cvsmod src/$_cvsmod-build<br />
cd src/$_cvsmod-build<br />
<br />
* With the introduction of the [[AUR]], it is most important to avoid using backtick execution to create package variables. makepkg will automatically bump the {{Codeline|pkgver}} anyway when building the package (unless {{Codeline|--holdver}} is used).<br />
<br />
== Tips ==<br />
<br />
* You should make sure that there are no VCS directories and files left over in your package. If there are, you may want to remove them, by adding a command similar to this one at the end of the the package() script:<br />
<br />
rm -rf $(find "$pkgdir" -type d -name ".svn")<br />
<br />
* When using Git, one can speed up the cloning operation using the {{Codeline|1=--depth=1}} parameter. This creates a shallow clone, and has only the last change history - since histories are unimportant for builds most of the time.<br />
<br />
git clone git://hostname.dom/project.git --depth=1<br />
<br />
* It's possible to create the package also from a branch other than the master. To do so add {{Codeline|1=--branch branch_name}} after the first {{Codeline|1=git clone}}, in this way:<br />
<br />
git clone "$_gitroot" "$_gitname" --branch branch_name<br />
Remember to save package with a different name, for example {{Codeline|1= pkgname-branchname-git}}, in order to avoid confusion with the package from the branch master.<br />
<br />
* Copy paste script when building from repo<br />
If you are lazy here is a script you can copy paste when making git based PKGBUID.<br />
<br />
cd "$srcdir"<br />
msg "Connecting to GIT server...."<br />
if [ -d $_gitname ] ; then<br />
cd $_gitname && git pull origin<br />
msg "The local files are updated."<br />
else<br />
git clone --depth=1 $_gitroot $_gitname<br />
fi<br />
msg "GIT checkout done or server timeout"<br />
<br />
* Temporary build directories: When using Git, and where you need to create a separate build directory (e.g., for building/compiling), you should avoid copying over the {{Codeline|1=.git}} directory located in the parent folder because it contains history information that Git uses internally. With repos with thousands of commits, this .git directory will contain upwards of hundreds of MiB of useless commit history that has *nothing* to do with the current working tree. The only time you'd need to copy over the .git directory itself is when you need to build from a specific, older commit (which is generally never the case as the point of a VCS PKGBUILD is to pull from the latest bleeding edge commit). Thus, instead of<br />
<br />
rm -rf "$srcdir/$_gitname-build"<br />
cp -R "$srcdir/$_gitname" "$srcdir/$_gitname-build" # copy everything, including the useless .git folder<br />
cd "$srcdir/$_gitname-build"<br />
make # build/compile from source<br />
<br />
you should do<br />
<br />
rm -rf "$srcdir/$_gitname-build"<br />
cd "$srcdir/$_gitname" && ls -A | grep -v .git | xargs -d '\n' cp -r -t ../$_gitname-build # do not copy over the .git folder<br />
cd "$srcdir/$_gitname-build"<br />
make # build/compile from source<br />
<br />
to cut down on build time and disk usage.</div>
Listdata
https://wiki.archlinux.org/index.php?title=VCS_package_guidelines&diff=168483
VCS package guidelines
2011-11-02T20:50:45Z
<p>Listdata: /* Tips */ for git, create build directories more efficiently</p>
<hr />
<div>[[Category:Package development (English)]]<br />
{{i18n|VCS PKGBUILD Guidelines}}<br />
{{Article summary start}}<br />
{{Article summary text|Creating PKGBUILDs for software managed with version control systems.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Arch Build System}}<br />
{{Article summary wiki|Arch User Repository}}<br />
{{Article summary wiki|Creating Packages}}<br />
{{Article summary wiki|makepkg}}<br />
{{Article summary wiki|pacman}}<br />
{{Article summary wiki|PKGBUILD}}<br />
{{Article summary end}}<br />
<br />
Guidelines for creating PKGBUILDs for software managed with version control systems.<br />
<br />
== Prototypes ==<br />
<br />
The {{Package Official|abs}} package provides prototypes for cvs, svn, git, mercurial, and darcs PKGBUILDs. When abs is installed, you can find them in {{Filename|/usr/share/pacman}}. Or browse the [https://projects.archlinux.org/abs.git/tree/prototypes prototypes] directory in the [[ABS]] Git repository.<br />
<br />
== Guidelines ==<br />
<br />
* Properly suffix {{Codeline|pkgname}} with {{Codeline|-cvs}}, {{Codeline|-svn}}, {{Codeline|-hg}}, {{Codeline|-darcs}}, {{Codeline|-bzr}} or {{Codeline|-git}}. If the package tracks a moving development trunk it should be given a suffix. If the package fetches a release from a VCS tag then it should not be given a suffix. Use this rule of thumb: if the output of the package depends on the time at which it was compiled, append a suffix; otherwise do not.<br />
<br />
* A VCS package may be updated as and when needed to adopt changes to the build system, including ammendments to dependencies, URL, sources, etc. If the revision number remains the same after such an update, but produces a resulting binary which is different, increasing the {{Codeline|pkgrel}} is mandatory. If both the revision number and the resulting binary remain the same, {{Codeline|pkgrel}} should be kept intact. There is no need to update the VCS package just to accommodate a revision bump, but one may choose to do so.<br />
<br />
* When [[makepkg]] is run, by default it will check for newer revisions and then update the {{Codeline|pkgver}} in the PKGBUILD. Look at {{Codeline|--holdver}} in [http://www.archlinux.org/pacman/makepkg.8.html man makepkg] if you want otherwise. {{Codeline|--holdver}} only works for cvs and svn, which allow checkout of older revisions.<br />
<br />
* Check for package conflicts. For example ''fluxbox-svn'' will conflict with ''fluxbox''. In this case, you need to use {{Codeline|1=conflicts=('fluxbox')}}.<br />
<br />
* Use the {{Codeline|provides}} field so that packages that require the non-VCS package can be installed ({{Codeline|1=provides=('fluxbox')}}).<br />
<br />
* You should AVOID using {{Codeline|1=replaces=...}} as it generally causes unnecessary problems.<br />
<br />
* When using/defining the cvsroot, use {{Codeline|anonymous:@}} rather than {{Codeline|anonymous@}} to avoid a password prompt and having to enter a blank password ''OR'' use {{Codeline|anonymous:password@}} if a password is required.<br />
<br />
* Don't forget to include the appropriate VCS tool (cvs, subversion, git, ...) in {{Codeline|1=makedepends=...}}.<br />
<br />
* To preserve the integrity of the checked-out code consider copying the original build directory if you have to make edits. For example, having checked out source code to {{Filename|src/$_cvsmod}} from {{Filename|$startdir}} you can use:<br />
<br />
mkdir src/$_cvsmod-build<br />
<br />
cd src/$_cvsmod-build<br />
../$_cvsmod/configure<br />
<br />
or:<br />
<br />
cp -r src/$_cvsmod src/$_cvsmod-build<br />
cd src/$_cvsmod-build<br />
<br />
* With the introduction of the [[AUR]], it is most important to avoid using backtick execution to create package variables. makepkg will automatically bump the {{Codeline|pkgver}} anyway when building the package (unless {{Codeline|--holdver}} is used).<br />
<br />
== Tips ==<br />
<br />
* You should make sure that there are no VCS directories and files left over in your package. If there are, you may want to remove them, by adding a command similar to this one at the end of the the package() script:<br />
<br />
rm -rf $(find "$pkgdir" -type d -name ".svn")<br />
<br />
* When using Git, one can speed up the cloning operation using the {{Codeline|1=--depth=1}} parameter. This creates a shallow clone, and has only the last change history - since histories are unimportant for builds most of the time.<br />
<br />
git clone git://hostname.dom/project.git --depth=1<br />
<br />
* It's possible to create the package also from a branch other than the master. To do so add {{Codeline|1=--branch branch_name}} after the first {{Codeline|1=git clone}}, in this way:<br />
<br />
git clone "$_gitroot" "$_gitname" --branch branch_name<br />
Remember to save package with a different name, for example {{Codeline|1= pkgname-branchname-git}}, in order to avoid confusion with the package from the branch master.<br />
<br />
* Copy paste script when building from repo<br />
If you are lazy here is a script you can copy paste when making git based PKGBUID.<br />
<br />
cd "$srcdir"<br />
msg "Connecting to GIT server...."<br />
if [ -d $_gitname ] ; then<br />
cd $_gitname && git pull origin<br />
msg "The local files are updated."<br />
else<br />
git clone --depth=1 $_gitroot $_gitname<br />
fi<br />
msg "GIT checkout done or server timeout"<br />
<br />
* Temporary build directories: When using Git, and where you need to create a separate build directory (e.g., for building/compiling), you should avoid copying over the {{Codeline|1=.git}} directory located in the parent folder because it contains history information that Git uses internally. With repos with thousands of commits, this .git directory will contain upwards of hundreds of MiB of useless commit history that has *nothing* to do with the current working tree. The only time you'd need to copy over the .git directory itself is when you need to build from a specific, older commit (which is generally never the case as the point of a VCS PKGBUILD is to pull from the latest bleeding edge commit). Thus, instead of<br />
<br />
rm -rf "$srcdir/$_gitname-build"<br />
cp -R "$srcdir/$_gitname" "$srcdir/$_gitname-build" # copy everything, including the useless .git folder<br />
cd "$srcdir/$_gitname-build"<br />
make # build/compile from source<br />
<br />
you should do<br />
<br />
rm -rf "$srcdir/$_gitname-build"<br />
ls -A | grep -v .git | xargs -d '\n' cp -r -t ../$_gitname-build # do not copy over the .git folder<br />
cd "$srcdir/$_gitname-build"<br />
make # build/compile from source<br />
<br />
to cut down on build time and disk usage.</div>
Listdata
https://wiki.archlinux.org/index.php?title=Brother_MFC-9840CDW&diff=151122
Brother MFC-9840CDW
2011-08-09T18:08:26Z
<p>Listdata: /* Scanning */ scanner group</p>
<hr />
<div>[[Category:Printers_(English)]]<br />
<br />
=Printing=<br />
<br />
==Introduction==<br />
<br />
This is a small tutorial to make the printer Brother MFC-9840CDW work on Arch, through a wired (ethernet cable) network connection.<br />
<br />
Brother released an official .ppd (postscript printer description) file on June 24, 2009. It is available from [http://solutions.brother.com/linux/en_us/download_prn.html#MFC-9840CDW]. This .ppd file lets you change essential printer settings such as color/mono in the application's dialog box (such as Firefox), and is thus recommended over the previous method of using generic printer drivers.<br />
<br />
==Setup with PostScript + Brother's Official .ppd file==<br />
<br />
'''TIP: You can add multiple versions of the MFC-9840CDW by repeating the steps below, and then for each version, changing the printer settings with the ''Set Printer Options'' button in CUPS. This way, you can quickly set up default settings that you use often (e.g., color vs. greyscale), and then print with these options by simply selecting the corresponding printer in your application (instead of using the application-specific printer dialog box each time you want to print using non-default settings).'''<br />
<br />
* Install the '''cups''' package. Make sure it's working by going to http://localhost:631<br />
* Download Brother's official .ppd file from [http://solutions.brother.com/linux/en_us/download_prn.html#MFC-9840CDW].<br />
* Make sure the printer is connected to your network router/switch. If your router is acting as a DHCP server, the MFC-9840CDW will automatically get an IP address assigned. Make note of this IP address. (You could also assign a static IP address to your printer, but that is outside the scope of this article).<br />
* Go to http://localhost:631 to open up the CUPS web interface.<br />
* Click on the '''Administration''' tab and then click on '''Add printer.'''<br />
* Select the "Internet Printing Protocol (http)" option for the Device.<br />
* For the Device URI, use: '''http://IPADDRESSOFPRINTER:631/POSTSCRIPT_P1'''. E.g., '''http://192.168.0.102:631/POSTSCRIPT_P1'''<br />
* For the Make/Manufacturer, provide the official .ppd file that you downloaded.<br />
* Click on '''Add Printer''' to finish the wizard.<br />
<br />
Make sure to modify the default settings, such as page size (change this to letter, if you are not using A4 paper), auto/color/mono for color settings, toner save on/off, as well as duplex mode (DuplexTumble is short-edge duplex, and DuplexNoTumble is long-edge.)<br />
<br />
==Old Method==<br />
<br />
Additionally, you can set it up with either the generic postscript drivers, or PCL-6 drivers with gutenprint (as the MFC-9840CDW supports PCL-6 emulation). The postscript driver has fewer settings, and is easy to set up, whereas the PCL-6 driver has more options, although it is more experimental (and doesn't support color). As of February 2009, the postscript driver always has color on by default, whereas the PCL-6 driver is always set to greyscale -- so you may want to add two printers, with one for each.<br />
<br />
===Setup with PostScript + Foomatic===<br />
<br />
The MFC-9840CDW natively supports the postscript format, so for basic printing functionality we'll be using the generic postscript driver that comes with the foomatic packages. (Again, it is recommended to download Brother's official .ppd file instead of using the generic ones as shown below.)<br />
<br />
* Install the '''cups''' package. Make sure it's working by going to http://localhost:631<br />
* Install the '''foomatic-db''', '''foomatic-db-engine''', and '''foomatic-filters''' packages (to get the generic postscript driver that we need).<br />
* Make sure the printer is connected to your network router/switch. If your router is acting as a DHCP server, the MFC-9840CDW will automatically get an IP address assigned. Make note of this IP address. (You could also assign a static IP address to your printer, but that is outside the scope of this article).<br />
* Go to http://localhost:631 to open up the CUPS web interface.<br />
* Click on the '''Administration''' tab and then click on '''Add printer.'''<br />
* Select the "Internet Printing Protocol (http)" option for the Device.<br />
* For the Device URI, use: '''http://IPADDRESSOFPRINTER:631/POSTSCRIPT_P1'''. E.g., '''http://192.168.0.102:631/POSTSCRIPT_P1'''<br />
* For the Make/Manufacturer, click on '''Generic''', then '''Generic PostScript Printer Foomatic/Postscript (en)''' (do not choose the "Level 1" variant, as it is an older postcript driver for older printers)<br />
* Click on '''Add Printer''' to finish the wizard.<br />
<br />
Print out a test page to see if everything works. The above configuration allows you to change the duplex and resolution (dpi) settings within CUPS, via the '''Set Printer Options''' button under the '''Printers''' tab, but is missing the "Toner save" option. Of course, this and all other settings are still accessible via the printer's own web interface, which makes any changes the default settings of the printer (see the official Brother documentation).<br />
<br />
===Setup with PCL-6 and Gutenprint===<br />
<br />
The MFC-9840CDW also natively supports (via emulation) the PCL-6 format, so we can take advantage of this feature. The procedure is essentially identical as with the postscript configuration above, except for a couple of things.<br />
<br />
* Install the '''gutenprint''' package.<br />
* Instead of '''postscript_p1''' in the Device URI field, use '''pcl_p1''' (the '''pcl''' has a lowercase 'L', not a numeral 'one').<br />
* Under For the Make/Manufacturer, click on '''Generic''' again, but instead choose the '''Generic PCL 6/PCL XL Printer - CUPS+Gutenprint v.5.2.3 (en)''' option. (The Gutenprint version number is dependant, of course, on which version of '''gutenprint''' you have installed.)<br />
<br />
Customize the default printer settings, to the extent that they are controlled by CUPS, by clicking on the '''Set Printer Options''' button in the CUPS web interface. You will notice that the Gutenprint driver has many more options than the generic PostScript driver. You may want to repeat the procedure above and add a second printer, and then customize this second printer's settings to your liking (e.g., color instead of greyscale).<br />
<br />
''Note: As there are many different PCL-6 drivers available, you may want to experiment with using these different ones instead of the CUPS+Gutenprint one. To change the driver, click on '''Modify Printer''' and go through the wizard, just like when you were adding the printer from the beginning.''<br />
<br />
=Scanning=<br />
<br />
Brother has released its own SANE drivers, called brscan. For the MFC-9840CDW, the brscan3 driver is needed, and is available on [http://aur.archlinux.org/packages.php?ID=24475 AUR]. Then, run the '''brsaneconfig3''' tool (use the -h option for help) to add your scanner. Also add yourself to the '''scanner''' group to scan as a normal user. You can then download the '''xsane''' package with pacman, and launch xsane.<br />
<br />
You might want to disable the "Enable color management" option from Xsane (under Preferences) if you do not care about embedded color profiles (the brscan3 driver does not come with a color profile, and Xsane will continually warn you with a pop-up if it cannot find a color profile).</div>
Listdata
https://wiki.archlinux.org/index.php?title=Brother_MFC-9840CDW&diff=151121
Brother MFC-9840CDW
2011-08-09T18:03:29Z
<p>Listdata: added scanning section (brscan3, xsane discussion)</p>
<hr />
<div>[[Category:Printers_(English)]]<br />
<br />
=Printing=<br />
<br />
==Introduction==<br />
<br />
This is a small tutorial to make the printer Brother MFC-9840CDW work on Arch, through a wired (ethernet cable) network connection.<br />
<br />
Brother released an official .ppd (postscript printer description) file on June 24, 2009. It is available from [http://solutions.brother.com/linux/en_us/download_prn.html#MFC-9840CDW]. This .ppd file lets you change essential printer settings such as color/mono in the application's dialog box (such as Firefox), and is thus recommended over the previous method of using generic printer drivers.<br />
<br />
==Setup with PostScript + Brother's Official .ppd file==<br />
<br />
'''TIP: You can add multiple versions of the MFC-9840CDW by repeating the steps below, and then for each version, changing the printer settings with the ''Set Printer Options'' button in CUPS. This way, you can quickly set up default settings that you use often (e.g., color vs. greyscale), and then print with these options by simply selecting the corresponding printer in your application (instead of using the application-specific printer dialog box each time you want to print using non-default settings).'''<br />
<br />
* Install the '''cups''' package. Make sure it's working by going to http://localhost:631<br />
* Download Brother's official .ppd file from [http://solutions.brother.com/linux/en_us/download_prn.html#MFC-9840CDW].<br />
* Make sure the printer is connected to your network router/switch. If your router is acting as a DHCP server, the MFC-9840CDW will automatically get an IP address assigned. Make note of this IP address. (You could also assign a static IP address to your printer, but that is outside the scope of this article).<br />
* Go to http://localhost:631 to open up the CUPS web interface.<br />
* Click on the '''Administration''' tab and then click on '''Add printer.'''<br />
* Select the "Internet Printing Protocol (http)" option for the Device.<br />
* For the Device URI, use: '''http://IPADDRESSOFPRINTER:631/POSTSCRIPT_P1'''. E.g., '''http://192.168.0.102:631/POSTSCRIPT_P1'''<br />
* For the Make/Manufacturer, provide the official .ppd file that you downloaded.<br />
* Click on '''Add Printer''' to finish the wizard.<br />
<br />
Make sure to modify the default settings, such as page size (change this to letter, if you are not using A4 paper), auto/color/mono for color settings, toner save on/off, as well as duplex mode (DuplexTumble is short-edge duplex, and DuplexNoTumble is long-edge.)<br />
<br />
==Old Method==<br />
<br />
Additionally, you can set it up with either the generic postscript drivers, or PCL-6 drivers with gutenprint (as the MFC-9840CDW supports PCL-6 emulation). The postscript driver has fewer settings, and is easy to set up, whereas the PCL-6 driver has more options, although it is more experimental (and doesn't support color). As of February 2009, the postscript driver always has color on by default, whereas the PCL-6 driver is always set to greyscale -- so you may want to add two printers, with one for each.<br />
<br />
===Setup with PostScript + Foomatic===<br />
<br />
The MFC-9840CDW natively supports the postscript format, so for basic printing functionality we'll be using the generic postscript driver that comes with the foomatic packages. (Again, it is recommended to download Brother's official .ppd file instead of using the generic ones as shown below.)<br />
<br />
* Install the '''cups''' package. Make sure it's working by going to http://localhost:631<br />
* Install the '''foomatic-db''', '''foomatic-db-engine''', and '''foomatic-filters''' packages (to get the generic postscript driver that we need).<br />
* Make sure the printer is connected to your network router/switch. If your router is acting as a DHCP server, the MFC-9840CDW will automatically get an IP address assigned. Make note of this IP address. (You could also assign a static IP address to your printer, but that is outside the scope of this article).<br />
* Go to http://localhost:631 to open up the CUPS web interface.<br />
* Click on the '''Administration''' tab and then click on '''Add printer.'''<br />
* Select the "Internet Printing Protocol (http)" option for the Device.<br />
* For the Device URI, use: '''http://IPADDRESSOFPRINTER:631/POSTSCRIPT_P1'''. E.g., '''http://192.168.0.102:631/POSTSCRIPT_P1'''<br />
* For the Make/Manufacturer, click on '''Generic''', then '''Generic PostScript Printer Foomatic/Postscript (en)''' (do not choose the "Level 1" variant, as it is an older postcript driver for older printers)<br />
* Click on '''Add Printer''' to finish the wizard.<br />
<br />
Print out a test page to see if everything works. The above configuration allows you to change the duplex and resolution (dpi) settings within CUPS, via the '''Set Printer Options''' button under the '''Printers''' tab, but is missing the "Toner save" option. Of course, this and all other settings are still accessible via the printer's own web interface, which makes any changes the default settings of the printer (see the official Brother documentation).<br />
<br />
===Setup with PCL-6 and Gutenprint===<br />
<br />
The MFC-9840CDW also natively supports (via emulation) the PCL-6 format, so we can take advantage of this feature. The procedure is essentially identical as with the postscript configuration above, except for a couple of things.<br />
<br />
* Install the '''gutenprint''' package.<br />
* Instead of '''postscript_p1''' in the Device URI field, use '''pcl_p1''' (the '''pcl''' has a lowercase 'L', not a numeral 'one').<br />
* Under For the Make/Manufacturer, click on '''Generic''' again, but instead choose the '''Generic PCL 6/PCL XL Printer - CUPS+Gutenprint v.5.2.3 (en)''' option. (The Gutenprint version number is dependant, of course, on which version of '''gutenprint''' you have installed.)<br />
<br />
Customize the default printer settings, to the extent that they are controlled by CUPS, by clicking on the '''Set Printer Options''' button in the CUPS web interface. You will notice that the Gutenprint driver has many more options than the generic PostScript driver. You may want to repeat the procedure above and add a second printer, and then customize this second printer's settings to your liking (e.g., color instead of greyscale).<br />
<br />
''Note: As there are many different PCL-6 drivers available, you may want to experiment with using these different ones instead of the CUPS+Gutenprint one. To change the driver, click on '''Modify Printer''' and go through the wizard, just like when you were adding the printer from the beginning.''<br />
<br />
=Scanning=<br />
<br />
Brother has released its own SANE drivers, called brscan. For the MFC-9840CDW, the brscan3 driver is needed, and is available on [http://aur.archlinux.org/packages.php?ID=24475 AUR]. Then, run the '''brsaneconfig3''' tool (use the -h option for help) to add your scanner. You can then download the '''xsane''' package with pacman, and launch xsane.<br />
<br />
You might want to disable the "Enable color management" option from Xsane (under Preferences) if you do not care about embedded color profiles (the brscan3 driver does not come with a color profile, and Xsane will continually warn you with a pop-up if it cannot find a color profile).</div>
Listdata
https://wiki.archlinux.org/index.php?title=Ramdisk&diff=151027
Ramdisk
2011-08-08T23:10:59Z
<p>Listdata: /* Useful links */</p>
<hr />
<div>[[Category:File systems (English)]]<br />
A ramdisk is a portion of RAM utilised as a disk. Many distributions use /dev/ram for this, however Arch does not have a /dev/ram so we must use /etc/fstab to create ramdisks. The most important thing to remember about a ramdisk is that it is stored in RAM and thus volatile. Anything stored on a ramdisk will be lost if the computer completely seizes up, or loses power. Therefore, it is necessary to save the contents of your ramdisk to the harddrive if you want to save them.<br />
<br />
==Why use one?==<br />
<br />
As a ramdisk is stored in RAM, it is much faster than a conventional filesystem. So, if you need to manipulate files at high speed, a ramdisk could be the best solution. Popular choices include /tmp, /var/cache/pacman, or /var/lib/pacman, although I'm sure you could think of many others.<br />
<br />
==How to create a ramdisk==<br />
<br />
To create a ramdisk, you must treat it as any other mounted filesystem. You must first pick and create a location for it to reside on, and then add it to your /etc/fstab file as follows:<br />
<br />
none /path/to/location ramfs defaults 0 0<br />
<br />
If you do not have a lot of spare ram, it is recommended to use 'tmpfs' instead of 'ramfs', as tmpfs uses Swap when the available RAM starts to run out, whereas ramfs does not. Of course, dipping into swap loses the performance benefits of RAM, so it's a little pointless unless you have a lot of spare RAM.<br />
<br />
==Example usage==<br />
<br />
The files that have been edited are /etc/fstab, /etc/rc.local, and /etc/rc.local.shutdown to store /tmp, /var/cache/pacman, and /var/lib/pacman in RAM, and sync them to disk before shutting down. Portions of the files not relevant to the topic at hand have been removed to save space<br />
<br />
'''/etc/fstab:'''<br />
none /tmp ramfs defaults 0 0<br />
none /mnt/ramdisk ramfs defaults 0 0<br />
<br />
'''/etc/rc.local:'''<br />
chmod 777 /tmp<br />
touch /etc/ramdisk.sh<br />
<br />
/bin/cat - >> /etc/ramdisk.sh << EOT<br />
#!/bin/sh<br />
<br />
cd /var/ && /bin/tar cf abs.tar abs/<br />
cd /var/cache/ && /bin/tar cf pacman.tar pacman/<br />
cd /var/lib/ && /bin/tar cf pacman.tar pacman/<br />
<br />
/bin/mkdir /mnt/ramdisk/var/<br />
/bin/mkdir /mnt/ramdisk/var/cache/<br />
/bin/mkdir /mnt/ramdisk/var/lib/<br />
<br />
/bin/mv /var/abs /mnt/ramdisk/var && /bin/ln -s /mnt/ramdisk/var/abs /var/abs<br />
/bin/mv /var/cache/pacman /mnt/ramdisk/var/cache && /bin/ln -s /mnt/ramdisk/var/lib/pacman /var/lib/pacman<br />
/bin/mv /var/lib/pacman /mnt/ramdisk/var/lib && /bin/ln -s /mnt/ramdisk/var/cache/pacman /var/cache/pacman<br />
<br />
/bin/ln -s /tmp /mnt/ramdisk/tmp<br />
/bin/chmod 777 /mnt/ramdisk/tmp<br />
EOT<br />
<br />
/etc/ramdisk.sh &<br />
<br />
'''/etc/rc.local.shutdown:'''<br />
echo "Saving contents of ramdisk to harddrive"<br />
rm /var/abs<br />
rm /var/cache/pacman<br />
rm /var/lib/pacman<br />
mv /mnt/ramdisk/var/abs /var<br />
mv /mnt/ramdisk/var/cache/pacman /var/cache<br />
mv /mnt/ramdisk/var/lib/pacman /var/lib<br />
<br />
==Useful links==<br />
<br />
[http://bbs.archlinux.org/viewtopic.php?id=50893 How to mount Ramdisk]<br />
[http://bbs.archlinux.org/viewtopic.php?pid=326269 Ramdrive setup]<br />
[http://www.kernel.org/doc/Documentation/filesystems/tmpfs.txt Official tmpfs documentation]<br />
[http://www.kernel.org/doc/Documentation/filesystems/ramfs-rootfs-initramfs.txt Official ramfs documentation]</div>
Listdata
https://wiki.archlinux.org/index.php?title=Ramdisk&diff=150993
Ramdisk
2011-08-08T19:07:56Z
<p>Listdata: /* How to create a ramdisk */ mount options were missing</p>
<hr />
<div>[[Category:File systems (English)]]<br />
A ramdisk is a portion of RAM utilised as a disk. Many distributions use /dev/ram for this, however Arch does not have a /dev/ram so we must use /etc/fstab to create ramdisks. The most important thing to remember about a ramdisk is that it is stored in RAM and thus volatile. Anything stored on a ramdisk will be lost if the computer completely seizes up, or loses power. Therefore, it is necessary to save the contents of your ramdisk to the harddrive if you want to save them.<br />
<br />
==Why use one?==<br />
<br />
As a ramdisk is stored in RAM, it is much faster than a conventional filesystem. So, if you need to manipulate files at high speed, a ramdisk could be the best solution. Popular choices include /tmp, /var/cache/pacman, or /var/lib/pacman, although I'm sure you could think of many others.<br />
<br />
==How to create a ramdisk==<br />
<br />
To create a ramdisk, you must treat it as any other mounted filesystem. You must first pick and create a location for it to reside on, and then add it to your /etc/fstab file as follows:<br />
<br />
none /path/to/location ramfs defaults 0 0<br />
<br />
If you do not have a lot of spare ram, it is recommended to use 'tmpfs' instead of 'ramfs', as tmpfs uses Swap when the available RAM starts to run out, whereas ramfs does not. Of course, dipping into swap loses the performance benefits of RAM, so it's a little pointless unless you have a lot of spare RAM.<br />
<br />
==Example usage==<br />
<br />
The files that have been edited are /etc/fstab, /etc/rc.local, and /etc/rc.local.shutdown to store /tmp, /var/cache/pacman, and /var/lib/pacman in RAM, and sync them to disk before shutting down. Portions of the files not relevant to the topic at hand have been removed to save space<br />
<br />
'''/etc/fstab:'''<br />
none /tmp ramfs defaults 0 0<br />
none /mnt/ramdisk ramfs defaults 0 0<br />
<br />
'''/etc/rc.local:'''<br />
chmod 777 /tmp<br />
touch /etc/ramdisk.sh<br />
<br />
/bin/cat - >> /etc/ramdisk.sh << EOT<br />
#!/bin/sh<br />
<br />
cd /var/ && /bin/tar cf abs.tar abs/<br />
cd /var/cache/ && /bin/tar cf pacman.tar pacman/<br />
cd /var/lib/ && /bin/tar cf pacman.tar pacman/<br />
<br />
/bin/mkdir /mnt/ramdisk/var/<br />
/bin/mkdir /mnt/ramdisk/var/cache/<br />
/bin/mkdir /mnt/ramdisk/var/lib/<br />
<br />
/bin/mv /var/abs /mnt/ramdisk/var && /bin/ln -s /mnt/ramdisk/var/abs /var/abs<br />
/bin/mv /var/cache/pacman /mnt/ramdisk/var/cache && /bin/ln -s /mnt/ramdisk/var/lib/pacman /var/lib/pacman<br />
/bin/mv /var/lib/pacman /mnt/ramdisk/var/lib && /bin/ln -s /mnt/ramdisk/var/cache/pacman /var/cache/pacman<br />
<br />
/bin/ln -s /tmp /mnt/ramdisk/tmp<br />
/bin/chmod 777 /mnt/ramdisk/tmp<br />
EOT<br />
<br />
/etc/ramdisk.sh &<br />
<br />
'''/etc/rc.local.shutdown:'''<br />
echo "Saving contents of ramdisk to harddrive"<br />
rm /var/abs<br />
rm /var/cache/pacman<br />
rm /var/lib/pacman<br />
mv /mnt/ramdisk/var/abs /var<br />
mv /mnt/ramdisk/var/cache/pacman /var/cache<br />
mv /mnt/ramdisk/var/lib/pacman /var/lib<br />
<br />
==Useful links==<br />
<br />
[http://bbs.archlinux.org/viewtopic.php?id=50893 How to mount Ramdisk]<br />
[http://bbs.archlinux.org/viewtopic.php?pid=326269 Ramdrive setup]</div>
Listdata
https://wiki.archlinux.org/index.php?title=Ramdisk&diff=150992
Ramdisk
2011-08-08T19:03:30Z
<p>Listdata: /* How to create a ramdisk */ grammar fix</p>
<hr />
<div>[[Category:File systems (English)]]<br />
A ramdisk is a portion of RAM utilised as a disk. Many distributions use /dev/ram for this, however Arch does not have a /dev/ram so we must use /etc/fstab to create ramdisks. The most important thing to remember about a ramdisk is that it is stored in RAM and thus volatile. Anything stored on a ramdisk will be lost if the computer completely seizes up, or loses power. Therefore, it is necessary to save the contents of your ramdisk to the harddrive if you want to save them.<br />
<br />
==Why use one?==<br />
<br />
As a ramdisk is stored in RAM, it is much faster than a conventional filesystem. So, if you need to manipulate files at high speed, a ramdisk could be the best solution. Popular choices include /tmp, /var/cache/pacman, or /var/lib/pacman, although I'm sure you could think of many others.<br />
<br />
==How to create a ramdisk==<br />
<br />
To create a ramdisk, you must treat it as any other mounted filesystem. You must first pick and create a location for it to reside on, and then add it to your /etc/fstab file as follows:<br />
<br />
none /path/to/location ramfs 0 0<br />
<br />
If you do not have a lot of spare ram, it is recommended to use 'tmpfs' instead of 'ramfs', as tmpfs uses Swap when the available RAM starts to run out, whereas ramfs does not. Of course, dipping into swap loses the performance benefits of RAM, so it's a little pointless unless you have a lot of spare RAM.<br />
<br />
==Example usage==<br />
<br />
The files that have been edited are /etc/fstab, /etc/rc.local, and /etc/rc.local.shutdown to store /tmp, /var/cache/pacman, and /var/lib/pacman in RAM, and sync them to disk before shutting down. Portions of the files not relevant to the topic at hand have been removed to save space<br />
<br />
'''/etc/fstab:'''<br />
none /tmp ramfs defaults 0 0<br />
none /mnt/ramdisk ramfs defaults 0 0<br />
<br />
'''/etc/rc.local:'''<br />
chmod 777 /tmp<br />
touch /etc/ramdisk.sh<br />
<br />
/bin/cat - >> /etc/ramdisk.sh << EOT<br />
#!/bin/sh<br />
<br />
cd /var/ && /bin/tar cf abs.tar abs/<br />
cd /var/cache/ && /bin/tar cf pacman.tar pacman/<br />
cd /var/lib/ && /bin/tar cf pacman.tar pacman/<br />
<br />
/bin/mkdir /mnt/ramdisk/var/<br />
/bin/mkdir /mnt/ramdisk/var/cache/<br />
/bin/mkdir /mnt/ramdisk/var/lib/<br />
<br />
/bin/mv /var/abs /mnt/ramdisk/var && /bin/ln -s /mnt/ramdisk/var/abs /var/abs<br />
/bin/mv /var/cache/pacman /mnt/ramdisk/var/cache && /bin/ln -s /mnt/ramdisk/var/lib/pacman /var/lib/pacman<br />
/bin/mv /var/lib/pacman /mnt/ramdisk/var/lib && /bin/ln -s /mnt/ramdisk/var/cache/pacman /var/cache/pacman<br />
<br />
/bin/ln -s /tmp /mnt/ramdisk/tmp<br />
/bin/chmod 777 /mnt/ramdisk/tmp<br />
EOT<br />
<br />
/etc/ramdisk.sh &<br />
<br />
'''/etc/rc.local.shutdown:'''<br />
echo "Saving contents of ramdisk to harddrive"<br />
rm /var/abs<br />
rm /var/cache/pacman<br />
rm /var/lib/pacman<br />
mv /mnt/ramdisk/var/abs /var<br />
mv /mnt/ramdisk/var/cache/pacman /var/cache<br />
mv /mnt/ramdisk/var/lib/pacman /var/lib<br />
<br />
==Useful links==<br />
<br />
[http://bbs.archlinux.org/viewtopic.php?id=50893 How to mount Ramdisk]<br />
[http://bbs.archlinux.org/viewtopic.php?pid=326269 Ramdrive setup]</div>
Listdata
https://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=141366
Haskell package guidelines
2011-05-14T14:49:34Z
<p>Listdata: /* cabal2arch: an example */ new environment variable, PKGBUILD_HASKELL_ENABLE_PROFILING</p>
<hr />
<div>[[Category:Guidelines (English)]]<br />
[[Category:Package development (English)]]<br />
<br />
{{i18n|Haskell package guidelines}}<br />
<br />
'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, a growing number of packages made available by the ArchHaskell group, and a large part of [http://hackage.haskell.org hackage.haskell.org] library database [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=arch-haskell&SeB=m&SB=n&SO=a&PP=100&do_Search=Go available via AUR].<br />
<br />
The community around Haskell on Arch is active and well organized but your help is always welcome.<br />
<br />
== Community ==<br />
<br />
All the details on the [[ArchHaskell]] group is available on its own page.<br />
<br />
== Haskell Packages ==<br />
<br />
The core Haskell tools are available in the core system (extra):<br />
<br />
==== <nowiki>[Extra]</nowiki> ====<br />
<br />
* [http://www.archlinux.org/packages/?arch=x86_64&repo=Extra&q=haskell&last_update=&limit=50 Haskell packages in the core system]<br />
<br />
Our policy is for [extra] to provide the Haskell platform, and popular Haskell applications.<br />
<br />
==== <nowiki>[haskell]</nowiki> ====<br />
<br />
The packages maintained by the ArchHaskell group can be accessed by adding the following entry to pacman.conf:<br />
<br />
[haskell]<br />
Server = http://andromeda.kiwilight.com/$repo/$arch<br />
<br />
==== <nowiki>AUR</nowiki> ====<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=arch-haskell&SeB=m&SB=n&SO=a&PP=100&do_Search=Go Haskell packages in AUR]<br />
<br />
A huge number (almost 2000) packages built from http://hackage.haskell.org<br />
<br />
These generally improve on installing directly from Hackage as they resolve required C libraries. They can be installed as, for example:<br />
<br />
sudo paktahn -S haskell-csv<br />
<br />
Anything not found here can be installed via [http://aur.archlinux.org/packages.php?ID=17411 cabal-install] direct from Hackage.<br />
<br />
== Guidelines ==<br />
<br />
In almost all cases cabalised Haskell packages can be automatically translated into Arch packages, via the cabal2arch tool. It is strongly recommended that you use the latest released version of this tool, as it implements the packaging policy for Haskell packages. You can get it in several ways:<br />
<br />
* Add the <nowiki>[haskell]</nowiki> repository to pacman.conf and use pacman do install the latest release.<br />
* Download and build the [http://aur.archlinux.org/packages.php?ID=17471 source from AUR], either manually or using one of the many [[AUR Helpers]].<br />
* Install directly from Hackage using "cabal install cabal2arch".<br />
<br />
===cabal2arch: an example===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a new package for the delimited continuations library, CC-delcont:<br />
<br />
First, set the name and email address to be used in the generated PKGBUILD:<br />
<br />
export ARCH_HASKELL='My Name <my.name@domain.org>'<br />
<br />
Second, find [http://hackage.haskell.org/cgi-bin/hackage-scripts/package/CC-delcont the hackage page for CC-delcont], then identify the link to the .cabal file. Use this link as an argument to cabal2arch:<br />
<br />
<pre><br />
% cd /tmp<br />
% cabal2arch http://hackage.haskell.org/packages/archive/pandoc/1.6.0.1/pandoc.cabal<br />
Using /tmp/tmp.D7HAJJx2js/pandoc.cabal<br />
Feeding the PKGBUILD to `makepkg -g`...<br />
==> Retrieving Sources...<br />
-> Downloading pandoc-1.6.0.1.tar.gz...<br />
--2011-05-14 07:25:39-- http://hackage.haskell.org/packages/archive/pandoc/1.6.0.1/pandoc-1.6.0.1.tar.gz<br />
Resolving hackage.haskell.org... 69.30.63.204<br />
Connecting to hackage.haskell.org|69.30.63.204|:80... connected.<br />
HTTP request sent, awaiting response... 200 OK<br />
Length: 355477 (347K) [application/x-tar]<br />
Saving to: “pandoc-1.6.0.1.tar.gz.part”<br />
<br />
0K .......... .......... .......... .......... .......... 14% 210K 1s<br />
50K .......... .......... .......... .......... .......... 28% 393K 1s<br />
100K .......... .......... .......... .......... .......... 43% 338K 1s<br />
150K .......... .......... .......... .......... .......... 57% 419K 0s<br />
200K .......... .......... .......... .......... .......... 72% 404K 0s<br />
250K .......... .......... .......... .......... .......... 86% 554K 0s<br />
300K .......... .......... .......... .......... ....... 100% 506K=0.9s<br />
<br />
2011-05-14 07:25:40 (369 KB/s) - “pandoc-1.6.0.1.tar.gz.part” saved [355477/355477]<br />
<br />
==> Generating checksums for source files...<br />
</pre><br />
<br />
Checking what was created:<br />
<br />
% ls<br />
haskell-pandoc<br />
% cd haskell-pandoc<br />
% ls<br />
haskell-pandoc.install PKGBUILD<br />
<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
<pre><br />
# Maintainer: <br />
_hkgname=pandoc<br />
pkgname=haskell-pandoc<br />
pkgver=1.6.0.1<br />
pkgrel=1<br />
pkgdesc="Conversion between markup formats"<br />
url="http://hackage.haskell.org/package/${_hkgname}"<br />
license=('GPL')<br />
arch=('i686' 'x86_64')<br />
makedepends=()<br />
depends=('ghc' 'haskell-http=4000.1.1' 'haskell-bytestring=0.9.1.10' 'haskell-containers=0.4.0.0' 'haskell-directory=1.1.0.0' 'haskell-extensible-exceptions=0.1.1.2' 'haskell-filepath=1.2.0.0' 'haskell-mtl=2.0.1.0' 'haskell-network=2.3.0.2' 'haskell-old-time=1.0.0.6' 'haskell-parsec=3.1.1' 'haskell-pretty=1.0.1.2' 'haskell-process=1.0.1.5' 'haskell-random=1.0.0.3' 'haskell-syb=0.3' 'haskell-texmath<0.5' 'haskell-utf8-string>=0.3' 'haskell-xhtml=3000.2.0.1' 'haskell-xml<1.4' 'haskell-zip-archive<0.2')<br />
options=('strip')<br />
source=(http://hackage.haskell.org/packages/archive/${_hkgname}/${pkgver}/${_hkgname}-${pkgver}.tar.gz)<br />
install=${pkgname}.install<br />
md5sums=('d19a630462595941b3100dff6f839aa3')<br />
build() {<br />
cd ${srcdir}/${_hkgname}-${pkgver}<br />
runhaskell Setup configure -O ${PKGBUILD_HASKELL_ENABLE_PROFILING:+-p } --enable-split-objs --enable-shared \<br />
--prefix=/usr --docdir=/usr/share/doc/${pkgname} --libsubdir=\$compiler/site-local/\$pkgid<br />
runhaskell Setup build<br />
runhaskell Setup haddock<br />
runhaskell Setup register --gen-script<br />
runhaskell Setup unregister --gen-script<br />
sed -i -r -e "s|ghc-pkg.*unregister[^ ]* |&'--force' |" unregister.sh<br />
}<br />
package() {<br />
cd ${srcdir}/${_hkgname}-${pkgver}<br />
install -D -m744 register.sh ${pkgdir}/usr/share/haskell/${pkgname}/register.sh<br />
install -m744 unregister.sh ${pkgdir}/usr/share/haskell/${pkgname}/unregister.sh<br />
install -d -m755 ${pkgdir}/usr/share/doc/ghc/html/libraries<br />
ln -s /usr/share/doc/${pkgname}/html ${pkgdir}/usr/share/doc/ghc/html/libraries/${_hkgname}<br />
runhaskell Setup copy --destdir=${pkgdir}<br />
}<br />
</pre><br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* Libraries are prefixed with "haskell-"<br />
* All libraries that the package depend on are listed (libraries shipped with ghc are dealt with by having the ghc package provide them)<br />
* It uses cabal to generate a post-install register/unregister script, with a standard name.<br />
* We use haddock to build the documentation.<br />
<br />
All Haskell libraries should follow these naming conventions, and using the latest release of cabal2arch will ensure this is the case.<br />
<br />
NOTE: Beginning with cabal2arch 1.1-2, a new environment variable, '''PKGBUILD_HASKELL_ENABLE_PROFILING''', is generated into the PKGBUILD. If this variable is of non-zero length, such as "1" or "true", then profiling builds will occur. Thus, if a user desires profiling, then it is advised to export this environment variable in a file such as ~/.bashrc or ~/.zshrc.<br />
<br />
===Guidelines for Libraries===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all libraries have a dependency on 'ghc'<br />
* all libraries that are depended on must be listed in the depends-array in the PKGBUILD<br />
* be careful about dependencies from gtk2hs: cairo, svg, glib, gtk. These are all provided by the 'gtk2hs' package, not , e.g. "haskell-cairo"<br />
<br />
Registering Haskell libraries is done via a register hook, see above.<br />
<br />
===Guidelines for Programs ===<br />
<br />
* Have their normal name. Examples: hmp3, xmonad, ghc, cabal-install<br />
<br />
* Be careful about dynamically linked runtime dependencies on C. For example, all GHC-produced binaries have a runtime dependency on 'gmp'. OpenGL or GtT-based binaries will have additional 'depends'. cabal2arch will attempt to work out the C dependencies, but there may be others implied by Haskell dependencies that are missed.<br />
<br />
* Use executable stripping, --enable-executable-stripping. cabal2arch will do this automatically.<br />
<br />
== Automatic local building of Hackage Packages with cabal2arch using Bauerbill ==<br />
{{Warning|''Bauerbill'' development has been officially discontinued: its latest version does not work with ''pacman>&#61;3.5''. See [https://bbs.archlinux.org/viewtopic.php?id&#61;115660].}}<br />
Although there are a number of haskell packages on AUR, there will always be outdated packages on AUR. If this happens and you want to create a fully updated package you would normally use cabal2arch. This however can become painful/time consuming if you have numerous packages with different dependencies (some of which may/may not be updated). Instead you can automatic this process by using [[Bauerbill]] which has the --hackage flag, allowing you to create AUR packages from Hackage locally. Below is an example of some common commands<br />
<br />
bauerbill -S --hackage [pkgs] : build [pkgs] directly from Hackage*<br />
bauerbill -Si --hackage [pkgs] : look up information about [pkgs]<br />
bauerbill -Ss --hackage [args] : search for [args]<br />
bauerbill -Qu --hackage : list upgradable Hackage packages<br />
<br />
Syncing packages with the --hackage flag will interactively download all dependencies of the package from Hackage, convert them using cabal2arch and then build/install them (while checking dependencies). You can combine this with the --aur flag to give precedence to Hackage packages that are on AUR</div>
Listdata
https://wiki.archlinux.org/index.php?title=Kernel_Compilation_without_ABS&diff=112060
Kernel Compilation without ABS
2010-07-16T00:51:18Z
<p>Listdata: run-on sentences chopped up with semicolons</p>
<hr />
<div>[[Category:Kernel (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Kernel_Compilation_From_Source}}<br />
{{i18n_entry|简体中文|Kernel_Compilation_From_Source_从源码编译内核}}<br />
{{i18n_links_end}}<br />
The summary below is helpful for building custom kernels from '''kernel.org sources'''. This method of compiling kernels is the traditional method common to all distros; however, an excellent method of cleanly installing the custom kernel with makepkg and pacman is also included. <br />
<br />
You may alternatively choose to use ABS to build and install your kernel; See: [[Kernel Compilation with ABS]]. Some Arch users prefer the <code>traditional</code> way; however, using [[ABS]] is helpful for automating certain tasks. The choice is yours; neither way is inherently better than the other. <br />
----<br />
== Fetching source ==<br />
* Fetch the kernel source from <code>ftp.xx.kernel.org/pub/linux/kernel/</code>, where xx is your country key (f.e. 'us', 'uk', 'de', ... - Check [http://www.kernel.org] for a complete list of mirrors). If you have no ftp gui, you can use <code>wget</code>. For this example, we will fetch and compile 2.6.32.8; you should need to change only the version to get a different kernel.<br />
For instance:<br />
$ wget -c http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.32.8.tar.bz2<br />
<br />
* Copy the kernel source to your build directory, e.g.:<br />
$ cp linux-2.6.32.8.tar.bz2 ~/kernelbuild/<br />
<br />
* Unpack it and enter the source directory:<br />
$ cd ~/kernelbuild<br />
$ tar -xvjf linux-2.6.32.8.tar.bz2<br />
$ cd linux-2.6.32.8<br />
Prepare for compilation by running the following command:<br />
make mrproper<br />
This ensures that the kernel tree is absolutely clean. The kernel team recommends that this command be issued prior to each kernel compilation. Do not rely on the source tree being clean after un-tarring.<br />
<br />
== Build configuration ==<br />
<br />
* (Optional) Copy the .config file from the running kernel, if you want to modify default Arch settings.<br />
$ zcat /proc/config.gz > .config<br />
<br />
* Configure your kernel.<br />
<br />
The Traditional Way:<br />
$ make oldconfig (only if you've copied the old .config file)<br />
$ make menuconfig<br />
<br />
{{Note | oldconfig will run through your config file and prompt you for any new options not previously set. That is for options that would be added to the new kernel you are building.}}<br />
<br />
Kernel version 2.6.32 and higher now provides the more user-friendly '''localmodconfig''' script which makes some configuration selections for you, according to the currently running modules.<br />
''Note: '''localmodconfig''' expects lsmod at /sbin/lsmod, thus Arch users must symlink to /bin/lsmod''.<br />
<br />
As root:<br />
# ln -s /bin/lsmod /sbin/lsmod<br />
As non-root: <br />
$ make localmodconfig<br />
''Note: for more information about the new build target "localmodconfig" refer to the [http://kernelnewbies.org/Linux_2_6_32#head-11f54cdac41ad6150ef817fd68597554d9d05a5f 2.6.32 release notes].''<br />
<br />
You can also use <code>make xconfig</code> (depends on Qt) or <code>make gconfig</code> (depends on GTK), instead of the console-based <code>make menuconfig</code>.<br />
<br />
* Make your changes to the kernel and save your config file. It's a good idea to make a backup copy, since you will likely be doing this multiple times until you get all the options right.<br />
<br />
* If you are compiling a kernel using your current config file, do not forget to rename your kernel version, or you may replace your existing one by mistake.<br />
<br />
$ make menuconfig<br />
General setup ---><br />
(-ARCH) Local version - append to kernel release<br />
<br />
=== What about /usr/src/ ? ===<br />
Using the /usr/src/ directory for kernel compilation as root, along with the creation of the corresponding symlink, is considered poor practice by some kernel hackers. They consider the cleanest method to simply use your home directory. If you subscribe to this point of view, build and configure your kernel as normal user, and install as root, or with makepkg and pacman (covered below). <br />
<br />
However, this concept has been the target of debate, and other very experienced hackers consider the practice of compiling as root under /usr/src/ to be completely safe, acceptable and even preferable. <br />
<br />
Use whichever method you feel more comfortable with.<br />
<br />
== Compilation and installation ==<br />
Choose one of the following:<br />
==== 1. Manual, Traditional method ==== <br />
<br />
{{Warning | Don't run <code>make all</code> if you use GRUB and still have LILO installed; it will configure LILO in the end, and you may no longer be able to boot your machine! Remove LILO (pacman -R lilo) before running <code>make all</code> if you use GRUB!}}<br />
<br />
* Compile it:<br />
$ make<br />
(Same as make vmlinux && make modules && make bzImage - see make help for more information on this.)<br />
<br />
* Install modules: (This needs to be done as root.)<br />
# make modules_install<br />
<br />
This copies the compiled modules into a directory in /lib/modules named by the kernel version and appended string you set in menuconfig. This way, modules are kept separate from those used by other kernels on your machine.<br />
<br />
* Copy kernel:<br />
# cp -v arch/x86/boot/bzImage /boot/vmlinuz-2.6.32.8-revision1<br />
<br />
* Copy System.map:<br />
# cp -v System.map /boot/System.map-2.6.32.8-revision1<br />
(There seems to be some debate as to whether this step is necessary with modern systems, but since the official Arch kernel packages still include it, it is included here.)<br />
<br />
* If you need any modules loaded in order to mount the root filesystem, build a ramdisk (most users probably want this). The -k parameter accepts the kernel version and appended string you set in menuconfig and is used, in part, to locate the modules in /lib/modules:<br />
<br />
# mkinitcpio -k 2.6.32.8-revision1 -g /boot/kernel26-revision1.img<br />
<br />
<br />
You are, of course, free to change the name of the <code>vmlinuz</code>, <code>System.map</code> and <code>kernel26.img</code> files; however, the <code>name-version-revision</code> system is helpful for keeping track which of several kernel compiles you have made. You could also try including a date or time, or stick to a simpler naming system if you wish.<br />
<br />
====2. With makepkg and pacman (Recommended)====<br />
This method has the advantage of creating a package which can be cleanly installed (and removed) and tracked by pacman.<br />
<br />
Create following PKGBUILD and kernel26.install files in build directory.<br />
<br />
<b>PKGBUILD</B><br />
<br />
Adjust basekernel and pkgver depending on your version.<br />
<br />
<pre><br />
pkgname=kernel26-my<br />
basekernel=2.6.32.8<br />
pkgver=2.6.32.8<br />
pkgrel=1<br />
pkgdesc="The Linux Kernel and modules"<br />
arch=('i686' 'x86_64')<br />
license=('GPL')<br />
url="http://www.kernel.org"<br />
depends=('module-init-tools' 'mkinitcpio')<br />
provides=(kernel26)<br />
install=kernel26.install<br />
<br />
build() {<br />
LOCAL_VERSION="$(grep "CONFIG_LOCALVERSION=" $startdir/.config | sed 's/.*"\(.*\)"/\1/')"<br />
<br />
cd ..<br />
make || return 1<br />
mkdir -p $startdir/pkg/{lib/modules,boot}<br />
make INSTALL_MOD_PATH=$startdir/pkg modules_install || return 1<br />
<br />
# There's no separation of firmware depending on kernel version - <br />
# comment this line if you intend on using the built kernel exclusively,<br />
# otherwise there'll be file conflicts with the existing kernel<br />
rm -rf $startdir/pkg/lib/firmware<br />
<br />
install -Dm644 "System.map" "$startdir/pkg/boot/System.map26$LOCAL_VERSION"<br />
install -Dm644 "arch/x86/boot/bzImage" "$startdir/pkg/boot/vmlinuz26$LOCAL_VERSION"<br />
<br />
# Change the version strings in kernel26.install<br />
sed -i \<br />
-e "s/KERNEL_VERSION=.*/KERNEL_VERSION=\"$basekernel\"/" \<br />
-e "s/LOCAL_VERSION=.*/LOCAL_VERSION=\"$LOCAL_VERSION\"/" \<br />
$startdir/kernel26.install<br />
}<br />
</pre><br />
<br />
<b>kernel26.install</B><br />
<br />
<pre><br />
KERNEL_VERSION="2.6.32.8"<br />
LOCAL_VERSION="-MINE"<br />
<br />
post_install () {<br />
echo ">>> Updating module dependencies..."<br />
/sbin/depmod -A -v ${KERNEL_VERSION}${LOCAL_VERSION}<br />
echo ">>> Creating initial ramdisk..."<br />
mkinitcpio -k "${KERNEL_VERSION}${LOCAL_VERSION}" -g "/boot/kernel26${LOCAL_VERSION}.img"<br />
}<br />
<br />
post_upgrade() {<br />
echo ">>> Updating module dependencies..."<br />
/sbin/depmod -A -v ${KERNEL_VERSION}${LOCAL_VERSION}<br />
echo ">>> Creating initial ramdisk..."<br />
mkinitcpio -k "${KERNEL_VERSION}${LOCAL_VERSION}" -g "/boot/kernel26${LOCAL_VERSION}.img"<br />
}<br />
</pre><br />
<br />
<br />
You can now build and install the kernel as an Arch package with:<br />
$ makepkg -c -i<br />
(The -c option will clean up leftover work files and directories after a successful build whereas -i specifies that makepkg should immediately invoke pacman to install the resulting package (you can also use just <code>makepkg -ci</code>).)<br />
<br />
== Bootloader configuration ==<br />
<br />
Add an entry for your amazing new kernel in your bootloader's configuration file - see [[GRUB]] or [[LILO]] for examples. Note that if you use LILO, the kernel sources include a script to automate the process:<br />
<br />
$ arch/i386/boot/install.sh<br />
<br />
If you use LILO, remember to type <code>lilo</code> as root at the prompt to update it.<br />
<br />
== Using the NVIDIA video driver with your custom kernel ==<br />
To use the NVIDIA driver with your new custom kernel, see: [http://wiki.archlinux.org/index.php/NVIDIA#Alternate_install:_custom_kernel Installing the driver for a custom kernel]. You can also install nvidia drivers from AUR.</div>
Listdata
https://wiki.archlinux.org/index.php?title=Brother_MFC-9840CDW&diff=98347
Brother MFC-9840CDW
2010-02-27T05:59:00Z
<p>Listdata: /* Setup with PostScript + Foomatic */ (use all caps for HTTP address because that's what the printer uses by default)</p>
<hr />
<div>[[Category:Printers_(English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
=Introduction=<br />
<br />
This is a small tutorial to make the printer Brother MFC-9840CDW work on Arch, through a wired (ethernet cable) network connection.<br />
<br />
Brother released an official .ppd (postscript printer description) file on June 24, 2009. It is available from [http://solutions.brother.com/linux/en_us/download_prn.html#MFC-9840CDW]. This .ppd file lets you change essential printer settings such as color/mono in the application's dialog box (such as Firefox), and is thus recommended over the previous method of using generic printer drivers.<br />
<br />
=Setup with PostScript + Brother's Official .ppd file=<br />
<br />
'''TIP: You can add multiple versions of the MFC-9840CDW by repeating the steps below, and then for each version, changing the printer settings with the ''Set Printer Options'' button in CUPS. This way, you can quickly set up default settings that you use often (e.g., color vs. greyscale), and then print with these options by simply selecting the corresponding printer in your application (instead of using the application-specific printer dialog box each time you want to print using non-default settings).'''<br />
<br />
* Install the '''cups''' package. Make sure it's working by going to http://localhost:631<br />
* Download Brother's official .ppd file from [http://solutions.brother.com/linux/en_us/download_prn.html#MFC-9840CDW].<br />
* Make sure the printer is connected to your network router/switch. If your router is acting as a DHCP server, the MFC-9840CDW will automatically get an IP address assigned. Make note of this IP address. (You could also assign a static IP address to your printer, but that is outside the scope of this article).<br />
* Go to http://localhost:631 to open up the CUPS web interface.<br />
* Click on the '''Administration''' tab and then click on '''Add printer.'''<br />
* Select the "Internet Printing Protocol (http)" option for the Device.<br />
* For the Device URI, use: '''http://IPADDRESSOFPRINTER:631/POSTSCRIPT_P1'''. E.g., '''http://192.168.0.102:631/POSTSCRIPT_P1'''<br />
* For the Make/Manufacturer, provide the official .ppd file that you downloaded.<br />
* Click on '''Add Printer''' to finish the wizard.<br />
<br />
Make sure to modify the default settings, such as page size (change this to letter, if you are not using A4 paper), auto/color/mono for color settings, toner save on/off, as well as duplex mode (DuplexTumble is short-edge duplex, and DuplexNoTumble is long-edge.)<br />
<br />
=Old Method=<br />
<br />
Additionally, you can set it up with either the generic postscript drivers, or PCL-6 drivers with gutenprint (as the MFC-9840CDW supports PCL-6 emulation). The postscript driver has fewer settings, and is easy to set up, whereas the PCL-6 driver has more options, although it is more experimental (and doesn't support color). As of February 2009, the postscript driver always has color on by default, whereas the PCL-6 driver is always set to greyscale -- so you may want to add two printers, with one for each.<br />
<br />
==Setup with PostScript + Foomatic==<br />
<br />
The MFC-9840CDW natively supports the postscript format, so for basic printing functionality we'll be using the generic postscript driver that comes with the foomatic packages. (Again, it is recommended to download Brother's official .ppd file instead of using the generic ones as shown below.)<br />
<br />
* Install the '''cups''' package. Make sure it's working by going to http://localhost:631<br />
* Install the '''foomatic-db''', '''foomatic-db-engine''', and '''foomatic-filters''' packages (to get the generic postscript driver that we need).<br />
* Make sure the printer is connected to your network router/switch. If your router is acting as a DHCP server, the MFC-9840CDW will automatically get an IP address assigned. Make note of this IP address. (You could also assign a static IP address to your printer, but that is outside the scope of this article).<br />
* Go to http://localhost:631 to open up the CUPS web interface.<br />
* Click on the '''Administration''' tab and then click on '''Add printer.'''<br />
* Select the "Internet Printing Protocol (http)" option for the Device.<br />
* For the Device URI, use: '''http://IPADDRESSOFPRINTER:631/POSTSCRIPT_P1'''. E.g., '''http://192.168.0.102:631/POSTSCRIPT_P1'''<br />
* For the Make/Manufacturer, click on '''Generic''', then '''Generic PostScript Printer Foomatic/Postscript (en)''' (do not choose the "Level 1" variant, as it is an older postcript driver for older printers)<br />
* Click on '''Add Printer''' to finish the wizard.<br />
<br />
Print out a test page to see if everything works. The above configuration allows you to change the duplex and resolution (dpi) settings within CUPS, via the '''Set Printer Options''' button under the '''Printers''' tab, but is missing the "Toner save" option. Of course, this and all other settings are still accessible via the printer's own web interface, which makes any changes the default settings of the printer (see the official Brother documentation).<br />
<br />
==Setup with PCL-6 and Gutenprint==<br />
<br />
The MFC-9840CDW also natively supports (via emulation) the PCL-6 format, so we can take advantage of this feature. The procedure is essentially identical as with the postscript configuration above, except for a couple of things.<br />
<br />
* Install the '''gutenprint''' package.<br />
* Instead of '''postscript_p1''' in the Device URI field, use '''pcl_p1''' (the '''pcl''' has a lowercase 'L', not a numeral 'one').<br />
* Under For the Make/Manufacturer, click on '''Generic''' again, but instead choose the '''Generic PCL 6/PCL XL Printer - CUPS+Gutenprint v.5.2.3 (en)''' option. (The Gutenprint version number is dependant, of course, on which version of '''gutenprint''' you have installed.)<br />
<br />
Customize the default printer settings, to the extent that they are controlled by CUPS, by clicking on the '''Set Printer Options''' button in the CUPS web interface. You will notice that the Gutenprint driver has many more options than the generic PostScript driver. You may want to repeat the procedure above and add a second printer, and then customize this second printer's settings to your liking (e.g., color instead of greyscale).<br />
<br />
''Note: As there are many different PCL-6 drivers available, you may want to experiment with using these different ones instead of the CUPS+Gutenprint one. To change the driver, click on '''Modify Printer''' and go through the wizard, just like when you were adding the printer from the beginning.''</div>
Listdata
https://wiki.archlinux.org/index.php?title=Brother_MFC-9840CDW&diff=98346
Brother MFC-9840CDW
2010-02-27T05:58:04Z
<p>Listdata: printer uses all caps for network service addresses by default</p>
<hr />
<div>[[Category:Printers_(English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
=Introduction=<br />
<br />
This is a small tutorial to make the printer Brother MFC-9840CDW work on Arch, through a wired (ethernet cable) network connection.<br />
<br />
Brother released an official .ppd (postscript printer description) file on June 24, 2009. It is available from [http://solutions.brother.com/linux/en_us/download_prn.html#MFC-9840CDW]. This .ppd file lets you change essential printer settings such as color/mono in the application's dialog box (such as Firefox), and is thus recommended over the previous method of using generic printer drivers.<br />
<br />
=Setup with PostScript + Brother's Official .ppd file=<br />
<br />
'''TIP: You can add multiple versions of the MFC-9840CDW by repeating the steps below, and then for each version, changing the printer settings with the ''Set Printer Options'' button in CUPS. This way, you can quickly set up default settings that you use often (e.g., color vs. greyscale), and then print with these options by simply selecting the corresponding printer in your application (instead of using the application-specific printer dialog box each time you want to print using non-default settings).'''<br />
<br />
* Install the '''cups''' package. Make sure it's working by going to http://localhost:631<br />
* Download Brother's official .ppd file from [http://solutions.brother.com/linux/en_us/download_prn.html#MFC-9840CDW].<br />
* Make sure the printer is connected to your network router/switch. If your router is acting as a DHCP server, the MFC-9840CDW will automatically get an IP address assigned. Make note of this IP address. (You could also assign a static IP address to your printer, but that is outside the scope of this article).<br />
* Go to http://localhost:631 to open up the CUPS web interface.<br />
* Click on the '''Administration''' tab and then click on '''Add printer.'''<br />
* Select the "Internet Printing Protocol (http)" option for the Device.<br />
* For the Device URI, use: '''http://IPADDRESSOFPRINTER:631/POSTSCRIPT_P1'''. E.g., '''http://192.168.0.102:631/POSTSCRIPT_P1'''<br />
* For the Make/Manufacturer, provide the official .ppd file that you downloaded.<br />
* Click on '''Add Printer''' to finish the wizard.<br />
<br />
Make sure to modify the default settings, such as page size (change this to letter, if you are not using A4 paper), auto/color/mono for color settings, toner save on/off, as well as duplex mode (DuplexTumble is short-edge duplex, and DuplexNoTumble is long-edge.)<br />
<br />
=Old Method=<br />
<br />
Additionally, you can set it up with either the generic postscript drivers, or PCL-6 drivers with gutenprint (as the MFC-9840CDW supports PCL-6 emulation). The postscript driver has fewer settings, and is easy to set up, whereas the PCL-6 driver has more options, although it is more experimental (and doesn't support color). As of February 2009, the postscript driver always has color on by default, whereas the PCL-6 driver is always set to greyscale -- so you may want to add two printers, with one for each.<br />
<br />
==Setup with PostScript + Foomatic==<br />
<br />
The MFC-9840CDW natively supports the postscript format, so for basic printing functionality we'll be using the generic postscript driver that comes with the foomatic packages. (Again, it is recommended to download Brother's official .ppd file instead of using the generic ones as shown below.)<br />
<br />
* Install the '''cups''' package. Make sure it's working by going to http://localhost:631<br />
* Install the '''foomatic-db''', '''foomatic-db-engine''', and '''foomatic-filters''' packages (to get the generic postscript driver that we need).<br />
* Make sure the printer is connected to your network router/switch. If your router is acting as a DHCP server, the MFC-9840CDW will automatically get an IP address assigned. Make note of this IP address. (You could also assign a static IP address to your printer, but that is outside the scope of this article).<br />
* Go to http://localhost:631 to open up the CUPS web interface.<br />
* Click on the '''Administration''' tab and then click on '''Add printer.'''<br />
* Select the "Internet Printing Protocol (http)" option for the Device.<br />
* For the Device URI, use: '''http://IPADDRESSOFPRINTER:631/postscript_p1'''. E.g., '''http://192.168.0.102:631/postscript_p1'''<br />
* For the Make/Manufacturer, click on '''Generic''', then '''Generic PostScript Printer Foomatic/Postscript (en)''' (do not choose the "Level 1" variant, as it is an older postcript driver for older printers)<br />
* Click on '''Add Printer''' to finish the wizard.<br />
<br />
Print out a test page to see if everything works. The above configuration allows you to change the duplex and resolution (dpi) settings within CUPS, via the '''Set Printer Options''' button under the '''Printers''' tab, but is missing the "Toner save" option. Of course, this and all other settings are still accessible via the printer's own web interface, which makes any changes the default settings of the printer (see the official Brother documentation).<br />
<br />
==Setup with PCL-6 and Gutenprint==<br />
<br />
The MFC-9840CDW also natively supports (via emulation) the PCL-6 format, so we can take advantage of this feature. The procedure is essentially identical as with the postscript configuration above, except for a couple of things.<br />
<br />
* Install the '''gutenprint''' package.<br />
* Instead of '''postscript_p1''' in the Device URI field, use '''pcl_p1''' (the '''pcl''' has a lowercase 'L', not a numeral 'one').<br />
* Under For the Make/Manufacturer, click on '''Generic''' again, but instead choose the '''Generic PCL 6/PCL XL Printer - CUPS+Gutenprint v.5.2.3 (en)''' option. (The Gutenprint version number is dependant, of course, on which version of '''gutenprint''' you have installed.)<br />
<br />
Customize the default printer settings, to the extent that they are controlled by CUPS, by clicking on the '''Set Printer Options''' button in the CUPS web interface. You will notice that the Gutenprint driver has many more options than the generic PostScript driver. You may want to repeat the procedure above and add a second printer, and then customize this second printer's settings to your liking (e.g., color instead of greyscale).<br />
<br />
''Note: As there are many different PCL-6 drivers available, you may want to experiment with using these different ones instead of the CUPS+Gutenprint one. To change the driver, click on '''Modify Printer''' and go through the wizard, just like when you were adding the printer from the beginning.''</div>
Listdata
https://wiki.archlinux.org/index.php?title=Network_Time_Protocol&diff=83395
Network Time Protocol
2009-11-13T03:21:01Z
<p>Listdata: /* OpenNTPD */ added note about how ntpd will only serve time after it has achieved a certain degree of accuracy; noted restarting of ntpd daemon to sync time; some rewording and grammar change</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:Daemons and system services (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|:Network Time Protocol}}<br />
{{i18n_entry|简体中文|:Network Time Protocol (简体中文)}}<br />
{{i18n_links_end}}<br />
This article describes the different possibilities of getting accurate system time and date for your system. First openntpd is explained, an easy to use solution. The original ntpd method is also explained for completeness' sake.<br />
<br />
==OpenNTPD==<br />
'''OpenNTPD''' is a free, easy to use implementation of the Network Time Protocol. It provides the ability to sync the local clock to remote NTP servers and can act as NTP server itself, redistributing the local clock. OpenNTPD is primarily developed by Henning Brauer as part of the OpenBSD Project, and is a brand new implementation of the ntp protocol. It is also much easier to configure and use than ntpd.<br />
<br />
First, the OpenNTPD package must be installed.<br />
It is available in the Arch Linux community repository.<br />
<br />
# pacman -S openntpd<br />
<br />
The default configuration is actually usable if all you want is to sync the local computer. For sophisticated settings, the /etc/ntpd.conf file must be edited:<br />
<br />
To sync to a particular server, uncomment and edit the "server" directive. You can find the server's URL in your area at [http://www.pool.ntp.org/zone/@ www.pool.ntp.org/zone/@].<br />
server ntp.example.org<br />
<br />
The "servers" directive works the same as the "server" directive, however, if the DNS name resolves to multiple IP address, ALL of them will be synced to. The default, "pool.ntp.org" is working and should be acceptable in most cases.<br />
pool.ntp.org<br />
<br />
Any number of "server" or "servers" directives may be used.<br />
<br />
If you want the computer you run OpenNTPD on to also be a time server, simply uncomment and edit the "listen" directive.<br />
<br />
For example:<br />
listen on *<br />
will listen on all interfaces, and<br />
listen on 127.0.0.1<br />
will only listen on the loopback interface.<br />
<br />
However, your time server will only begin to serve time after it has synchronized itself to a high resolution. This may take hours, or days, depending on the accuracy of your system.<br />
<br />
If you would like to run OpenNTPD at boot, add openntpd the DAEMONS variable in your /etc/rc.conf. If you are using openntpd just to set your local system time, you could add @openntpd instead of openntpd to decrease the boot time; adding the @ makes Arch run the other daemons following @openntpd without waiting for openntpd to finish.<br />
<br />
If you want to see the status of your syncing, look at /var/log/daemon.log and look for entries with "ntpd".<br />
<br />
OpenNTPD adjusts the clock by small amounts at a time. It is designed this way to prevent sudden, large time fluctuations in your system, which could adversely affect system services (e.g., cron jobs). Thus, it can take some time to correct the time.<br />
<br />
If your clock is off by more than 180 seconds you can try "<code>ntpd -s -d</code>" in the console. If ntpd is already running, you can simply restart it with "<code>sudo /etc/rc.d/openntpd restart</code>", as the Arch openntpd package uses the "-s" flag by default. See "<code>man ntpd</code>" for more info. You can also use "<code>date --set=STRING</code>" to set the time as close to possible to the actual time and then let OpenNTPD fine tune the time.<br />
<br />
===Trouble shooting===<br />
'''Error adjusting time'''<br />
<br />
If you find your time set incorrectly and in log you see<br />
openntpd adjtime failed: Invalid argument<br />
try "<code>ntpd -s -d</code>" in console .<br />
<br />
'''Increasing time shift'''<br />
<br />
Starting ''openntpd'' in the background could lead to synchronization errors between the actual time and the time stored on your computer. If you recognize an increasing time difference between your desktop clock and the actual time, try to start the ''openntpd'' daemon normal and not in the background.<br />
<br />
'''Initialization Failure'''<br />
<br />
openntpd may fail to initialize properly if it is started before the network is fully configured. In some cases you may want to remove "openntpd" from the DAEMONS array in /etc/rc.conf and add the following line to /etc/rc.local:<br />
<br />
(sleep 300 && /etc/rc.d/openntpd start) &<br />
<br />
This will wait 5 minutes before starting openntpd, which should give the system sufficient time to set up the network properly. If your network settings change often, you may also consider restarting the daemon regularly with cron.<br />
<br />
If you are using netcfg, you can also start/stop openntpd as a POST_UP/PRE_DOWN command in your network profile:<br />
<br />
POST_UP="/etc/rc.d/openntpd start || true"<br />
PRE_DOWN="/etc/rc.d/openntpd stop || true"<br />
<br />
Of course, you will have to specify this manually for each network profile.<br />
<br />
===Using NetworkManager dispatcher===<br />
<br />
OpenNTPD can be brought up/down along with a network connection through the use of NetworkManager's dispatcher scripts. Place the following slightly modified <code>/etc/rc.d/openntpd</code> script as <code>/etc/NetworkManager/dispatcher.d/openntpd-dispatch</code><br />
<br />
#!/bin/bash<br />
<br />
CONF=/etc/conf.d/openntpd<br />
<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
<br />
[ -f $CONF ] && . $CONF<br />
<br />
PID=`pidof -o %PPID /usr/sbin/ntpd`<br />
case "$2" in<br />
up)<br />
stat_busy "Starting OpenNTPD"<br />
[ -z "$PID" ] && /usr/sbin/ntpd $PARAMS<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
PID=`pidof -o %PPID /usr/sbin/ntpd`<br />
echo $PID >/var/run/openntpd.pid<br />
add_daemon openntpd<br />
stat_done<br />
fi<br />
;;<br />
down)<br />
stat_busy "Stopping OpenNTPD"<br />
[ ! -z "$PID" ] && kill $PID &>/dev/null<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon openntpd<br />
stat_done<br />
fi<br />
;;<br />
*)<br />
echo "usage: $0 {up|down}" <br />
esac<br />
exit 0<br />
<br />
==ntpd==<br />
# pacman -S ntp<br />
<br />
===/etc/ntp.conf===<br />
The very first line of your ntp.conf file should contain a line such as the following:<br />
restrict default noquery notrust nomodify<br />
<br />
This essentially restricts everyone from modifying anything. Following this, you need to let ntpd know what you want to let through into your NTP server. Here is where you would specify any other IP addresses you would like to synchronize on your NTP server. For example:<br />
restrict 1.2.3.4<br />
restrict 192.168.0.0 mask 255.255.255.0 nomodify<br />
<br />
This tells ntpd that 1.2.3.4 and all IP addresses from the 192.168.0.0 range will be allowed to synchronize on this server, but they will not be allowed to modify anything. All other IP addresses in the world will still obey the default restrictions (the first line in the ntp.conf).<br />
<br />
Now, is where the stratum 2 servers that our server will synchronize with come into play. The lines in ntp.conf will be used to tell ntpd what servers we would like to use for synchronizing (these are just examples; use ntp servers that are closest to your location). Please see http://ntp.isc.org/bin/view/Servers/NTPPoolServers for a list a closer servers.<br />
server ntp1.cs.wisc.edu<br />
server ntp3.cs.wisc.edu<br />
server ntp3.sf-bay.org<br />
<br />
Unless you have a good reason not to, it is advisable to use the pool.ntp.org servers: http://www.pool.ntp.org/.<br />
Alternatively, a list of ntp servers is available at http://www.eecis.udel.edu/~mills/ntp/clock2a.html. Please pay attention to the Access Policies. <br />
<br />
If we left it alone right now, we would never connect to a server because the response from any of the three servers listed above would never be allowed back into our server due to the fact that our default restrict statement would be in use (since we did not add the servers to our lesser restrictions (like we did with 127.0.0.1 and the subnet of 192.168.0.0).<br />
<br />
To correct this, enter the following lines in ntp.conf:<br />
restrict ntp1.cs.wisc.edu noquery nomodify<br />
restrict ntp3.cs.wisc.edu noquery nomodify<br />
restrict ntp3.sf-bay.org noquery nomodify<br />
<br />
This will allow the response from the above servers into our system so our local clock can be synchronized. The noquery restriction will not allow any of the above three servers to query for information from our server. The nomodify restriction will not allow the three servers to modify anything (synchronization will still take place).<br />
<br />
The only thing left to do is add the drift file (which keeps track of yours clocks time deviation). and the log file location:<br />
driftfile /etc/ntp.drift<br />
logfile /var/log/ntp.log<br />
<br />
The complete file will look like this:<br />
<br />
<pre><br />
# default restrictions<br />
restrict default noquery notrust nomodify<br />
<br />
# override the default restrictions here<br />
restrict 10.1.1.0 mask 255.255.255.0 nomodify<br />
<br />
# public NTP servers to sync with (all stratum 2)<br />
server ntp1.cs.wisc.edu<br />
server ntp3.cs.wisc.edu<br />
server ntp3.sf-bay.org<br />
<br />
restrict ntp1.cs.wisc.edu noquery nomodify<br />
restrict ntp3.cs.wisc.edu noquery nomodify<br />
restrict ntp3.sf-bay.org noquery nomodify<br />
<br />
# NTP drift file - used to keep track of your system clocks<br />
# time deviation<br />
driftfile /etc/ntp.drift<br />
<br />
# NTP log file<br />
logfile /var/log/ntp.log<br />
</pre><br />
<br />
Take note that this is for a client and a server ntp.conf configuration. If you just want to synchronize with a stratum server and are not concerned with other PCs synchronizing with your ntp server, then you can do something like the following (note that only 127.0.0.1 is allowed to be synchronized):<br />
<br />
<pre><br />
# default restrictions<br />
restrict default noquery notrust nomodify<br />
<br />
# Permit all access over the loopback interface<br />
restrict 127.0.0.1<br />
<br />
# public NTP servers to sync with (all stratum 2)<br />
server ntp1.cs.wisc.edu<br />
server ntp3.cs.wisc.edu<br />
server ntp3.sf-bay.org<br />
<br />
restrict ntp1.cs.wisc.edu noquery nomodify<br />
restrict ntp3.cs.wisc.edu noquery nomodify<br />
restrict ntp3.sf-bay.org noquery nomodify<br />
<br />
# NTP drift file - used to keep track of your system clocks<br />
# time deviation<br />
driftfile /etc/ntp.drift<br />
<br />
# NTP log file<br />
logfile /var/log/ntp.log<br />
</pre><br />
<br />
... or if you do not care about restrictions at all, something like this (note there are no restrictions, thus no need to reduce restrictions for 127.0.0.1 to allow your local clock to synchronize):<br />
<br />
<pre><br />
# public NTP servers to sync with (all stratum 2)<br />
server ntp1.cs.wisc.edu<br />
server ntp3.cs.wisc.edu<br />
server ntp3.sf-bay.org<br />
<br />
# NTP drift file - used to keep track of your system clocks<br />
# time deviation<br />
driftfile /etc/ntp.drift<br />
<br />
# NTP log file<br />
logfile /var/log/ntp.log<br />
</pre><br />
<br />
The reason for the 'restrict' lines is security: If you do not want a secure NTP server, do not add any restrict lines to your ntp.conf file. If you want a secure NTP server, start out by adding a default restrict that does not allow anything to contact your server, then add more (less restrictive) restrict lines - allowing certain addresses various access privileges.<br />
<br />
===/etc/rc.d/network===<br />
One more thing that you may want to do. In some cases, your /etc/ntp.conf file may be overwritten by dhcp. To avoid this, edit the /etc/conf.d/dhcpcd file and add <code>-N</code> to the line that starts with '<code>dhcpcd -t 10</code>'.<br />
<br />
On the system, /etc/conf.d/dhcpcd contains a single line:<br />
DHCPCD_ARGS="-t 30 -h $HOSTNAME"<br />
<br />
Change it to:<br />
DHCPCD_ARGS="-N -t 30 -h $HOSTNAME"<br />
<br />
Some have suggested adding <code>-R</code> to preserve /etc/resolv.conf as well.<br />
<br />
===/etc/conf.d/ntp-client.conf===<br />
This is for /etc/rc.d/ntpdate configuration. Edit NTP_CLIENT_SERVER for your ntp server. <br />
<pre><br />
# change this to a server closer to your location<br />
NTP_CLIENT_SERVER="pool.ntp.org"<br />
<br />
# client options<br />
NTP_CLIENT_OPTION="-b -u"<br />
<br />
# timeout for the ntp-client<br />
NTPCLIENT_TIMEOUT=10<br />
<br />
# arguments passed to ntpd when started<br />
NTPD_ARGS="-g"<br />
</pre><br />
<br />
===/etc/rc.conf===<br />
Add ntpdate and ntpd to the DAEMONS array:<br />
DAEMONS=(syslog-ng network '''ntpdate''' '''ntpd''' ...)<br />
<br />
{{Note| ntpdate has to be placed before ntpd and never be prefixed with "@" (ntpdate has to be run and finished by starting ntpd). Because the both processes use same NTP port))}}<br />
<!--<br />
===To fix Time use /etc/rc.local===<br />
To set the correct time; Set time and start ntpd at boot via /etc/rc.local<br />
<br />
Relevant sections of /etc/rc.conf<br />
HARDWARECLOCK="UTC"<br />
TIMEZONE="US/Mountain"<br />
<br />
''Network/DHCP section:''<br />
lo="lo 127.0.0.1"<br />
eth0="dhcp"<br />
INTERFACES=(lo eth0)<br />
''Daemons subsection:''<br />
DAEMONS=(syslog-ng hotplug !pcmcia network netfs !ntpd crond dbus hal alsa gdm)<br />
<br />
This is my /etc/rc.local<br />
#!/bin/bash<br />
#<br />
# /etc/rc.local: Local multi-user startup script.<br />
#<br />
<br />
# Re-copy ntp.conf (was over written by dhcp)<br />
cp /root/CONFIG.BAK/ntp.conf.bac /etc/ntp.conf<br />
# I advise you keep your desired /etc/ntp.conf<br />
# OUTSIDE of /etc<br />
<br />
# Set time<br />
/usr/bin/ntpdate ntp.nasa.gov #Use any time server you like here<br />
<br />
# Start ntpd<br />
/etc/rc.d/ntpd start<br />
<br />
And here is my /root/CONFIG.BAK/ntp.conf.bac (this is just a copy of the desired /etc/ntp.conf)<br />
# default restrictions<br />
restrict default noquery notrust nomodify<br />
<br />
# override the default restrictions here<br />
restrict 127.0.0.1 nomodify<br />
restrict 192.168.2.0 mask 255.255.255.0 nomodify<br />
<br />
# public NTP servers to sync with (all stratum 2)<br />
server ntp.nasa.gov #Use any time server you like here<br />
<br />
restrict ntp.nasa.gov noquery nomodify<br />
<br />
# NTP drift file - used to keep track of your system clocks<br />
driftfile /etc/ntp.drift<br />
<br />
# NTP log file<br />
logfile /var/log/ntp.log<br />
<br />
Leave /etc/conf.d/dhcpcd at default. Mine is a single line and reads<br />
DHCPCD_ARGS="-t 30 -h $HOSTNAME"<br />
<br />
With this configuration I get the correct time and ntpd running at boot.<br />
There may be a better way, but this worked for me.<br />
I hope it helps. --><br />
<br />
===Updating immediately using ntpdate===<br />
It is recommended to add a line like the following to your /etc/rc.local file so when you boot your system, your time will be correct (use an NTP server close to your location).<br />
/usr/bin/ntpdate ntp1.cs.wisc.edu<br />
<br />
Running ''ntpdate'' when you boot up is a good idea because ntpd may take a long time to synchronize your local clock depending on how far off the time is. If your clock is synchronized when ntpd starts, then its sole purpose is to keep it synchronized. To run ntpd at startup, add ''ntpd'' to the daemons section of the /etc/rc.conf file.<br />
<br />
ntpd will work well if you have a connection to the internet all the time. If you are using dialup, you may just want to stick with using ntpdate via the command line.<br />
<br />
====Using NetworkManager dispatcher====<br />
With NetworkManager dispatcher scripts it is possible to update the time right after it has connected successfully. For this you need to place the following script to <code>/etc/NetworkManager/dispatcher.d/time-sync</code> and make it executable (e.g. <code>chmod +x time-sync</code>).<br />
<br />
#!/bin/sh<br />
<br />
case "$2" in<br />
up)<br />
ntpdate pool.ntp.org &>/dev/null<br />
;;<br />
*)<br />
echo "usage: $0 {up}" <br />
esac<br />
exit 0<br />
<br />
===Querying a NTP server using ntpq===<br />
There is a default restrict statement for the localhost that includes an ignore flag. Without overriding it (adding the line ''restrict'' ''127.0.0.1'') you will not be able to query your NTP server. If that is not a concern to you, then leave out the restrict line for your localhost. You will still be able to synchronize with your stratum 2 servers.<br />
<br />
==External links==<br />
* http://www.ntp.org/<br />
* http://twiki.ntp.org/bin/view/Main/WebHome<br />
* http://www.eecis.udel.edu/~mills/ntp/html/index.html<br />
* http://www.openntpd.org</div>
Listdata
https://wiki.archlinux.org/index.php?title=Brother_MFC-9840CDW&diff=74211
Brother MFC-9840CDW
2009-08-19T20:36:20Z
<p>Listdata: /* Setup with PostScript + Brother's Official .ppd file */ toner save is also available as modifiable setting</p>
<hr />
<div>[[Category:Printers_(English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
=Introduction=<br />
<br />
This is a small tutorial to make the printer Brother MFC-9840CDW work on Arch, through a wired (ethernet cable) network connection.<br />
<br />
Brother released an official .ppd (postscript printer description) file on June 24, 2009. It is available from [http://solutions.brother.com/linux/en_us/download_prn.html#MFC-9840CDW]. This .ppd file lets you change essential printer settings such as color/mono in the application's dialog box (such as Firefox), and is thus recommended over the previous method of using generic printer drivers.<br />
<br />
=Setup with PostScript + Brother's Official .ppd file=<br />
<br />
'''TIP: You can add multiple versions of the MFC-9840CDW by repeating the steps below, and then for each version, changing the printer settings with the ''Set Printer Options'' button in CUPS. This way, you can quickly set up default settings that you use often (e.g., color vs. greyscale), and then print with these options by simply selecting the corresponding printer in your application (instead of using the application-specific printer dialog box each time you want to print using non-default settings).'''<br />
<br />
* Install the '''cups''' package. Make sure it's working by going to http://localhost:631<br />
* Download Brother's official .ppd file from [http://solutions.brother.com/linux/en_us/download_prn.html#MFC-9840CDW].<br />
* Make sure the printer is connected to your network router/switch. If your router is acting as a DHCP server, the MFC-9840CDW will automatically get an IP address assigned. Make note of this IP address. (You could also assign a static IP address to your printer, but that is outside the scope of this article).<br />
* Go to http://localhost:631 to open up the CUPS web interface.<br />
* Click on the '''Administration''' tab and then click on '''Add printer.'''<br />
* Select the "Internet Printing Protocol (http)" option for the Device.<br />
* For the Device URI, use: '''http://IPADDRESSOFPRINTER:631/postscript_p1'''. E.g., '''http://192.168.0.102:631/postscript_p1'''<br />
* For the Make/Manufacturer, provide the official .ppd file that you downloaded.<br />
* Click on '''Add Printer''' to finish the wizard.<br />
<br />
Make sure to modify the default settings, such as page size (change this to letter, if you are not using A4 paper), auto/color/mono for color settings, toner save on/off, as well as duplex mode (DuplexTumble is short-edge duplex, and DuplexNoTumble is long-edge.)<br />
<br />
=Old Method=<br />
<br />
Additionally, you can set it up with either the generic postscript drivers, or PCL-6 drivers with gutenprint (as the MFC-9840CDW supports PCL-6 emulation). The postscript driver has fewer settings, and is easy to set up, whereas the PCL-6 driver has more options, although it is more experimental (and doesn't support color). As of February 2009, the postscript driver always has color on by default, whereas the PCL-6 driver is always set to greyscale -- so you may want to add two printers, with one for each.<br />
<br />
==Setup with PostScript + Foomatic==<br />
<br />
The MFC-9840CDW natively supports the postscript format, so for basic printing functionality we'll be using the generic postscript driver that comes with the foomatic packages. (Again, it is recommended to download Brother's official .ppd file instead of using the generic ones as shown below.)<br />
<br />
* Install the '''cups''' package. Make sure it's working by going to http://localhost:631<br />
* Install the '''foomatic-db''', '''foomatic-db-engine''', and '''foomatic-filters''' packages (to get the generic postscript driver that we need).<br />
* Make sure the printer is connected to your network router/switch. If your router is acting as a DHCP server, the MFC-9840CDW will automatically get an IP address assigned. Make note of this IP address. (You could also assign a static IP address to your printer, but that is outside the scope of this article).<br />
* Go to http://localhost:631 to open up the CUPS web interface.<br />
* Click on the '''Administration''' tab and then click on '''Add printer.'''<br />
* Select the "Internet Printing Protocol (http)" option for the Device.<br />
* For the Device URI, use: '''http://IPADDRESSOFPRINTER:631/postscript_p1'''. E.g., '''http://192.168.0.102:631/postscript_p1'''<br />
* For the Make/Manufacturer, click on '''Generic''', then '''Generic PostScript Printer Foomatic/Postscript (en)''' (do not choose the "Level 1" variant, as it is an older postcript driver for older printers)<br />
* Click on '''Add Printer''' to finish the wizard.<br />
<br />
Print out a test page to see if everything works. The above configuration allows you to change the duplex and resolution (dpi) settings within CUPS, via the '''Set Printer Options''' button under the '''Printers''' tab, but is missing the "Toner save" option. Of course, this and all other settings are still accessible via the printer's own web interface, which makes any changes the default settings of the printer (see the official Brother documentation).<br />
<br />
==Setup with PCL-6 and Gutenprint==<br />
<br />
The MFC-9840CDW also natively supports (via emulation) the PCL-6 format, so we can take advantage of this feature. The procedure is essentially identical as with the postscript configuration above, except for a couple of things.<br />
<br />
* Install the '''gutenprint''' package.<br />
* Instead of '''postscript_p1''' in the Device URI field, use '''pcl_p1''' (the '''pcl''' has a lowercase 'L', not a numeral 'one').<br />
* Under For the Make/Manufacturer, click on '''Generic''' again, but instead choose the '''Generic PCL 6/PCL XL Printer - CUPS+Gutenprint v.5.2.3 (en)''' option. (The Gutenprint version number is dependant, of course, on which version of '''gutenprint''' you have installed.)<br />
<br />
Customize the default printer settings, to the extent that they are controlled by CUPS, by clicking on the '''Set Printer Options''' button in the CUPS web interface. You will notice that the Gutenprint driver has many more options than the generic PostScript driver. You may want to repeat the procedure above and add a second printer, and then customize this second printer's settings to your liking (e.g., color instead of greyscale).<br />
<br />
''Note: As there are many different PCL-6 drivers available, you may want to experiment with using these different ones instead of the CUPS+Gutenprint one. To change the driver, click on '''Modify Printer''' and go through the wizard, just like when you were adding the printer from the beginning.''</div>
Listdata
https://wiki.archlinux.org/index.php?title=Lightweight_Applications&diff=74208
Lightweight Applications
2009-08-19T20:15:54Z
<p>Listdata: /* Introduction */ grammar</p>
<hr />
<div>[[Category:Desktop user's guide (English)]]<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Lightweight Software}}<br />
{{i18n_entry|Русский|Выбор программ}}<br />
{{i18n_links_end}}<br />
<br />
== Introduction ==<br />
<br />
This list is in response to the plethora of posts in the forums asking for help finding lightweight software. Please feel free to add to it. Discussion can be made in the following [http://bbs.archlinux.org/viewtopic.php?pid=448593 thread]. For general list of recommended software (not necessarily lightweight) see [[Common Apps]].<br />
<br />
== Internet ==<br />
<br />
=== Browsers ===<br />
<br />
[http://www.dillo.org/ Dillo] is a small, fast graphical web browser built on FLTK (older versions use GTK+).<br />
<br />
[http://www.twotoasts.de/index.php?/pages/midori_summary.html Midori] is a lightweight web browser based on Gtk and WebKit. It passes the ACID3 test (midori-git/AUR).<br />
<br />
[http://code.google.com/p/arora/ Arora] is a simple cross platform web browser based on Qt (Webkit).<br />
<br />
[http://kazehakase.sourceforge.jp/ Kazehakase] is a GTK+ web browser that uses the Gecko rendering engine.<br />
<br />
[http://links.sourceforge.net/ Links-g] is a text WWW browser, similar to Lynx, with framebuffer and X graphics enabled.<br />
<br />
[http://elinks.or.cz/ ELinks] is a full featured text mode browser.<br />
<br />
[http://tkhtml.tcl.tk/hv3.html/ HV3] is an extremely fast and lightweight web browser with excellent rendering capabilities.<br />
<br />
[http://www.netsurf-browser.org Netsurf] has its own rendering engine, is written in C and is extremely lightweight.<br />
<br />
[http://uzbl.org uzbl] is a WebKit-based browser with VIM bindings that strictly follows the UNIX philosophy and provides all the functions (except the web browsing itself) via external scripts, using Bash, Zenity, and external tools, such as download management via Wget, ad block via /etc/hosts, etc. Almost everything can be user-defined.<br />
<br />
=== Email Clients ===<br />
<br />
[[mutt]] is a small but very powerful text-based mail client.<br />
<br />
[[alpine]] is another powerful, and user-friendly text-based mail and news client.<br />
<br />
[http://www.claws-mail.org/ Sylpheed Claws] is a lightweight and user-friendly e-mail client.<br />
<br />
[http://sup.rubyforge.org/ sup] is yet another powerful, text-based mail client; it is still under development.<br />
<br />
=== Instant Messengers ===<br />
<br />
[[Bitlbee]] is a way to use other IM to your [[#IRC]] client.<br />
<br />
[http://www.emesene.org/ emesene] is a Python/GTK+ instant messenger for the Windows Live Messenger network.<br />
<br />
[[Pidgin]] is a multiprotocol instant messenger.<br />
<br />
[http://pidgin.im Pidgin Light] is a light Pidgin version without gstreamer, tcl, tk, xscreensaver support.<br />
<br />
[http://developer.pidgin.im/wiki/Using%20Finch Finch] is a curses based version of Pidgin.<br />
<br />
=== IRC ===<br />
<br />
[http://irssi.org/ Irssi] is a modular text mode IRC client with Perl scripting.<br />
<br />
[http://lostirc.sourceforge.net LostIRC] is a simple IRC client.<br />
<br />
[http://weechat.flashtux.org/ WeeChat] is a fast, light & extensible curses-based IRC client.<br />
<br />
[http://xchat.org XChat] is a GTK+ X client with Perl and Python scripting support.<br />
<br />
[http://www.smuxi.org/ Smuxi] Lightweight GTK frontend inspired by irssi.<br />
<br />
[http://nenolod.net/ Conspire] Lightweight, simple, and powerfull.<br />
<br />
[http://tools.suckless.org/ii II] Ultimate lightweight, literally `tail -f` the convo and `echo` back your replies.<br />
<br />
=== Torrents ===<br />
<br />
[http://deluge-torrent.org/ Deluge] is a bittorrent client written with Python and PyGTK.<br />
<br />
[http://libtorrent.rakshasa.no/ rTorrent] is a very simple, elegant and ultra-light BitTorrent client. It is written in C++ and uses ncurses, so it is completely text based and runs entirely in a console.<br />
<br />
[http://www.transmissionbt.com/ Transmission] is a fast, easy, and free BitTorrent client (GTK+ GUI and CLI).<br />
<br />
== Multimedia ==<br />
<br />
=== Audio Players ===<br />
<br />
[http://cmus.sourceforge.net/ C* Music Player] is a very feature-rich ncurses-based music player.<br />
<br />
[http://moc.daper.net/ MOC (Music On Console)] is an ncurses console audio player with support for the MP3, Ogg, and WAV formats.<br />
<br />
[http://hem.bredband.net/kaw/ncmpc/ ncmpc] is a curses client for [[mpd]].<br />
<br />
[http://unkart.ovh.org/ncmpcpp/ ncmpcpp] is an almost exact clone of ncmpc with some new features.<br />
<br />
[http://sonata.berlios.de/ Sonata] is an elegant GTK+ music client for [[mpd]].<br />
<br />
[http://mask.tf.hut.fi/~flu/cplay/ cplay] is a curses front-end for various audio players.<br />
<br />
[http://ario-player.sourceforge.net/ Ario] is very feature-rich GTK2 client for [[mpd]], inspired by Rhythmbox<br />
<br />
=== Image Editors ===<br />
<br />
[http://mtpaint.sourceforge.net/ mtPaint] is a graphic editing program geared towards creating indexed palette images and pixel art.<br />
<br />
=== Image Viewers ===<br />
<br />
[http://linuxbrit.co.uk/feh/ Feh] is a fast, lightweight image viewer that uses imlib2.<br />
<br />
[http://lxde.sourceforge.net/gpicview/ GPicView] is a simple and fast image viewer for X. Made by the developers of [[LXDE]]<br />
<br />
[http://gqview.sourceforge.net/ GQview] is an image browser that features single click access to view images and move around the directory tree.<br />
<br />
[http://goodies.xfce.org/projects/applications/ristretto Ristretto] is a fast and lightweight picture-viewer for the Xfce desktop environment.<br />
<br />
[http://mirageiv.berlios.de Mirage] is a fast and simple GTK+ image viewer.<br />
<br />
[http://spiegl.de/qiv/ QIV] (Quick Image Viewer) is a very small and fast gdk/Imlib image viewer.<br />
<br />
=== Video Players ===<br />
<br />
[http://smplayer.sourceforge.net/ SMPlayer] is a complete frontend for [[MPlayer]].<br />
<br />
[http://kdekorte.googlepages.com/gnomemplayer Gnome-Mplayer] is a simple GTK-based GUI for [[MPlayer]] without heavy Gnome dependencies<br />
<br />
[http://www.videolan.org/vlc/ VLC] is a multi-platform video player that supports many audio and video formats out-of-the-box.<br />
<br />
== Office ==<br />
<br />
=== PDF Tools ===<br />
<br />
[http://www.emma-soft.com/projects/epdfview/ ePDFView] is a free lightweight PDF document viewer using Poppler and GTK+ libraries.<br />
<br />
[http://www.foolabs.com/xpdf/ Xpdf] is a viewer for Portable Document Format (PDF) files.<br />
<br />
[http://code.google.com/p/apvlv/ apvlv] is a lightweight PDF viewer with VIM key bindings.<br />
<br />
=== Text Editors ===<br />
<br />
[http://www.nongnu.org/beaver/ Beaver] is an Early AdVanced EditoR.<br />
<br />
[http://www.geany.org Geany] is a text editor using the GTK+ 2 toolkit with basic features of an integrated development environment.<br />
<br />
[http://tarot.freeshell.org/leafpad/ Leafpad] is a notepad clone for GTK+ 2.x that emphasizes simplicity.<br />
<br />
[http://mooedit.sourceforge.net/ medit] is intended to be a useful programming and around-programming text editor.<br />
<br />
[http://www.xfce.org/projects/mousepad/ Mousepad] is a simple text editor for Xfce based on Leafpad.<br />
<br />
[http://pyroom.org/ PyRoom] is a great distractionless PyGTK text editor, a clone of the infamous WriteRoom<br />
<br />
Vi, [[Vim]], gVim, the classic vi text editor.<br />
<br />
=== Word Processors ===<br />
<br />
[http://www.abisource.com/ Abiword] is a full-featured word processor ([[Abiword|HOWTO]]), there is also an even lighter version in the AUR, [http://aur.archlinux.org/packages.php?ID=25601/ Abiword-light].<br />
<br />
[http://txt2tags.sourceforge.net txt2tags] is a dead-simple, KISS-compliant lightweight, humane readable markup language to produce rich format content out of plain text files<br />
<br />
== System ==<br />
<br />
=== GUI Compression Tools ===<br />
<br />
[http://squeeze.xfce.org/ Squeeze] is a modern and advanced archive manager.<br />
<br />
[http://xarchive.sourceforge.net Xarchive] is a GTK+ 2 front-end for various command line archiving tools.<br />
<br />
[http://xarchiver.xfce.org/ Xarchiver] is a lightweight desktop independent archive manager built with GTK+ 2.<br />
<br />
=== File Managers ===<br />
<br />
[http://emelfm2.net/ emelFM2] is file manager that implements the popular two-pane design.<br />
<br />
[http://www.midnight-commander.org Midnight Commander] is a console-based, dual-paned, file manager.<br />
<br />
[http://pcmanfm.sourceforge.net/ PCManFM] is a lightweight file manager which features tabbed browsing.<br />
<br />
[http://rox.sourceforge.net ROX] is a small and fast file manager which can optionally manage the desktop background and panels.<br />
<br />
[http://thunar.xfce.org/ Thunar] is fast and responsive with a good start up time and directory load time.<br />
<br />
=== Monitors ===<br />
<br />
[http://conky.sourceforge.net/ Conky] is a lightweight, scriptable system monitor ([[Conky|HOWTO]]).<br />
<br />
[http://htop.sourceforge.net/ htop] is a simple, ncurses interactive process viewer.<br />
<br />
=== Panels ===<br />
<br />
[http://fbpanel.sourceforge.net fbpanel] is a lightweight, NETWM compliant desktop panel.<br />
<br />
[http://lxde.org LXPanel] is a lightweight X11 desktop panel (part of LXDE).<br />
<br />
[http://pypanel.sourceforge.net/ PyPanel] is a lightweight panel/taskbar written in Python and C ([[PyPanel|HOWTO]]).<br />
<br />
[http://code.google.com/p/tint2/ Tint] is a simple panel/taskbar intentionally made for openbox3, but should also work with other window managers ([[Tint|HOWTO]]).<br />
<br />
[http://nsf.110mb.com/bmpanel/ BMPanel] (BitMap Panel) is a lightweight, NETWM compliant panel for the X11 system.<br />
<br />
=== Login managers ===<br />
<br />
[[SLiM]] provides a lightweight and elegant graphical login solution.<br />
<br />
[[Qingy]] is ultralight and very configurable graphical login independent on X Windows.<br />
<br />
=== Window managers ===<br />
<br />
[[Dwm]] is an extra light dynamic window manager which is configured by directly editing the source(which itself is less than 2000 SLOC). <br />
<br />
[[Musca]] is a very lightweight window manager which has features from dwm and ratpoison. Uses about 350-400KB of memory.<br />
<br />
[[Subtle]] is a semi-automatic tiling window manager with a strong focus on easy but costomizable handling and look and feel.<br />
<br />
[[Xfce]] is a desktop environment much lighter but similar to GNOME. It includes the xfwm4 window manager.<br />
<br />
[[Fluxbox]] is a lightweight and highly configurable window manager.<br />
<br />
[[Openbox]] is another lightweight and highly configurable window manager.<br />
<br />
[[Awesome]] is a floating and tiling window manager initially based on a [[dwm]] code rewriting.<br />
<br />
[[PekWM]] is small and easily configurable window manager.<br />
<br />
[[Xmonad]] is a tiling window manager for X, written and configured in Haskell.<br />
<br />
[http://www.fvwm.org/ FVWM] is a lightweight, flexible and highly-configurable Window Manager.<br />
<br />
[[Evilwm]] is a minimalist floating window manager with an installed size of only 0.07 MB.<br />
<br />
[[Window Maker]] is an elegant, fast and usable OpenStep implementation.<br />
<br />
=== Terminals ===<br />
<br />
[http://software.schmorp.de/pkg/rxvt-unicode urxvt] is a highly extendable unicode enabled rxvt-clone terminal emulator featuring tabbing, url launching, quake-style dropdown, pseudo-transparency, and is extensible with perl.<br />
<br />
[http://lilyterm.luna.com.tw/index_en.html Lilyterm] is a light and easy to use libvte based X Terminal Emulator.<br />
<br />
[http://rox.sourceforge.net ROXTerm] is a tabbed, VTE-based terminal emulator with a small footprint.<br />
<br />
[http://www.pleyades.net/david/sakura.php Sakura] is a terminal emulator based on GTK+ and VTE.<br />
<br />
=== Trays ===<br />
<br />
[http://icculus.org/openbox/2/docker/ Docker] is a docking application which acts as a system tray.<br />
<br />
[http://stalonetray.sourceforge.net Stalonetray] is a stand-alone system tray.<br />
<br />
[http://gna.org/projects/fvwm-crystal/ Trayer] swallows GTK+ 1.2/2.x application docklets, and KDE docklets.</div>
Listdata
https://wiki.archlinux.org/index.php?title=Brother_MFC-9840CDW&diff=74206
Brother MFC-9840CDW
2009-08-19T20:13:45Z
<p>Listdata: Brother has released an official .ppd file, and this is the new recommended way to set up the printer</p>
<hr />
<div>[[Category:Printers_(English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
=Introduction=<br />
<br />
This is a small tutorial to make the printer Brother MFC-9840CDW work on Arch, through a wired (ethernet cable) network connection.<br />
<br />
Brother released an official .ppd (postscript printer description) file on June 24, 2009. It is available from [http://solutions.brother.com/linux/en_us/download_prn.html#MFC-9840CDW]. This .ppd file lets you change essential printer settings such as color/mono in the application's dialog box (such as Firefox), and is thus recommended over the previous method of using generic printer drivers.<br />
<br />
=Setup with PostScript + Brother's Official .ppd file=<br />
<br />
'''TIP: You can add multiple versions of the MFC-9840CDW by repeating the steps below, and then for each version, changing the printer settings with the ''Set Printer Options'' button in CUPS. This way, you can quickly set up default settings that you use often (e.g., color vs. greyscale), and then print with these options by simply selecting the corresponding printer in your application (instead of using the application-specific printer dialog box each time you want to print using non-default settings).'''<br />
<br />
* Install the '''cups''' package. Make sure it's working by going to http://localhost:631<br />
* Download Brother's official .ppd file from [http://solutions.brother.com/linux/en_us/download_prn.html#MFC-9840CDW].<br />
* Make sure the printer is connected to your network router/switch. If your router is acting as a DHCP server, the MFC-9840CDW will automatically get an IP address assigned. Make note of this IP address. (You could also assign a static IP address to your printer, but that is outside the scope of this article).<br />
* Go to http://localhost:631 to open up the CUPS web interface.<br />
* Click on the '''Administration''' tab and then click on '''Add printer.'''<br />
* Select the "Internet Printing Protocol (http)" option for the Device.<br />
* For the Device URI, use: '''http://IPADDRESSOFPRINTER:631/postscript_p1'''. E.g., '''http://192.168.0.102:631/postscript_p1'''<br />
* For the Make/Manufacturer, provide the official .ppd file that you downloaded.<br />
* Click on '''Add Printer''' to finish the wizard.<br />
<br />
Make sure to modify the default settings, such as page size (change this to letter, if you are not using A4 paper), auto/color/mono for color settings, as well as duplex mode (DuplexTumble is short-edge duplex, and DuplexNoTumble is long-edge.)<br />
<br />
=Old Method=<br />
<br />
Additionally, you can set it up with either the generic postscript drivers, or PCL-6 drivers with gutenprint (as the MFC-9840CDW supports PCL-6 emulation). The postscript driver has fewer settings, and is easy to set up, whereas the PCL-6 driver has more options, although it is more experimental (and doesn't support color). As of February 2009, the postscript driver always has color on by default, whereas the PCL-6 driver is always set to greyscale -- so you may want to add two printers, with one for each.<br />
<br />
==Setup with PostScript + Foomatic==<br />
<br />
The MFC-9840CDW natively supports the postscript format, so for basic printing functionality we'll be using the generic postscript driver that comes with the foomatic packages. (Again, it is recommended to download Brother's official .ppd file instead of using the generic ones as shown below.)<br />
<br />
* Install the '''cups''' package. Make sure it's working by going to http://localhost:631<br />
* Install the '''foomatic-db''', '''foomatic-db-engine''', and '''foomatic-filters''' packages (to get the generic postscript driver that we need).<br />
* Make sure the printer is connected to your network router/switch. If your router is acting as a DHCP server, the MFC-9840CDW will automatically get an IP address assigned. Make note of this IP address. (You could also assign a static IP address to your printer, but that is outside the scope of this article).<br />
* Go to http://localhost:631 to open up the CUPS web interface.<br />
* Click on the '''Administration''' tab and then click on '''Add printer.'''<br />
* Select the "Internet Printing Protocol (http)" option for the Device.<br />
* For the Device URI, use: '''http://IPADDRESSOFPRINTER:631/postscript_p1'''. E.g., '''http://192.168.0.102:631/postscript_p1'''<br />
* For the Make/Manufacturer, click on '''Generic''', then '''Generic PostScript Printer Foomatic/Postscript (en)''' (do not choose the "Level 1" variant, as it is an older postcript driver for older printers)<br />
* Click on '''Add Printer''' to finish the wizard.<br />
<br />
Print out a test page to see if everything works. The above configuration allows you to change the duplex and resolution (dpi) settings within CUPS, via the '''Set Printer Options''' button under the '''Printers''' tab, but is missing the "Toner save" option. Of course, this and all other settings are still accessible via the printer's own web interface, which makes any changes the default settings of the printer (see the official Brother documentation).<br />
<br />
==Setup with PCL-6 and Gutenprint==<br />
<br />
The MFC-9840CDW also natively supports (via emulation) the PCL-6 format, so we can take advantage of this feature. The procedure is essentially identical as with the postscript configuration above, except for a couple of things.<br />
<br />
* Install the '''gutenprint''' package.<br />
* Instead of '''postscript_p1''' in the Device URI field, use '''pcl_p1''' (the '''pcl''' has a lowercase 'L', not a numeral 'one').<br />
* Under For the Make/Manufacturer, click on '''Generic''' again, but instead choose the '''Generic PCL 6/PCL XL Printer - CUPS+Gutenprint v.5.2.3 (en)''' option. (The Gutenprint version number is dependant, of course, on which version of '''gutenprint''' you have installed.)<br />
<br />
Customize the default printer settings, to the extent that they are controlled by CUPS, by clicking on the '''Set Printer Options''' button in the CUPS web interface. You will notice that the Gutenprint driver has many more options than the generic PostScript driver. You may want to repeat the procedure above and add a second printer, and then customize this second printer's settings to your liking (e.g., color instead of greyscale).<br />
<br />
''Note: As there are many different PCL-6 drivers available, you may want to experiment with using these different ones instead of the CUPS+Gutenprint one. To change the driver, click on '''Modify Printer''' and go through the wizard, just like when you were adding the printer from the beginning.''</div>
Listdata
https://wiki.archlinux.org/index.php?title=Newcomers_Guide&diff=69647
Newcomers Guide
2009-05-30T04:13:08Z
<p>Listdata: /* /etc/hosts.deny and /etc/hosts.allow */ limit sshd to a local LAN address</p>
<hr />
<div>[[Category:Getting and installing Arch (English)]]<br />
[[Category:About Arch (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
{{Article summary start}}<br />
{{Article summary text|Provides a highly detailed, explanatory guide to installing, configuring and using a full-featured Arch Linux system.}}<br />
{{Article summary heading|Available Languages}}<br />
{{i18n_entry|Česky|Průvodce začátečníka (Česky)}}<br />
{{i18n_entry|简体中文|Arch 新手安装指南 (简体中文)}}<br />
{{i18n_entry|正體中文|Beginner's Guide 新手指南}}<br />
{{i18n_entry|Dansk|Dansk_Begynderguide}}<br />
{{i18n_entry|Deutsch|Beginners Guide (Deutsch)}}<br />
{{i18n_entry|English|Beginners Guide}}<br />
{{i18n_entry|Español|Guía para Principiantes (Español)}}<br />
{{i18n_entry|Français|Manuel_du_Débutant_(Français)}}<br />
{{i18n_entry|Italiano|Beginners Guide (Italiano)}}<br />
{{i18n_entry|Indonesia|Beginners_Guide_(Indonesia)}}<br />
{{i18n_entry|Lietuviškai|Pradedančiųjų gidas (Lietuviškai)}}<br />
{{i18n_entry|Nederlands|Beginners_Guide_(Nederlands)}}<br />
{{i18n_entry|Português Brasil|Guia do Iniciante(Português do Brasil)}}<br />
{{i18n_entry|Português|Guia para Principiantes(Português)}}<br />
{{i18n_entry|Русский|Руководство_для_новичков}}<br />
{{i18n_entry|Türkçe|Başlangıç Rehberi (Türkçe)}}<br />
{{i18n_entry|हिन्दी|नौसिखिया गाइड(हिन्दी)}}<br />
{{Article summary heading|Related articles}}<br />
{{Article summary wiki|Official Arch Linux Install Guide}} (provides a more general approach)<br />
{{Article summary wiki|Beginners Guide Appendix}}<br />
{{Article summary wiki|Post Installation Tips}}<br />
{{Article summary end}}<br />
==Preface==<br />
=====Everything you ever wanted to know about Arch, but were afraid to ask=====<br />
Welcome. This self-contained document will guide you through the process of installing and configuring [[Arch Linux]]; a simple, agile and lightweight GNU/Linux distribution, <code>UNIX</code>-like operating system. Arch Linux requires a certain level of intimate knowledge of its configuration and of <code>UNIX</code>-like system methodology and for this reason, extra explanatory information is included. This guide is aimed at new Arch users, but strives to serve as a strong reference and informative base for all.<br />
<br />
'''Arch Linux distribution highlights:'''<br />
* '''[[The Arch Way | Simple]]''' design and philosophy<br />
* Independently Developed Community distro built from scratch and targeted at competent GNU/Linux users<br />
* All packages compiled for '''i686/x86-64'''<br />
* Highly customizable system assembled by the user from the ground up<br />
* '''[[The Arch boot process | BSD-style init]]''' scripts, featuring one centralized configuration file<br />
* '''mkinitcpio''': a simple and dynamic initramfs creator <br />
* '''Rolling Release''' model<br />
* '''[[Pacman]]''' package manager is fast, written in '''C''', lightweight and agile, with a very modest memory footprint<br />
* '''[[ABS]]''': The '''A'''rch '''B'''uild '''S'''ystem, a ports-like package building system makes it simple to create your own easily installable Arch packages from source, to use and/or share with the community on the [[AUR]]<br />
* '''[[AUR]]''': The Arch User Repository, offering many thousands of build scripts for Arch user-provided software packages<br />
<br />
=====DON'T PANIC!=====<br />
The Arch Linux system is assembled by the ''user'', from the shell, using basic command line tools. This is '''[[The Arch Way]].''' Unlike the more rigid structures of other distributions and installers, there are no default environments nor configurations chosen for you. From the command line, ''you'' will add packages from the Arch repositories using the [[pacman]] tool via your internet connection and manually configure your installation by editing text files until your system is customized to your requirements. You will also manually add non-root user(s) and manage groups and permissions. This method allows for maximum flexibility, choice, and system resource control ''from the base up''.<br />
<br />
Arch Linux is aimed at competent GNU/Linux users who desire minimal 'code separation' from their machine.<br />
<br />
=====License=====<br />
<br />
Arch Linux, pacman, documentation, and scripts are copyright<br />
©2002-2007 by Judd Vinet, ©2007-2009 by Aaron Griffin and are licensed under the GNU General Public License Version 2.<br />
=====[[The Arch Way]]=====<br />
<br />
'''''The design principles behind Arch are aimed at keeping it [[The Arch Way|simple]].'' '''<br />
<br />
'Simple', in this context, shall mean 'without unnecessary additions, modifications, or complications'. In short; an elegant, minimalist approach.<br />
<br />
'''Some thoughts to keep in mind:'''<br />
<br />
*''&quot; 'Simple' is defined from a technical standpoint, not a usability standpoint. It is better to be technically elegant with a higher learning curve, than to be easy to use and technically [inferior].&quot; -Aaron Griffin''<br />
*''Entia non sunt multiplicanda praeter necessitatem'' or &quot;Entities should not be multiplied unnecessarily.&quot; -Occam's razor. The term ''razor'' refers to the act of shaving away unnecessary complications to arrive at the simplest explanation, method or theory.<br />
*''&quot;The extraordinary part of [my method] lies in its simplicity..The height of cultivation always runs to simplicity.&quot;'' - Bruce Lee<br />
<br />
=====About This Guide=====<br />
<br />
The Arch wiki is an excellent resource and should be consulted for issues [http://wiki.archlinux.org/index.php/Main_Page first]; IRC (freenode #archlinux), and the [http://bbs.archlinux.org/ forums] are also available if the answer cannot be found.<br />
<br />
{{Note|Following this guide closely is essential in order to successfully install a properly configured Arch Linux system, so ''please'' read it thoroughly. It is strongly recommended you read each section completely before carrying out the tasks contained.}}<br />
<br />
Since GNU/Linux Distributions are fundamentally 'modular' by design, the guide is logically divided into 4 main components of a desktop <code>UNIX</code>-like operating system: <br />
<br />
'''[[#Part I: Install the Base System|Part I: Installing the Base system]]'''<br />
<br />
'''[[#Part II: Configure&Update the New Arch Linux base system|Part II: Configure&Update the New Arch Linux base system]]'''<br />
<br />
'''[[#Part III: Install X and configure ALSA|Part III: Installing X and configuring ALSA]]'''<br />
<br />
'''[[#Part IV: Installing and configuring a Desktop Environment|Part IV: Installing a Desktop Environment]]'''<br />
<br />
<br />
'''''Welcome to Arch! Enjoy the installation; take your time and have fun!'''''<br />
<br />
'''''Now, let's get started....'''''<br />
<br />
==Part I: Install the Base System==<br />
<br />
===Step 1: Obtain the latest Installation media ===<br />
<br />
You can obtain Arch's official installation media from [http://archlinux.org/download/ here]. The latest version is 2009.02 <br />
<br />
*Both the Core installer and the FTP/HTTP-downloads provide only the necessary packages to create an '''Arch Linux base system'''. ''Note that the Base System does not include a GUI. It is mainly comprised of the GNU toolchain, (compiler, assembler, linker, libraries, shell, and a few useful utilities) the Linux kernel, and a few extra libraries and modules.''<br />
*The isolinux images are provided for people who experience trouble using the grub version. There are no other differences.<br />
<br />
====CD installer====<br />
Burn the .iso to a CD with your preferred burner, and continue with [[#Boot Arch Linux Installer | Boot Arch Linux Installer]]<br />
{{Box Note| Optical drives as well as CD media quality vary greatly, but generally, using a slow burn speed is recommended for reliable burns; Some users recommend speeds '''''as low as 4x or 2x.''''' If you are experiencing unexpected behavior from the CD, try burning at the minimum speed supported by your system. }}<br />
<br />
====USB stick====<br />
{{Warning|This will destroy all data on your USB stick.}}<br />
<br />
Insert an empty or expendable USB stick, determine its path, and dump the .img to the USB stick with the <code>/bin/dd</code> program:<br />
dd if=archlinux-2009.02-[core_or_ftp]-i686.img of=/dev/sd''x''<br />
where ''if='' is the path to the img file and ''of='' is your USB device. Make sure to use /dev/sd''x'' and not /dev/sd''x1''.<br />
<br />
'''Check md5sum (optional):'''<br />
<br />
Make a note of the number of records (blocks) read in and written out, then perform the following check:<br />
dd if=/dev/sd''x'' count=''number_of_records'' status=noxfer | md5sum<br />
The md5sum returned should match the md5sum of the downloaded archlinux image file; they both should match the md5sum of the image as listed in the md5sums file in the mirror distribution site.<br />
<br />
Continue with [[#Boot Arch Linux Installer | Boot Arch Linux Installer]]<br />
<br />
===Step 2: Boot Arch Linux Installer===<br />
Insert the CD or USB stick and boot from it. You may have to<br />
change the boot order in your computer BIOS or press a key (usually DEL, F1, F2, F11 or F12) during the BIOS POST phase.<br />
<br />
Memory requirements:<br />
<br />
* CORE : 160 MB RAM x86_64/i686 (all packages selected, with swap partition)<br />
* FTP : 160 MB RAM x86_64/i686 (all packages selected, with swap partition)<br />
<br />
Choose Boot Archlive or Boot Archlive [legacy IDE] if you have trouble with libata/PATA.<br />
<br />
To change boot options press '''e''' for editing the boot lines. Many users may wish to change the resolution of the framebuffer, for more readable console output. Append:<br />
vga=773<br />
to the kernel line, followed by <ENTER>, for a 1024x768 framebuffer.<br />
<br />
Hit '''b''' to boot.<br />
<br />
The system will now boot and present a login prompt. Login as 'root' without quotes.<br />
<br />
====Changing the keymap====<br />
If you have a non-US keyboard layout you can interactively choose your keymap/console font with the command:<br />
# km<br />
or use the loadkeys command:<br />
# loadkeys ''layout''<br />
(replace ''layout'' with your keyboard layout such as &quot;<code>fr</code>&quot; or &quot;<code>be-latin1</code>&quot;)<br />
<br />
====Documentation====<br />
The official install guide is available on the live system. The official guide covers installation and configuration of the base system only. Change to vc/2 with <ALT>+F2 and invoke <code>/usr/bin/less</code>:<br />
# less /arch/arch-linux-official-guide.txt<br />
<code>less</code> will allow you to page through the document. Change back to vc/1 with <ALT>+F1.<br />
<br />
Change back to vc/2 if you need to reference the Official Guide at any time.<br />
<br />
===Step 3: Start the Installation===<br />
As root, run the installer script from vc/1:<br />
# /arch/setup<br />
<br />
===A: Select an installation source===<br />
After a welcome screen, you will be prompted for an installation source. Choose the appropriate source for the installer you are using.<br />
* If you chose the CORE installer, continue below with [[#Prepare Hard Drive|Prepare Hard Drive]].<br />
* FTP/HTTP only: You shall be prompted to load ethernet drivers manually, if desired. Udev is quite effective at loading the required modules, so you may assume it has already done so. You may verify this by invoking ifconfig -a from vc/3. (Select OK to continue.)<br />
<br />
====Configure Network (FTP/HTTP)====<br />
Available Interfaces will be presented. If an interface and HWaddr ('''H'''ard'''W'''are '''addr'''ess) is listed, then your module has already been loaded. If your interface is not listed, you may probe it from the installer, or manually do so from another virtual console.<br />
<br />
The following screen will prompt you to ''Select the interface, Probe,'' or ''Cancel''. Choose the appropriate interface and continue.<br />
<br />
The installer will then ask if you wish to use DHCP. Choosing Yes will run '''dhcpcd''' to discover an available gateway and request an IP address; Choosing No will prompt you for your static IP, netmask, broadcast, gateway DNS IP, HTTP proxy, and FTP proxy. Lastly, you will be presented with an overview to ensure your entries are correct.<br />
<br />
=====Wireless Quickstart For the Live Environment (If you need wireless connectivity during the installation process)=====<br />
<br />
The wireless drivers and utilities are now available to you in the live environment of the installation media. A good knowledge of your wireless hardware will be of key importance to successful configuration. Note that the following quickstart procedure will initialize your wireless hardware for use ''in the live environment''.<br />
<br />
The basic procedure will be:<br />
* Switch to a free virtual console, e.g.: <ALT>+F3<br />
* Ensure udev has loaded the driver, and that the driver has created a usable wireless kernel interface with <code>/usr/sbin/iwconfig</code>:<br />
# iwconfig<br />
(Output should show an available wireless interface)<br />
* Bring the interface up with <code>/sbin/ifconfig <interface> up</code>.<br />
An example, using an atheros card and madwifi driver:<br />
# ifconfig ath0 up<br />
(Remember, your interface may be named something else, depending on your module (driver) and chipset: wlan0, eth1, etc.)<br />
* Specify the id of the wireless network with iwconfig <interface> essid &quot;<youressid>&quot; key <yourwepkey> (give the essid (the 'network name') of the network in quotes). <br />
* An example using WEP:<br />
# iwconfig ath0 essid &quot;linksys&quot; key 0241baf34c<br />
* An example using an unsecured network:<br />
# iwconfig ath0 essid "linksys"<br />
* Request and acquire an IP address with <code>/sbin/dhcpcd <interface> </code>. e.g.:<br />
# dhcpcd ath0<br />
* Ensure you can route using <code>/bin/ping</code>:<br />
# ping -c 3 www.google.com<br />
Done.<br />
{{Box Note | '''''In addition to the wireless module, some wireless chipsets, like ipw2100 and ipw2200, require corresponding firmware installation. The firmware packages must be explicitly installed to your actual system to provide wireless functionality after you reboot into your installed system. (Due to the firmware installation requirement, these chipsets may not work in the live environment.) Package selection and installation is covered below. Ensure installation of both your wireless module and firmware during the package selection step! See [[Wireless Setup]] if you are unsure about the requirement of corresponding firmware installation for your particular chipset. This is a very common error.'''''}}<br />
<br />
After the initial Arch installation is complete, you may wish to refer to [[Wireless Setup]] to ensure a permanent configuration solution for your installed system.<br />
<br />
Return to vc/1 with <ALT>+F1. Continue with [[#Prepare Hard Drive|Prepare Hard Drive]]<br />
<br />
===B: Set Clock===<br />
* UTC<br />
* local<br />
<br />
===C: Prepare Hard Drive===<br />
<br />
{{Warning|Partitioning hard drives can destroy data. You are strongly cautioned and advised to backup your critical data if applicable.}}<br />
<br />
Verify your current disk identities and layout by invoking <code>/sbin/fdisk</code> with the <code>-l</code> (lower-case L) switch.<br />
<br />
Open another virtual console (<ALT>+F3) and enter:<br />
# fdisk -l<br />
Take note of the disk(s)/partition(s) you wish to utilize for your Arch installation.<br />
<br />
Switch back to the installation script with <ALT>+F1<br />
<br />
Select the first menu entry &quot;Prepare Hard Drive&quot;.<br />
* Option 1: Auto Prepare<br />
Auto-Prepare divides your disk into the following configuration:<br />
<br />
* ext2 /boot partition, default size 32MB. ''You will be prompted to modify the size to your requirement.''<br />
* swap partition, default size 256MB. ''You will be prompted to modify the size to your requirement.''<br />
* A Separate / and /home partition, (sizes can also be specified). You may choose from ext2, ext3, ext4, reiserfs, xfs and jfs, but note that ''both / and /home shall share the same fs type'' if choosing the Auto Prepare option.<br />
<br />
Be warned that Auto-prepare will completely erase the chosen hard drive. Read the <font color=&quot;red&quot;>warning</font> presented by the installer very carefully, and make sure the correct device is about to be partitioned.<br />
<br />
* Option 2: '''(Recommended)''' Partition Hard Drives (with cfdisk)<br />
<br />
This option will allow for the most robust and customized partitioning solution for your personal needs.<br />
<br />
''At this point, more advanced GNU/Linux users who are familiar and comfortable with manually partitioning may wish to skip down to '''[[#C: Select Packages|Select Packages]]''' below.''<br />
<br />
{{Box Note|If you plan to install onto a USB flash key, see [[Installing_Arch_Linux_on_a_USB_key]].}}<br />
<br />
====Partition Hard Drives====<br />
<br />
=====Partition Info=====<br />
<br />
Partitioning a hard disk drive defines specific areas (the partitions) within the disk, that will each appear and behave as a separate disk and upon which a filesystem may be created (formatted).<br />
*There are 3 types of disk partitions:<br />
#Primary<br />
#Extended<br />
#Logical<br />
'''Primary''' partitions can be bootable, and are limited to 4 partitions per disk or raid volume. If a partitioning scheme requires more than 4 partitions, we are forced to use an '''extended''' partition which will contain '''logical''' partitions.<br />
<br />
Extended partitions are not usable by themselves; they are merely a &quot;container&quot; for logical partitions. If required, a hard disk shall contain only one extended partition; which shall then be sub-divided into logical partitions.<br />
<br />
When partitioning a disk, one can observe this numbering scheme by creating primary partitions sda1-3 followed by creating an extended partition, sda4, and subsequently creating logical partition(s) within the extended partition; sda5, sda6, and so on.<br />
<br />
=====Swap Partition=====<br />
A swap partition is a place on your hard drive where virtual ram resides, allowing the kernel to easily use disk storage for data that does not fit into physical RAM.<br />
<br />
Historically, the general rule for swap partition size was 2x the amount of physical RAM. Over time, as computers have gained ever larger memory capacities, this rule has become increasingly deprecated. Generally, on machines with up to 512MB RAM, the 2x rule is usually quite sufficient. On machines with 1GB RAM, generally a 1x rule is adequate. If you have gratuitous amounts of RAM (more than 1024 MB) it may be possible to completely forget a swap partition altogether, though this is not recommended. We will create a 1 GB swap partition in this example.<br />
{{Box Note|If you plan on using suspend-to-disk, (hibernate) you must have a swap partition at least '''equal''' in size to the amount of physical RAM, and some Arch users even recommend oversizing it beyond the amount of physical RAM by 10-15%, to allow for possible bad sectors.}}<br />
<br />
=====Partition Scheme=====<br />
A disk partitioning scheme is a very personalized preference. Each user's choices will be unique to their own computing habits and requirements.<br />
<br />
Filesystem candidates for separate partitions include:<br />
<br />
'''/''' (root) ''The root filesystem is the primary filesystem from which all other filesystems stem; the top of the hierarchy. All files and directories appear under the root directory &quot;/&quot;, even if they are stored on different physical devices. The contents of the root filesystem must be adequate to boot, restore, recover, and/or repair the system.''<br />
<br />
'''/boot''' ''This directory contains the kernel and ramdisk images as well as the bootloader configuration file, and bootloader stages. /boot also stores data that is used before the kernel begins executing userspace programs. This may include saved master boot sectors and sector map files.''<br />
<br />
'''/home''' ''User data and user specific configuration files for applications are stored in each user's home directory in a file that starts with the '.' character (a &quot;dot file&quot;).''<br />
<br />
'''/usr''' ''While root is the primary filesystem, /usr is the secondary hierarchy, for user data, containing the majority of (multi-)user utilities and applications. /usr is shareable, read-only data. This means that /usr shall be shareable between various hosts and must not be written to, except in the case of system update/upgrade. Any information that is host-specific or varies with time is stored elsewhere.''<br />
<br />
'''/tmp''' ''directory for programs that require temporary files''<br />
<br />
'''/var''' ''contains variable data; spool directories and files, administrative and logging data, pacman's cache, the ABS tree, etc.''<br />
{{Box Note | Besides /boot, directories essential for booting are: '/bin', '/dev', '/etc', '/lib', '/proc' and '/sbin'. Therefore, they must not reside on a separate partition from /.}}<br />
'''''There are several advantages for using discrete filesystems, rather than combining all into one partition''''':<br />
<br />
* Security: Each filesystem may be configured in /etc/fstab as 'nosuid', 'nodev', 'noexec', 'readonly', etc.<br />
* Stability: A user, or malfunctioning program can completely fill a filesystem with garbage if they have write permissions for it. Critical programs, which reside on a different filesystem remain unaffected.<br />
* Speed: A filesystem which gets written to frequently may become somewhat fragmented. (An effective method of avoiding fragmentation is to ensure that each filesystem is never in danger of filling up completely.) Separate filesystems remain unaffected, and each can be defragmented separately as well.<br />
* Integrity: If one filesystem becomes corrupted, separate filesystems remain unaffected.<br />
* Versatility: Sharing data across several systems becomes more expedient when independent filesystems are used. Separate filesystem types may also be chosen based upon the nature of data and usage.<br />
In this example, we shall use separate partitions for /, /var, /home, and a swap partition.<br />
<br />
{{Box Note | /var contains many small files. You may wish to take this into consideration when choosing a filesystem type for it, (if you choose to create its own separate partition).}}<br />
<br />
=====How big should my partitions be?=====<br />
This question is best answered based upon individual needs.<br />
You may wish to simply create '''one partition for root and one partition for swap or only one root partition without swap''' or you may follow the following examples closely and consider these guidelines to provide a frame of reference:<br />
* The root filesystem (/) in the example will contain the /usr directory, which can become moderately large, depending upon how much software is installed.<br />
<br />
* The /var filesystem will contain, among other data, the [[ABS]] tree and the pacman cache. Keeping cached packages is useful and versatile; it provides the ability to downgrade packages if needed. /var tends to grow in size; the pacman cache can grow large over long periods of time, but can be safely cleared if needed. 6-8 Gigs on a desktop system should therefore be sufficient for /var. Servers tend to have extremely large /var filesystems.<br />
* The /home filesystem is typically where user data, downloads, and multimedia reside. On a desktop system, /home is typically the largest filesystem on the drive by a large margin.<br />
* An extra 25% of space added to each filesystem will provide a cushion for unforeseen occurrence, expansion, and serve as a preventive against fragmentation.<br />
'''''From the guidelines above, the example system shall contain a ~15GB root (/) partition, ~7GB /var, 1GB swap, and a /home containing the remaining disk space.'''''<br />
<br />
=====Create Partition:cfdisk=====<br />
Start by creating the primary partition that will contain the '''root''', (/) filesystem.<br />
<br />
Choose '''N'''ew -> Primary and enter the desired size for root (/). Put the partition at the beginning of the disk.<br />
<br />
Also choose the '''T'''ype by designating it as '83 Linux'. The created / partition shall appear as sda1 in our example.<br />
<br />
Now create a primary partition for /var, designating it as '''T'''ype 83 Linux. The created /var partition shall appear as sda2<br />
<br />
Next, create a partition for swap. Select an appropriate size and specify the '''T'''ype as 82 (Linux swap / Solaris). The created swap partition shall appear as sda3.<br />
<br />
Lastly, create a partition for your /home directory. Choose another primary partition and set the desired size.<br />
<br />
Likewise, select the '''T'''ype as 83 Linux. The created /home partition shall appear as sda4.<br />
<br />
Example:<br />
<br />
Name Flags Part Type FS Type [Label] Size (MB)<br />
-------------------------------------------------------------------------<br />
sda1 Primary Linux 15440 #root<br />
sda2 Primary Linux 6256 #/var<br />
sda3 Primary Linux swap / Solaris 1024 #swap<br />
sda4 Primary Linux 140480 #/home<br />
<br />
Choose '''W'''rite and type ''''yes''''. Beware that this operation may destroy data on your disk. Choose '''Q'''uit to leave the partitioner.<br />
Choose Done to leave this menu and continue with &quot;Set Filesystem Mountpoints&quot;.<br />
<br />
{{Box Note | Since the latest developments of the Linux kernel which include the libata and PATA modules, all IDE, SATA and SCSI drives have adopted the sd''x'' naming scheme. This is perfectly normal and should not be a concern.}}<br />
<br />
====Set Filesystem Mountpoints====<br />
First you will be asked for your swap partition. Choose the appropriate partition (sda3 in this example). You will be asked if you want to create a swap filesystem; select yes. Next, choose where to mount the / (root) directory (sda1 in the example). At this time, you will be asked to specify the filesystem type.<br />
<br />
=====Filesystem Types=====<br />
Again, a filesystem type is a very subjective matter which comes down to personal preference. Each has its own advantages, disadvantages, and unique idiosyncrasies. Here is a very brief overview of supported filesystems:<br />
<br />
1. '''ext2''' ''Second Extended Filesystem''- Old, reliable GNU/Linux filesystem. Very stable, but ''without journaling support''. May be inconvenient for root (/) and /home, due to very long fsck's. ''An ext2 filesystem can easily be converted to ext3.'' Generally regarded as a good choice for /boot/.<br />
<br />
2. '''ext3''' ''Third Extended Filesystem''- Essentially the ext2 system, but with journaling support. ext3 is completely compatible with ext2. ''Extremely'' stable, mature, and by far the most widely used, supported and developed GNU/Linux FS.<br />
<br />
'''High Performance Filesystems:'''<br />
<br />
3. '''ext4''' ''Fourth Extended Filesystem''- Backward compatible with ext2 and ext3, Introduces support for volumes with sizes up to 1 exabyte and files with sizes up to 16 terabyte. Increases the 32,000 subdirectory limit in ext3 to 64,000. Offers online defragmentation ability. <br />
{{Box Note | ext4 is a new filesystem and may have some bugs.}}<br />
<br />
4. '''ReiserFS''' (V3)- Hans Reiser's high-performance journaling FS uses a very interesting method of data throughput based on an unconventional and creative algorithm. ReiserFS is touted as very fast, especially when dealing with many small files. ReiserFS is fast at formatting, yet comparatively slow at mounting. Quite mature and stable. ReiserFS is not actively developed at this time (Reiser4 is the new Reiser filesystem). Generally regarded as a good choice for /var/.<br />
<br />
5. '''JFS''' - IBM's '''J'''ournaled '''F'''ile'''S'''ystem- The first filesystem to offer journaling. JFS had many years of use in the IBM AIX® OS before being ported to Linux. JFS currently uses the least CPU resources of any GNU/Linux filesystem. Very fast at formatting, mounting and fsck's, and very good all-around performance, especially in conjunction with the deadline I/O scheduler. (See [[JFS]].) Not as widely supported as ext or ReiserFS, but very mature and stable.<br />
<br />
6. '''XFS''' - Another early journaling filesystem originally developed by Silicon Graphics for the IRIX OS and ported to Linux. XFS offers very fast throughput on large files and large filesystems. Very fast at formatting and mounting. Generally benchmarked as slower with many small files, in comparison to other filesystems. XFS is very mature and offers online defragmentation ability.<br />
* JFS and XFS filesystems cannot be ''shrunk'' by disk utilities (such as gparted or parted magic)<br />
<br />
===== A note on Journaling=====<br />
All above filesystems, except ext2, use [http://en.wikipedia.org/wiki/Journaling_file_system journaling]. Journaling file systems are fault-resilient file systems that use a journal to log changes before they are committed to the file system to avoid metadata corruption in the event of a crash. Note that not all journaling techniques are alike; specifically, only ext3 and ext4 offer ''data-mode journaling'', (though, not by default), which journals ''both'' data ''and'' meta-data (but with a significant speed penalty). The others only offer ''ordered-mode journaling'', which journals meta-data only. While all will return your filesystem to a valid state after recovering from a crash, ''data-mode journaling'' offers the greatest protection against file system corruption and data loss but can suffer from performance degradation, as all data is written twice (first to the journal, then to the disk). Depending upon how important your data is, this may be a consideration in choosing your filesystem type.<br />
<br />
'''''Moving on...'''''<br />
<br />
Choose and create the filesystem (format the partition) for / by selecting '''yes'''. You will now be prompted to add any additional partitions. In our example, sda2 and sda4 remain. For sda2, choose a filesystem type and mount it as /var. Finally, choose the filesystem type for sda4, and mount it as /home. Return to main menu.<br />
<br />
===D: Select Packages===<br />
<br />
Now we shall select packages to install in our system.<br />
*Core ISO: Choose CD as source and select the appropriate CD drive if you have more than one.<br />
*FTP ISO: Select an FTP/HTTP mirror. ''Note that archlinux.org is throttled to 50KB/s''.<br />
<br />
Package selection is split into two stages. First, select the package category:<br />
{{Box Note | For expedience, all packages in '''base''' are selected by default}}<br />
* '''Base''': The minimal base environment. ''Always select it and only remove packages that you don't use.''<br />
* '''Base-devel''': Extra tools such as '''make''', '''automake''' and '''wireless-tools''' as well as wireless firmwares. ''It's a good idea to install it, you will need it later.<br />
''<br />
After category selection, you will be presented with the full lists of packages, allowing you to fine-tune your selections. Use the space bar to select and unselect.<br />
<br />
{{Box Note | If you are going to require connection to a wireless network with WPA encryption, consider installing netcfg2 (as well as wireless_tools), which will enable you to do so.}}<br />
<br />
Once you're done selecting the packages you need, leave the selection<br />
screen and continue to the next step, Install Packages.<br />
<br />
===E: Install Packages===<br />
Next, choose 'Install Packages'. You will be asked if you wish to keep the packages in the pacman cache. If you choose 'yes', you will have the flexibility to [[Downgrade packages|downgrade]] to previous package versions in the future, so this is recommended (you can always clear the cache in the future). The installer script will now install the selected packages, as well as the default Arch 2.6 kernel, to your system.<br />
*FTP ISO: The [[Pacman]] package manager will now download and install your selected packages. (See vc/5 for output, vc/1 to return to the installer)<br />
*CORE ISO: The packages will be installed from the CD.<br />
<br />
===F: Configure the System===<br />
''Closely following and understanding these steps is of key importance to ensure a properly configured system.''<br />
<br />
At this stage of the installation, you will configure the primary configuration files of your Arch Linux base system.<br />
<br />
Previous versions of the installer included [[Hwdetect|hwdetect]] to gather information for your configuration. This has been deprecated, and udev should handle most module loading automatically at boot.<br />
<br />
====The initramfs====<br />
<br />
The initial ram filesystem, or initramfs, is a temporary file system used by the kernel during boot. It is used for making preparations, like hardware detection and module loading, before the real root file system can be mounted. Therefore, an initramfs allows for the use of a generic modular kernel for a wide variety of hardware, and without the need to compile a custom kernel for each end user.<br />
<br />
You will be prompted by a series of questions related to the configuration of your initramfs. You will be asked if you need support for booting from USB devices, FireWire devices, PCMCIA devices, NFS shares, software RAID arrays, LVM2 volumes, encrypted volumes, and DSDT support. Choose yes if you need it; in our example nothing is needed. Choosing 'yes' for any of the above will cause the installer script to place the appropriate hook(s) within the <code>/etc/mkinitcpio.conf</code> file.<br />
<br />
Now you will be asked which text editor you want to use; choose [http://en.wikipedia.org/wiki/Nano_%28text_editor%29 nano] or, if you are familiar with it, [http://en.wikipedia.org/wiki/Vim_%28text_editor%29 vim]. You will be presented with a menu including the main configuration files for your system.<br />
<br />
{{Box Note | ''It is very important at this point to edit, or at least verify by opening, every configuration file.'' The installer script relies on your input to create these files on your installation. A common error is to skip over these critical steps of configuration.}}<br />
<br />
=====Can the installer handle this more automatically?=====<br />
Hiding the process of system configuration is in direct opposition to [[The Arch Way]]. While it is true that recent versions of the kernel and hardware probing tools offer excellent hardware support and auto-configuration, Arch presents the user all pertinent configuration files during installation for the purposes of ''transparency and system resource control''. By the time you have finished modifying these files to your specifications, you will have learned the simple method of manual Arch Linux system configuration and become more familiar with the base structure, leaving you better prepared to use and maintain your new installation productively.<br />
<br />
====/etc/rc.conf====<br />
Arch Linux follows in the '''*BSD''' tradition of utilizing '''/etc/rc.conf''' as the principal location for system configuration. This one file contains a wide range of configuration information, principally used at system startup. As its name directly implies, it also contains settings for and invokes the /etc/rc* files, and is, of course, sourced ''by'' these files.<br />
=====LOCALIZATION section=====<br />
* '''LOCALE'''=: This sets your system locale, which will be used by all i18n-aware applications and utilities. You can get a list of the available locales by running 'locale -a' from the command line. This setting's default is fine for US English users.<br />
* '''HARDWARECLOCK'''=: Specifies whether the hardware clock, which is synchronized on boot and on shutdown, stores '''UTC''' time, or the '''localtime'''. UTC makes sense because it greatly simplifies changing timezones and daylight savings time. localtime is necessary if you dual boot with an operating system such as Windows, that only stores localtime to the hardware clock.<br />
* '''USEDIRECTISA''': Use direct I/O request instead of /dev/rtc for hwclock<br />
* '''TIMEZONE'''=: Specify your TIMEZONE. (All available zones are under /usr/share/zoneinfo/).<br />
* '''KEYMAP'''=: The available keymaps are in /usr/share/kbd/keymaps. Please note that this setting is only valid for your TTYs, not any graphical window managers or '''X'''.<br />
* '''CONSOLEFONT'''=: Available console fonts reside under /usr/share/kbd/consolefonts/ if you must change. The default (blank) is safe.<br />
* '''CONSOLEMAP'''=: Defines the console map to load with the setfont program at boot. Possible maps are found in /usr/share/kbd/consoletrans, if needed. The default (blank) is safe.<br />
* '''USECOLOR'''=: Select &quot;yes&quot; if you have a color monitor and wish to have colors in your consoles.<br />
<br />
LOCALE=&quot;en_US.utf8&quot;<br />
HARDWARECLOCK=&quot;localtime&quot;<br />
USEDIRECTISA=&quot;no&quot;<br />
TIMEZONE=&quot;US/Eastern&quot;<br />
KEYMAP=&quot;us&quot;<br />
CONSOLEFONT=<br />
CONSOLEMAP=<br />
USECOLOR=&quot;yes&quot;<br />
<br />
=====HARDWARE Section=====<br />
* '''MOD_AUTOLOAD'''=: Setting this to &quot;yes&quot; will use '''udev''' to automatically probe hardware and load the appropriate modules during boot-up, (convenient with the default modular kernel). Setting this to &quot;no&quot; will rely on the user's ability to specify this information manually, or compile their own custom kernel and modules, etc.<br />
* '''MOD_BLACKLIST'''=: This has become deprecated in favor of adding blacklisted modules directly to the '''MODULES=''' line below.<br />
* '''MODULES'''=: Specify additional MODULES if you know that an important module is missing. If your system has any floppy drives, add "floppy". If you will be using loopback filesystems, add "loop". Also specify any blacklisted modules by prefixing them with a bang (!). Udev will be forced NOT to load blacklisted modules. In the example, the IPv6 module as well as the annoying pcspeaker are blacklisted.<br />
# Scan hardware and load required modules at boot<br />
MOD_AUTOLOAD=&quot;yes&quot;<br />
# Module Blacklist - Deprecated<br />
MOD_BLACKLIST=()<br />
#<br />
MODULES=(!net-pf-10 !pcspkr !snd_pcsp loop)<br />
<br />
=====NETWORKING Section=====<br />
* '''HOSTNAME'''=:Set your HOSTNAME to your liking.<br />
* '''eth0'''=: 'Ethernet, card 0'. Adjust the interface IP address, netmask and broadcast address ''if'' you are using '''static IP'''. Set eth0=&quot;dhcp&quot; if you want to use '''DHCP'''<br />
* '''INTERFACES'''=: Specify all interfaces here. <br />
* '''gateway'''=: If you are using '''static IP''', set the gateway address. If using '''DHCP''', you can usually ignore this variable, though some users have reported the need to define it.<br />
* '''ROUTES'''=: If you are using static '''IP''', remove the '''!''' in front of 'gateway'. If using '''DHCP''', you can usually leave this variable commented out with the bang (!), but again, some users require the gateway and ROUTES defined. If you experience networking issues with pacman, for instance, you may want to return to these variables.<br />
<br />
======Example, using a dynamically assigned IP address aka '''DHCP'''======<br />
HOSTNAME=&quot;arch&quot;<br />
#eth0=&quot;eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255&quot;<br />
eth0=&quot;dhcp&quot;<br />
INTERFACES=(eth0)<br />
gateway=&quot;default gw 192.168.0.1&quot;<br />
ROUTES=(!gateway)<br />
{{Box Note | Arch uses the '''dhcpcd''' DHCP client. Alternatively, '''dhclient''' is available from the [extra] repository via pacman.}}<br />
<br />
======Example, using a '''static''' IP address======<br />
HOSTNAME=&quot;arch&quot;<br />
eth0="eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255"<br />
INTERFACES=(eth0)<br />
gateway="default gw 192.168.0.1"<br />
ROUTES=(gateway)<br />
<br />
{{tip|If you also require using a non-standard MTU size to speed up intranet xfers AND your hardware supports them, see the [[Jumbo Frames]] wiki page for further configuration.}}<br />
<br />
=====DAEMONS Section=====<br />
<br />
This array simply lists the names of those scripts contained in /etc/rc.d/ which are to be started during the boot process, and the order in which they start. <br />
DAEMONS=(network @syslog-ng netfs @crond)<br />
*If a script name is prefixed with a bang (!), it is not executed.<br />
*If a script is prefixed with an &quot;at&quot; symbol (@), it shall be executed in the background; the startup sequence will not wait for successful completion of each daemon before continuing to the next. (Useful for speeding up system boot). Do not background daemons that are needed by other daemons. For example "mpd" depends on "network", therefore backgrounding network may cause mpd to break.<br />
*Edit this array whenever new system services are installed, if starting them automatically during boot is desired.<br />
<br />
This 'BSD-style' init, is the Arch way of handling what other distributions handle with various symlinks to an /etc/init.d directory.<br />
<br />
======About DAEMONS======<br />
You do not have to change the [[daemons]] line at this time, but it is useful to explain what daemons are, because we need them later in this guide.<br />
A ''daemon'' is a program that runs in the background, waiting for events to occur and offering services. A good example is a webserver that waits for a request to deliver a page or an SSH server waiting for someone trying to log in. While these are full-featured applications, there are daemons whose work is not that visible. Examples are a daemon which writes messages into a log file (e.g. syslog, metalog), a daemon which lowers your CPU's frequency if your system has nothing to do (e.g.:cpufreq), and a daemon which offers you a graphical login (e.g.: gdm, kdm). All these programs can be added to the daemons line and will be started when the system boots. Useful daemons will be presented during this guide.<br />
<br />
Historically, the term ''daemon'' was coined by the programmers of MIT's Project MAC. They took the name from ''Maxwell's demon'', an imaginary being from a famous thought experiment that constantly works in the background, sorting molecules. <code>UNIX</code> systems inherited this terminology and created the backronym '''d'''isk '''a'''nd '''e'''xecution '''mon'''itor.<br />
<br />
{{Tip|All Arch daemons reside under /etc/rc.d/}}<br />
<br />
=====/etc/fstab=====<br />
The '''fstab''' (for '''f'''ile '''s'''ystems '''tab'''le) is part of the system configuration listing all available disks and disk partitions, and indicating how they are to be initialized or otherwise integrated into the overall system's filesystem. The '''/etc/fstab''' file is most commonly used by the '''mount''' command. The mount command takes a filesystem on a device, and adds it to the main system hierarchy that you see when you use your system. '''mount -a''' is called from /etc/rc.sysinit, about 3/4 of the way through the boot process, and reads /etc/fstab to determine which options should be used when mounting the specified devices therein. If '''noauto''' is appended to a filesystem in /etc/fstab, '''mount -a''' will not mount it at boot.<br />
<br />
======An example /etc/fstab======<br />
# <file system> <dir> <type> <options> <dump> <pass><br />
none /dev/pts devpts defaults 0 0<br />
none /dev/shm tmpfs defaults 0 0<br />
#/dev/cdrom /media/cdrom auto ro,user,noauto,unhide 0 0<br />
#/dev/dvd /media/dvd auto ro,user,noauto,unhide 0 0<br />
#/dev/fd0 /media/fl auto user,noauto 0 0<br />
/dev/disk/by-uuid/0ec-933.. / jfs defaults,noatime 0 1<br />
/dev/disk/by-uuid/7ef-223.. /home jfs defaults,noatime 0 2<br />
/dev/disk/by-uuid/530-1e-.. swap swap defaults 0 0<br />
/dev/disk/by-uuid/4fe-110.. /var reiserfs defaults,noatime,notail 0 2<br />
{{Box Note | The 'noatime' option disables writing read access times to the metadata of files and may safely be appended to / and /home regardless of your specified filesystem type for increased speed, performance, and power efficiency. 'notail' disables the ReiserFS tailpacking feature, for added performance at the cost of slightly less efficient disk usage.}}<br />
{{Box Note | It may be beneficial to make a note of the UUID of the root (/) partition, as this may be required during GRUB configuration.}}<br />
<br />
* '''<file system>''': describes the block device or remote filesystem to be mounted. For regular mounts, this field will contain a link to a block device node (as created by mknod which is called by udev at boot) for the device to be mounted; for instance, '/dev/cdrom' or '/dev/sda1'. Instead of giving the device explicitly, the Arch installer indicates the filesystem that is to be mounted by its UUID by default.<br />
{{Box Note | As of 2008-04rc, Arch is now utilizing the UUID, or Universally Unique Identifier naming convention, for consistent device mapping. This is due to active developments in the kernel and also udev, which may randomly change the ordering in which drivers for storage controllers are loaded, yielding an unbootable system/kernel panic. Nearly every motherboard has several controllers (onboard SATA, onboard IDE), and due to the aforementioned development updates, /dev/sda may become /dev/sdb on the next reboot- hence the persistent device naming convention of UUID has been adopted for reliability. ''If you do not need nor wish to use UUID, simply change your fstab to use whatever naming convention desired.'' (See [[Persistent block device naming| this wiki article]] for more information on persistent block device naming. )}}<br />
ls -lF /dev/disk/by-uuid/<br />
will list all partitions by UUID, while<br />
/sbin/blkid<br />
will show a list correlating each partition with its label, filesystem type and UUID. ''Note: this command is installed by the '''e2fsprogs''' package.''<br />
<br />
* '''<dir>''': describes the mount point for the filesystem. For swap partitions, this field should be specified as 'swap'; (Swap partitions are not actually mounted.)<br />
<br />
* '''<type>''': describes the type of the filesystem. The Linux kernel supports many filesystem types. (For the filesystems currently supported by the running kernel, see /proc/filesystems). An entry 'swap' denotes a file or partition to be used for swapping. An entry 'ignore' causes the line to be ignored. This is useful to show disk partitions which are currently unused.<br />
<br />
* '''<options>''': describes the mount options associated with the filesystem. It is formatted as a comma separated list of options with no intervening spaces. It contains at least the type of mount plus any additional options appropriate to the filesystem type. For documentation on the available options for non-nfs file systems, see mount(8).<br />
<br />
* '''<dump>''': used for these filesystems by the dump(8) command to determine which filesystems need to be dumped. dump is a backup utility. If the fifth field is not present, a value of zero is returned and dump will assume that the filesystem does not need to be backed up. ''Note that dump is not installed by default.''<br />
<br />
* '''<pass>''': used by the fsck(8) program to determine the order in which filesystem checks are done at boot time. The root filesystem should be specified with a <pass> of 1, and other filesystems should have a <pass> of 2 or 0. Filesystems within a drive will be checked sequentially, but filesystems on different drives will be checked at the same time to utilize parallelism available in the hardware. If the sixth field is not present or zero, a value of zero is returned and fsck will assume that the filesystem does not need to be checked.<br />
<br />
*If you plan on using '''hal''' to automount media such as DVDs, you may wish to comment out the cdrom and dvd entries in preparation for '''hal''', which will be installed later in this guide.<br />
<br />
Expanded information available in the [[Fstab]] wiki entry.<br />
<br />
====='''[[Configuring mkinitcpio | /etc/mkinitcpio]].conf'''=====<br />
This file allows you to fine-tune the initial ram filesystem (also commonly referred to as the initial ramdisk or &quot;initrd&quot;) for your system. The initrd is a gzipped image that is read by the kernel during boot. The purpose of the initrd is to bootstrap the system to the point where it can access the root filesystem. This means it has to load any modules that are required for devices like IDE, SCSI, or SATA drives (or USB/FW, if you are booting off a USB/FW drive). Once the initrd loads the proper modules, either manually or through udev, it passes control to the Arch system and your boot continues. For this reason, the initrd only needs to contain the modules necessary to access the root filesystem. It does not need to contain every module you would ever want to use. The majority of your everyday modules will be loaded later on by udev, during the init process.<br />
<br />
'''mkinitcpio''' is the next generation of '''initramfs creation'''. It has many advantages over the old '''mkinitrd''' and '''mkinitramfs''' scripts.<br />
<br />
* It uses '''klibc''' and '''kinit''' which are developed by Linux kernel devs to provide a small and lightweight base for early userspace.<br />
* It can use '''udev''' for hardware autodetection at runtime, thus prevents you from having tons of unnecessary modules loaded.<br />
* Its hook-based init script is easily extendable with custom hooks, which can easily be included in pacman packages without having to modifiy mkinitcpio itself.<br />
* It already supports '''lvm2''', '''dm-crypt''' for both legacy and luks volumes, '''raid''', '''swsusp''' and '''suspend2''' resuming and booting from '''usb mass storage''' devices.<br />
* Many features can be configured from the kernel command line without having to rebuild the image.<br />
* The '''mkinitcpio''' script makes it possible to include the image in a kernel, thus making a self-contained kernel image is possible.<br />
* Its flexibility makes recompiling a kernel unnecessary in many cases.<br />
<br />
If you are using a non-US keyboard you may want to add &quot;<code>keymap</code>&quot; to the &quot;<code>HOOKS=</code>&quot; section of '''/etc/mkinitcpio.conf''' to load your local keymap during boot, e.g.:<br />
HOOKS="base udev autodetect pata scsi sata filesystems keymap"<br />
Otherwise if boot fails for some reason you will be asked to enter root's password for system maintenance but will be unable to do so.<br />
<br />
''If you are using a US keyboard editing this configuration should be unnecessary at this point.''<br />
<br />
'''mkinitcpio''' was developed by Aaron Griffin and Tobias Powalowski with some help from the community.<br />
<br />
===== /etc/modprobe.conf=====<br />
It is unnecessary to configure this file at this time.<br />
<br />
* '''modprobe.conf''' can be used to set special configuration options for the kernel modules<br />
<br />
=====/etc/resolv.conf (for Static IP)=====<br />
The ''resolver'' is a set of routines in the C library that provide access to the Internet Domain Name System (DNS). One of the main functions of DNS is to translate domain names into IP addresses, to make the Web a friendlier place. The resolver configuration file, or /etc/resolv.conf, contains information that is read by the resolver routines the first time they are invoked by a process.<br />
<br />
*''If you are using DHCP, you may safely ignore this file, as by default, it will be dynamically created and destroyed by the dhcpcd daemon. You may change this default behavior if you wish. (See [http://wiki.archlinux.org/index.php/Network#For_DHCP_IP Network]]).''<br />
<br />
If you use a static IP, set your DNS servers in /etc/resolv.conf (nameserver <ip-address>). You may have as many as you wish.<br />
An example, using OpenDNS:<br />
nameserver 208.67.222.222<br />
nameserver 208.67.220.220<br />
<br />
If you are using a router, you will probably want to specify your DNS servers in the router itself, and merely point to it from your '''/etc/resolv.conf''', using your router's IP (which is also your gateway from '''/etc/rc.conf'''), e.g.:<br />
nameserver 192.168.1.1<br />
<br />
If using '''DHCP''', you may also specify your DNS servers in the router, or allow automatic assignment from your ISP, if your ISP is so equipped.<br />
<br />
=====/etc/hosts=====<br />
This file associates IP addresses with hostnames and aliases, one line per IP address. For each host a single line should be present with the following information:<br />
<IP-address> <hostname> [aliases...]<br />
Add your ''hostname'', coinciding with the one specified in /etc/rc.conf, as an alias, so that it looks like this:<br />
127.0.0.1 localhost.localdomain localhost '''''yourhostname'''''<br />
{{Box Note |''This format, '''including the 'localhost' and your actual host name''', is required for program compatibility! Errors in this entry may cause poor network performance and/or certain programs to open very slowly, or not work at all. This is a very common error for beginners.''}}<br />
<br />
If you use a static IP, add another line using the syntax: <static-IP> <hostname.domainname.org> <hostname> e.g.:<br />
192.168.1.100 '''''yourhostname'''''.domain.org '''''yourhostname'''''<br />
<br />
{{Tip|For convenience, you may also use /etc/hosts aliases for hosts on your network, and/or on the Web, e.g.:<br />
64.233.169.103 www.google.com g<br />
192.168.1.90 media<br />
192.168.1.88 data<br />
The above example would allow you to access google simply by typing 'g' into your browser, and access to a media and data server on your network by name and without the need for typing out their respective IP addresses.}}<br />
<br />
=====/etc/hosts.deny and /etc/hosts.allow=====<br />
Modify these configurations according to your needs if you plan on using the [[SSH|ssh]] daemon. The default configuration will reject all incoming connections, not only ssh connections. Edit your '''/etc/hosts.allow '''file and add the appropriate parameters: <br />
<br />
* let everyone connect to you<br />
sshd: ALL<br />
<br />
* restrict it to a certain ip<br />
sshd: 192.168.0.1<br />
<br />
* restrict it to your local LAN network (range 192.168.0.0 to 192.168.0.255)<br />
sshd: 192.168.0.<br />
<br />
* OR restrict for an IP range<br />
sshd: 10.0.0.0/255.255.255.0<br />
<br />
If you do not plan on using the [[SSH|ssh]] daemon, leave this file at the default, (empty), for added security.<br />
<br />
=====/etc/locale.gen=====<br />
The '''/usr/sbin/locale-gen''' command reads from '''/etc/locale.gen''' to generate specific locales. They can then be used by '''glibc''' and any other locale-aware program or library for rendering &quot;peculiar&quot; text, correctly displaying regional monetary values, time and date formats, alphabetic idiosyncrasies, and other locale-specific standards. The ability to setup a default locale is a great built-in privilege of using a <code>UNIX</code>-like operating system.<br />
<br />
By default /etc/locale.gen is an empty file with commented documentation. Once edited, the file remains untouched. '''locale-gen''' runs on every '''glibc''' upgrade, generating all the locales specified in /etc/locale.gen.<br />
<br />
Choose the locale(s) you need (remove the # in front of the lines you want), e.g.:<br />
en_US ISO-8859-1<br />
en_US.UTF-8 <br />
<br />
The installer will now run the locale-gen script, which will generate the locales you specified. You may change your locale in the future by editing /etc/locale.gen and subsequently running 'locale-gen' as root.<br />
<br />
{{Box Note |'''''If you fail to choose your locale, this will lead to a &quot;The current locale is invalid...&quot; error. This is perhaps the most common mistake by new Arch users, and also leads to the most commonly asked questions on the forum.'''''}}<br />
<br />
=====Root password=====<br />
Finally, set a root password and make sure that you remember it later. Return to the main menu and continue with installing bootloader.<br />
<br />
=====Pacman-Mirror=====<br />
Choose a mirror repository for '''pacman'''. <br />
*''archlinux.org is throttled, limiting downloads to 50KB/s'' <br />
<br />
Return to the main menu.<br />
<br />
===G: Install Bootloader===<br />
Because we have no secondary operating system in our example, we will need a bootloader. [http://www.gnu.org/software/grub/ GNU GRUB] is the recommended bootloader. Alternatively, you may choose [http://lilo.go.dyndns.org/ LILO].<br />
<br />
====GRUB====<br />
The provided '''GRUB''' configuration ('''/boot/grub/menu.lst''') should be sufficient, but verify its contents to ensure accuracy (specifically, ensure that the root (/) partition is specified by UUID on line 3). You may want to alter the resolution of the console by adding a vga=<number> kernel argument corresponding to your desired virtual console resolution. (A table of resolutions and the corresponding numbers is printed in the menu.lst.)<br />
<br />
Example: <br />
title Arch Linux (Main)<br />
root (hd0,0) <br />
kernel /boot/vmlinuz26 root=/dev/disk/by-uuid/0ec1-9339.. ro vga=773<br />
initrd /boot/kernel26.img<br />
{{Box Note | ''The linux kernel, 'vmlinuz', is so named because it incorporated '''v'''irtual '''m'''emory capability early in its development. The '''z''' denotes a zipped (compressed) image.''}}<br />
<br />
Explanation:<br />
<br />
Line 1: '''title''': A printed menu selection. &quot;Arch Linux (Main)&quot; will be printed on the screen as a menu selection.<br />
<br />
Line 2: '''root''': '''GRUB''''s root; the drive and partition where the kernel (/boot) resides, according to system BIOS. (More accurately, where GRUB's stage2 file resides). '''NOT necessarily the root''' (/) file system, as they can reside on separate partitions. GRUB's numbering scheme starts at 0, and uses an hd''x,x'' format regardless of IDE or SATA, and enclosed within parentheses. <br />
<br />
The example indicates that /boot is on the first partition of the first drive, according to BIOS, or, (hd0,0).<br />
<br />
Line 3: '''kernel''': This line specifies:<br />
<br />
* The path and filename of the kernel '''''relative to GRUB's root'''''.<br />
In the example, /boot is merely a directory residing on the same partition as / and '''vmlinuz26''' is the kernel filename; '''/boot/vmlinuz26'''. ''If /boot were on a separate partition, the path and filename would be simply '''/vmlinuz26''', being relative to '''GRUB''''s root.'' <br />
<br />
* The root= argument to the kernel statement specifies the partition containing the root (/) directory in the booted system, (more accurately, the partition containing '''/sbin/init'''). If not already specified, you should enter the name of the partition, according to the UUID numbering scheme, using the ''/dev/disk/by-uuid/xxxx-xxxx-xxxx'' format. This UUID was found in the previous section regarding configuration of ''/etc/fstab''.<br />
<br />
*An easy way to distinguish the 2 appearances of 'root' in /boot/grub/menu.lst is to remember that the first root statement ''informs GRUB where the kernel resides'', whereas the second root= kernel argument ''tells the kernel where the root filesystem (/) resides''.<br />
<br />
* Kernel options. <br />
<br />
In our example, '''ro''' mounts the filesystem as read only during startup, and the '''&quot;vga=773&quot;''' argument will give a 1024x768 framebuffer with 256 color depth.<br />
<br />
Line 4: '''initrd''': (For Initial RAM disk) The path and filename of the initial RAM filesystem '''relative to GRUB''''s root. Again, in the example, /boot is merely a directory residing on the same partition as / and '''kernel26.img''' is the initrd filename; '''/boot/kernel26.img'''. ''If /boot were on a separate partition, the path and filename would be simply '''/kernel26.img''', being relative to '''GRUB''''s root.'' <br />
<br />
Install the '''GRUB''' bootloader (to the master boot record, sda in our example).<br />
{{tip|For more details, see the [[GRUB]] wiki page.}}<br />
<br />
===H: Reboot===<br />
That's it; You have configured and installed your Arch Linux base system. Exit the install, and reboot:<br />
# reboot<br />
(Be sure to remove the installer CD)<br />
<br />
==Part II: Configure&Update the New Arch Linux base system==<br />
Your new Arch Linux system will boot up and finish with a login prompt (you may want to change the boot order in your '''BIOS''' back to booting from hard disk).<br />
<br />
'''Congratulations, and welcome to your shiny, new Arch Linux base system!'''<br />
<br />
Your new Arch Linux base system is now a functional GNU/Linux environment ready for customization. From here, you may build this elegant set of tools into whatever you wish or require for your purposes. <br />
<br />
Login with the root account. We will configure pacman and update the system as root, then add a normal user. <br />
{{Box Note |Virtual consoles 1-6 are available. You may swap between them with ALT+F1...F6}}<br />
<br />
===Step 1: Configuring the network (if necessary)===<br />
*''This section will assist you in configuring most types of networks, if your network configuration is not working for you.''<br />
<br />
If you properly configured your system, you should have a working network. Try to ping www.google.com to verify this.<br />
# ping -c 3 www.google.com<br />
<br />
''If you have successfully established a network connection, continue with '''[[#Step 2: Update, Sync and Upgrade the system with pacman|Update, Sync and Upgrade the system with pacman]]'''.''<br />
<br />
If, after trying to ping www.google.com, you get an &quot;unknown host&quot; error, you may conclude that your network is not properly configured. You may choose to double-check the following files for integrity and proper settings:<br />
<br />
'''/etc/rc.conf''' # Specifically, check your HOSTNAME= and NETWORKING section for typos and errors.<br />
<br />
'''/etc/hosts''' # Double-check your format. (See above.)<br />
<br />
'''/etc/resolv.conf''' # If you are using a static IP. If you are using DHCP, this file will be dynamically created and destroyed by default, but can be changed to your preference. (See [[Network]].)<br />
<br />
{{Tip|Advanced instructions for configuring the network can be found in the [[Network]] article.}}<br />
<br />
====Wired LAN====<br />
<br />
Check your Ethernet with<br />
# ifconfig -a<br />
All interfaces will be listed. You should see an entry for eth0, or perhaps eth1. <br />
*'''Static IP'''<br />
<br />
If required, you can set a new static IP with:<br />
# ifconfig eth0 <ip address> netmask <netmask> up <br />
and the default gateway with<br />
# route add default gw <ip address of the gateway><br />
Verify that /etc/resolv.conf contains your DNS server and add it if it is missing. <br />
Check your network again with ping www.google.com. If everything is working now, adjust /etc/rc.conf as described above for static IP. <br />
*'''DHCP'''<br />
If you have a DHCP server/router in your network try:<br />
# dhcpcd eth0<br />
If this is working, adjust /etc/rc.conf as described above, for dynamic IP.<br />
<br />
====Wireless LAN====<br />
* Ensure the driver has created a usable interface:<br />
# iwconfig<br />
* Bring the interface up with <code>ifconfig <interface> up</code>. e.g.:<br />
# ifconfig wlan0 up<br />
* (Optional) Scan for available access points:<br />
# iwlist wlan0 scan | less<br />
* Specify the id of the wireless network with <code>iwconfig <interface> essid <youressid></code>. Or, if using WEP; <code>iwconfig <interface> essid <youressid> key <yourwepkey></code>, e.g.:<br />
# iwconfig wlan0 essid linksys key ABCDEF01234<br />
* Request an IP address with <code>dhcpcd <interface></code>. e.g.:<br />
# dhcpcd wlan0<br />
* Ensure you can route:<br />
$ ping -c 3 www.google.com<br />
Done.<br />
<br />
Detailed setup guide: [[Wireless Setup]]<br />
<br />
====Analog Modem====<br />
To be able to use a Hayes-compatible, external, analog modem, you need to at least have the ppp package installed. Modify the file /etc/ppp/options to suit your needs and according to man pppd. You will need to define a chat script to supply your username and password to the ISP after the initial connection has been established. The manpages for pppd and chat have examples in them that should suffice to get a connection up and running if you're either experienced or stubborn enough. With udev, your serial ports usually are /dev/tts/0 and /dev/tts/1.<br />
Tip: Read [[Dialup without a dialer HOWTO]].<br />
<br />
Instead of fighting a glorious battle with the plain pppd, you may opt to install wvdial or a similar tool to ease the setup process considerably. In case you're using a so-called WinModem, which is basically a PCI plugin card working as an internal analog modem, you should indulge in the vast information found on the [http://www.linmodems.org/ LinModem] homepage.<br />
<br />
====ISDN====<br />
<br />
Setting up ISDN is done in three steps:<br />
# Install and configure hardware<br />
# Install and configure the ISDN utilities<br />
# Add settings for your ISP <br />
<br />
The current Arch stock kernels include the necessary ISDN modules, meaning that you will not need to recompile your kernel unless you're about to use rather odd ISDN hardware. After physically installing your ISDN card in your machine or plugging in your USB ISDN-Box, you can try loading the modules with modprobe. Nearly all passive ISDN PCI cards are handled by the hisax module, which needs two parameters: type and protocol. You must set protocol to '1' if your country uses the 1TR6 standard, '2' if it uses EuroISDN (EDSS1), '3' if you're hooked to a so-called leased-line without D-channel, and '4' for US NI1.<br />
<br />
Details on all those settings and how to set them is included in the kernel documentation, more specifically in the isdn subdirectory, and available online. The type parameter depends on your card; a list of all possible types can be found in the README.HiSax kernel documentation. Choose your card and load the module with the appropriate options like this:<br />
<br />
# modprobe hisax type=18 protocol=2<br />
<br />
This will load the hisax module for my ELSA Quickstep 1000PCI, being used in Germany with the EDSS1 protocol. You should find helpful debugging output in your /var/log/everything.log file, in which you should see your card being prepared for action. Please note that you will probably need to load some USB modules before you can work with an external USB ISDN Adapter.<br />
<br />
Once you have confirmed that your card works with certain settings, you can add the module options to your /etc/modprobe.conf:<br />
<br />
alias ippp0 hisax<br />
options hisax type=18 protocol=2<br />
<br />
Alternatively, you can add only the options line here, and add hisax to your MODULES array in the rc.conf. It's your choice, really, but this example has the advantage that the module will not be loaded until it's really needed.<br />
<br />
That being done, you should have working, supported hardware. Now you need the basic utilities to actually use it!<br />
<br />
Install the isdn4k-utils package, and read the manpage to isdnctrl; it'll get you started. Further down in the manpage you will find explanations on how to create a configuration file that can be parsed by isdnctrl, as well as some helpful setup examples. Please note that you have to add your SPID to your MSN setting separated by a colon if you use US NI1.<br />
<br />
After you have configured your ISDN card with the isdnctrl utility, you should be able to dial into the machine you specified with the PHONE_OUT parameter, but fail the username and password authentication. To make this work add your username and password to /etc/ppp/pap-secrets or /etc/ppp/chap-secrets as if you were configuring a normal analogous PPP link, depending on which protocol your ISP uses for authentication. If in doubt, put your data into both files.<br />
<br />
If you set up everything correctly, you should now be able to establish a dial-up connection with<br />
# isdnctrl dial ippp0<br />
as root. If you have any problems, remember to check the logfiles!<br />
<br />
====DSL (PPPoE)====<br />
<br />
These instructions are relevant to you only if your PC itself is supposed to manage the connection to your ISP. You do not need to do anything but define a correct default gateway if you are using a separate router of some sort to do the grunt work.<br />
<br />
Before you can use your DSL online connection, you will have to physically install the network card that is supposed to be connected to the DSL-Modem into your computer. After adding your newly installed network card to the modules.conf/modprobe.conf or the MODULES array, you should install the rp-pppoe package and run the pppoe-setup script to configure your connection. After you have entered all the data, you can connect and disconnect your line with<br />
<br />
# /etc/rc.d/adsl start<br />
<br />
and<br />
<br />
# /etc/rc.d/adsl stop<br />
<br />
respectively. The setup usually is rather easy and straightforward, but feel free to read the manpages for hints. If you want to automatically 'dial in' on boot-up, add adsl to your DAEMONS array, and put a ! before the network entry, since the network is handled by adsl now.<br />
<br />
===Step 2: Update, Sync and Upgrade the system with [[pacman]]===<br />
Now we will update the system using [[pacman]]. <br />
<br />
====A: Configuring pacman====<br />
<br />
=====What is pacman ?=====<br />
[[Pacman]] is the '''pac'''kage '''man'''ager of Arch Linux. Pacman is written in ''C'' and is designed from the ground up to be lightweight with a very modest memory footprint, fast, simple, and versatile. It manages your entire package system and handles installation, removal, package downgrade (through cache), custom compiled package handling, automatic dependency resolution, remote and local searches and much more. Pacman's output is streamlined, very readable and provides ETA for each package download. Arch uses the .tar.gz package format, which further enhances pacman's speed; Gzipped tarballs, though slightly larger, are decompressed many times faster than their Bzipped counterparts, and are therefore installed much more expediently. <br />
<br />
We will use pacman to download software packages from remote repositories and install them onto your system.<br />
<br />
Pacman is the most important tool in your Arch Linux toolbox for building the base system into whatsoever you please.<br />
<br />
=====Package Repositories and /etc/pacman.conf=====<br />
Arch currently offers the following 4 repositories readily accessible through pacman:<br />
<br />
'''[core]'''<br />
<br />
The simple principle behind [core] is to provide only one of each necessary tool for a base Arch Linux system; The GNU toolchain, the Linux kernel, one editor, one command line browser, etc. (There are a few exceptions to this. For instance, both vi and nano are provided, allowing the user to choose one or both.) It contains all the packages that MUST be in perfect working order to make sure your system continues to run. These are the absolute system-critical packages. Developer maintained.<br />
<br />
*''The Core installation media simply contains an installer script, and a snapshot of the core repository at the time of release.''<br />
<br />
'''[extra]'''<br />
<br />
The [extra] repository contains all Arch packages that are not themselves necessary for a base Arch system, but contribute to a more full-featured environment. '''X''', KDE, and Apache, for instance, can be found here. Developer maintained.<br />
<br />
'''[testing]'''<br />
<br />
The [testing] repository contains packages that are candidates for the [core] or [extra] repositories. New packages go into [testing] if:<br />
* they are expected to break something on update and need to be tested first<br />
* they require other packages to be rebuilt. In this case, all packages that need to be rebuilt are put into [testing] first and when all rebuilds are done, they are moved back to the other repositories. Developer maintained.<br />
<br />
[testing] is the only repository that can have name collisions with any of the other official repositories. <br />
<br />
{{Note|If enabled, [testing] must be the first repo listed in the user's <code>pacman.conf</code> file.}}<br />
<br />
{{Warning|Only experienced users should use [testing].}}<br />
<br />
'''[community]'''<br />
<br />
The [community] repository is maintained by the ''Trusted Users (TUs)'' and is part of the ''Arch User Repository ([[AUR]])''. It contains binary packages from the ''AUR'' that have enough votes and were adopted by a ''TU''. Like all repos listed above, [community] may be readily accessed by pacman.<br />
<br />
The '''[[AUR]]''' also contains the '''unsupported''' branch, which cannot be accessed directly by pacman*. [unsupported] does not contain binary packages. Rather, it provides more than nine thousand PKGBUILD scripts for building packages from source, that may be unavailable through the other repos. <br />
<br />
<nowiki>*</nowiki> '''''[[AUR Helpers]]''''' can help you seamlessly access AUR.<br />
<br />
'''/etc/pacman.conf'''<br />
<br />
pacman will attempt to read /etc/pacman.conf each time it is invoked. This configuration file is divided into sections, or repositories. Each section defines a package [[Official Repositories|repository]] that pacman can use when searching for packages. The exception to this is the options section, which defines global options.<br />
# nano /etc/pacman.conf<br />
Example:<br />
#<br />
# /etc/pacman.conf<br />
#<br />
# See the pacman.conf(5) manpage for option and repository directives<br />
<br />
#<br />
# GENERAL OPTIONS<br />
#<br />
[options]<br />
# The following paths are commented out with their default values listed.<br />
# If you wish to use different paths, uncomment and update the paths.<br />
#RootDir = /<br />
#DBPath = /var/lib/pacman/<br />
#CacheDir = /var/cache/pacman/pkg/<br />
#LogFile = /var/log/pacman.log<br />
HoldPkg = pacman glibc<br />
# If upgrades are available for these packages they will be asked for first<br />
SyncFirst = pacman<br />
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u<br />
#XferCommand = /usr/bin/curl %u > %o<br />
<br />
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup<br />
#IgnorePkg =<br />
#IgnoreGroup =<br />
<br />
#NoUpgrade =<br />
#NoExtract =<br />
<br />
# Misc options (all disabled by default)<br />
#NoPassiveFtp<br />
#UseSyslog<br />
#ShowSize<br />
#UseDelta<br />
#TotalDownload<br />
#<br />
# REPOSITORIES<br />
# - can be defined here or included from another file<br />
# - pacman will search repositories in the order defined here<br />
# - local/custom mirrors can be added here or in separate files<br />
# - repositories listed first will take precedence when packages<br />
# have identical names, regardless of version number<br />
# - URLs will have $repo replaced by the name of the current repo<br />
#<br />
# Repository entries are of the format:<br />
# [repo-name]<br />
# Server = ServerName<br />
# Include = IncludePath<br />
#<br />
# The header [repo-name] is crucial - it must be present and<br />
# uncommented to enable the repo.<br />
# <br />
<br />
# Testing is disabled by default. To enable, uncomment the following<br />
# two lines. You can add preferred servers immediately after the header,<br />
# and they will be used before the default mirrors.<br />
#[testing]<br />
#Include = /etc/pacman.d/mirrorlist<br />
<br />
[core]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
[extra]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist <br />
<br />
[community]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
# An example of a custom package repository. See the pacman manpage for<br />
# tips on creating your own repositories.<br />
#[custom]<br />
#Server = file:///home/custompkgs<br />
<br />
Enable all desired repositories (remove the # in front of the 'Include =' and '[repository]' lines).<br />
<br />
<br />
*'''''When choosing repos, be sure to uncomment both the repository header lines in [brackets] as well as the 'Include =' lines. Failure to do so will result in the selected repository being omitted! This is a very common error.'' '''<br />
<br />
=====/etc/pacman.d/mirrorlist=====<br />
Faster mirrors will dramatically improve pacman performance, and your overall Arch Linux experience.<br />
<br />
Edit /etc/pacman.d/mirrorlist:<br />
<br />
*''' Manually:'''<br />
# nano /etc/pacman.d/mirrorlist<br />
Remove all mirrors which are not on your continent, or are extremely distant. In nano, CTRL-K will cut each unneeded line. <br />
<br />
Edit /etc/pacman.d/mirrorlist by placing the best mirror at the top of the list. (Recall that archlinux.org is throttled to 50KB/s). In nano, ALT+A selects an area, cursor down marks the lines, Ctrl+K cuts the selected area and Ctrl+U uncuts, or pastes it. <br />
<br />
*''' Alternative, using the rankmirrors script:'''<br />
<br />
<code>/usr/bin/rankmirrors</code> is a python script which will attempt to detect the mirrors which are closest to you. <br />
<br />
First, use pacman to install python:<br />
# pacman -S python <br />
'''cd''' to the /etc/pacman.d/ directory:<br />
# cd /etc/pacman.d<br />
Backup your existing /etc/pacman.d/mirrorlist:<br />
# cp mirrorlist mirrorlist.backup<br />
Edit mirrorlist.backup and uncomment mirrors you want to test with rankmirrors.<br />
<br />
Run the script against the mirrorlist.backup with the -n switch and redirect output to a new /etc/pacman.d/mirrorlist file:<br />
# rankmirrors -n 6 mirrorlist.backup > mirrorlist<br />
'''-n 6''': rank the 6 fastest mirrors<br />
<br />
'''Force pacman to refresh the package lists'''<br />
<br />
After creating/editing your /etc/pacman.d/mirrorlist, (manually or by <code>/usr/bin/rankmirrors</code>) issue the following command:<br />
# pacman -Syy<br />
Passing two --refresh or -y flags forces pacman to refresh all package lists even if they are considered to be up to date. Issuing pacman -Syy ''whenever a mirror is changed'', is good practice and will avoid possible headaches.<br />
<br />
=====Ignoring packages=====<br />
When you execute the command &quot;pacman -Syu&quot;, your entire system will be updated. It is possible that you want to prevent a package from being upgraded. An example could be the kernel (kernel26) or a package for which an upgrade may prove problematic for your system. In this case, you have two options; indicate the package(s) you want to skip in the pacman command line using the --ignore switch (do pacman -S --help for details) or permanently indicate the package(s) you want to skip in your /etc/pacman.conf file in the IgnorePkg array. List each package, with one intervening space :<br />
IgnorePkg = wine <br />
The typical way to use Arch is to use pacman to install all packages unless there is no package available, in which case you can build your own package using [[ABS]]. Many user-contributed package build scripts are also available in the [[AUR]]. <br />
<br />
You are expected to keep your system up to date with pacman -Syu, rather than selectively upgrading packages. You may diverge from this typical usage as you wish; just be warned that there is a greater chance that things will not work as intended and that it could break your system. The majority of complaints happen when selective upgrading, unusual compilation or improper software installation is performed. Use of '''IgnorePkg''' in /etc/pacman.conf is therefore discouraged, and should only be used sparingly, if you know what you are doing.<br />
<br />
=====Ignoring Configuration Files=====<br />
In the same vein, you can also &quot;protect&quot; your configuration/system files from being overwritten during &quot;pacman -Su&quot; using the following option in your /etc/pacman.conf<br />
<br />
NoUpgrade = etc/lilo.conf boot/grub/menu.lst<br />
<br />
=====Get familiar with pacman=====<br />
pacman is the Arch user's best friend. It is highly recommended to study and learn how to use the pacman(8) tool. Try:<br />
man pacman<br />
<br />
For more information,please look up the [[pacman]] wiki entries at your leisure.<br />
<br />
====B: Update Pacman Itself (if necessary)====<br />
# pacman -Sy pacman<br />
<br />
===Step 3: Update System===<br />
You are now ready to upgrade your entire system. Before you do, read through the [http://www.archlinux.org/news/ news] (and optionally the [http://archlinux.org/pipermail/arch-announce/ announce mailing list]). Often the developers will provide important information about fixes for known issues. Consulting these pages before any upgrade is good practice. <br />
<br />
Sync, refresh, and upgrade your entire new system with:<br />
# pacman -Syu<br />
you may also use:<br />
# pacman --sync --refresh --sysupgrade<br />
<br />
pacman will now download a fresh copy of the master package list from the server(s) defined in pacman.conf(5) and perform all available upgrades. (You may be prompted to upgrade pacman itself at this point. If so, say yes, and then reissue the pacman -Syu command when finished.) <br />
<br />
Reboot if a kernel upgrade has occurred. <br />
<br />
{{Box Note|Occasionally, configuration changes may take place requiring user action during an update; read pacman's output for any pertinent information.}}<br />
<br />
Pacman output is saved in /var/log/pacman.log.<br />
<br />
{{Box Note|pacman might get updated, its mirrorlist configuration may be lost, so before you move on, make sure you reconfigure your pacman mirrorlist.}}<br />
<br />
See [[Package_Management_FAQs|Package Management FAQs]] for answers to frequently asked questions regarding updating and managing your packages.<br />
<br />
=====The Arch rolling release model=====<br />
Keep in mind that Arch is a '''rolling release''' distribution. This means there is never a reason to reinstall or perform elaborate system rebuilds to upgrade to the newest version. Simply issuing '''pacman -Syu''' periodically keeps your entire system up-to-date and on the bleeding edge. At the end of this upgrade, your system is completely current. '''Reboot''' if a kernel upgrade has occurred.<br />
=====Network Time Protocol=====<br />
You may wish to set the system time now using OpenNTPD to sync the local clock to remote NTP servers. OpenNTPD may also be added to the DAEMONS= array in /etc/rc.conf to provide this service at each boot. (See the [[Network Time Protocol]] article.)<br />
<br />
===Step 4: Add a user and setup groups===<br />
<code>UNIX</code> is a multi-user environment. You should not do your everyday work using the root account. It is more than poor practice; it is dangerous. Root is for administrative tasks. Instead, add a normal, non-root user account using the <code>/usr/sbin/useradd</code> program:<br />
# useradd -m -G [groups] -s [login_shell] [username] <br />
* '''-m''' Creates user home directory as /home/'''username'''. Within their home directory, a user can write files, delete them, install programs, etc. Users' home directories shall contain their data and personal configuration files, the so-called 'dot files' (their name is preceded by a dot), which are 'hidden'. (To view dotfiles, enable the appropriate option in your file manager or run ls with the -a switch.) If there is a conflict between ''user'' (under /home/username) and ''global'' configuration files, (usually under /etc/) the settings in the ''user'' file will prevail. Dotfiles likely to be altered by the end user include .xinitrc and .bashrc files. The configuration files for xinit and Bash respectively. They allow the user the ability to change the window manager to be started upon login and also aliases, user-specified commands and environment variables respectively. When a user is created, their dotfiles shall be taken from the /etc/skel directory where system sample files reside.<br />
* '''-G''' A list of supplementary groups which the user is also a member of. ''Each group is separated from the next by a comma, with no intervening spaces''. The default is for the user to belong only to the initial group (users). <br />
* '''-s''' The path and filename of the user´s default login shell.<br />
Useful groups for your non-root user include:<br />
*'''audio''' - for tasks involving sound card and related software<br />
*'''floppy''' - for access to a floppy if applicable<br />
*'''lp''' - for managing printing tasks<br />
*'''optical''' - for managing tasks pertaining to the optical drive(s)<br />
*'''storage''' - for managing storage devices<br />
*'''video''' - for video tasks and 3d acceleration<br />
*'''wheel''' - for using sudo<br />
*'''power''' - used w/ power options (ie. shutdown w/ off button) <br />
A typical example, adding a user named &quot;archie&quot; specifying bash as the login shell:<br />
# useradd -m -G users,audio,lp,optical,storage,video,wheel,power -s /bin/bash archie<br />
Next, add a password for your new user using <code>/usr/bin/passwd</code>.<br />
<br />
An example for our user, 'archie':<br />
# passwd archie<br />
(You will be prompted to provide the new <code>UNIX</code> password.)<br />
<br />
Your new non-root user has now been created, complete with a home directory and a login password.<br />
<br />
'''Alternative method, using <code>/usr/sbin/adduser</code>:'''<br />
<br />
Alternatively, you may use <code>adduser</code>, an interactive user adding program which will prompt you for the above data: ''(recommended for beginners)''<br />
# adduser<br />
'''Deleting the user account:'''<br />
<br />
In the event of error, or if you wish to delete this user account in favor of a different name or for any other reason, use <code>/usr/sbin/userdel</code>:<br />
# userdel -r [username]<br />
* '''-r ''' Files in the user´s home directory will be removed along with the home directory itself and the user´s mail spool.<br />
<br />
If you want to change the name of your user or any existing user, see the [[Change username]] page of the wiki and/or the [[Groups]] and [[User Management]] articles for further information. You may also check the man pages for <code>usermod(8)</code> and <code>gpasswd(8)</code>.<br />
<br />
===Step 5: Install and setup Sudo (Optional)===<br />
To install Sudo:<br />
# pacman -S sudo<br />
To add a user as a sudo user (a &quot;sudoer&quot;), the visudo command must be run as root. If you do not know how to use vi, you may set the EDITOR environment variable to the editor of your choice before running visudo. e.g.:<br />
# EDITOR=nano visudo<br />
If you are comfortable using vi, issue the visudo command without the EDITOR=nano variable:<br />
# visudo<br />
This will open the file /etc/sudoers in a special session of vi. visudo copies the file to be edited to a temporary file, edits it with an editor, (vi by default), and subsequently runs a sanity check. If it passes, the temporary file overwrites the original with the correct permissions. <br />
<br />
{{Warning|Do not edit /etc/sudoers directly with an editor; Errors in syntax can cause annoyances (like rendering the root account unusable). You must use the ''visudo'' command to edit /etc/sudoers.}}<br />
<br />
To give the user full root privileges when he/she precedes a command with &quot;sudo&quot;, add the following line:<br />
USER_NAME ALL=(ALL) ALL<br />
where USER_NAME is the username of the individual.<br />
<br />
For more information, such as sudoer <TAB> completion, see [[Sudo]]<br />
<br />
==Part III: Install X and configure ALSA==<br />
<br />
<br />
===Step 1: Configure sound with alsamixer===<br />
The Advanced Linux Sound Architecture (known by the acronym '''ALSA''') is a Linux kernel component intended to replace the original Open Sound System (OSS) for providing device drivers for sound cards. Besides the sound device drivers, '''ALSA''' also bundles a user space library for application developers who want to use driver features with a higher level API than direct interaction with the kernel drivers.<br />
{{Box Note| Alsa is included in the Arch mainline kernel and udev will automatically probe your hardware on boot-up, loading the corresponding kernel module for your audio card. Therefore, your sound should already be working, but upstream sources mute all channels by default.}}<br />
{{Box Note| OSS4.1 has been released under a free license and is generally considered a significant improvement over older OSS versions. If you have issues with ALSA, or simply wish to explore another option, you may choose OSS4.1 instead. Instructions can be found in [[OSS]]}} <br />
<br />
The alsa-utils package contains the alsamixer userspace tool, which will allow us to configure the sound device from the console. (You may also run alsamixer from an '''X''' environment later.)<br />
<br />
By default the upstream kernel sources ship with snd_pcsp, the alsa pc speaker module. snd_pcsp is usually loaded before your &quot;actual&quot; sound card module. In most cases, it will be more convenient if this module is loaded last, as it will allow alsamixer to correctly control the desired sound card.<br />
<br />
To have snd_pcsp load last, add the following to /etc/modprobe.conf:<br />
options snd-pcsp index=2<br />
<br />
Alternatively, if you do not want snd_pcsp to load at all, blacklist it by adding the following to /etc/rc.conf:<br />
MODULES=(... !snd_pcsp)<br />
<br />
{{Box Note | You will need to unload all your sound modules and reload them for the changes to take affect. It might be easier to reboot. Your choice. }}<br />
<br />
Install the alsa-utils package:<br />
# pacman -S alsa-utils<br />
Also, you may want to install the alsa-oss package, which wraps applications written for [[OSS]] in a compatibility library and allowing them to work with [[ALSA]]. To install the alsa-oss package:<br />
# pacman -S alsa-oss <br />
Did you add your normal user to the audio group? If not, use <code>/usr/bin/gpasswd</code>. As root do:<br />
# gpasswd -a ''yourusername'' audio<br />
As '''''normal, non-root''''' user, invoke <code>/usr/bin/alsamixer</code>:<br />
# su - ''yourusername'' <br />
'''$''' alsamixer<br />
Unmute the Master and PCM channels by scrolling to them with cursor left/right and pressing '''M'''. Increase the volume levels with the cursor-up key. (70-90 Should be a safe range.) Some machines, (like the Thinkpad T61), have a '''Speaker''' channel which must be unmuted and adjusted as well. Leave alsamixer by pressing ESC. <br />
==== Sound test ====<br />
Ensure your speakers are properly connected, and test your sound configuration as normal user using <code>/usr/bin/aplay</code>:<br />
$ aplay /usr/share/sounds/alsa/Front_Center.wav<br />
You should hear a very eloquent woman say, &quot;Front, center.&quot;<br />
==== Saving the Sound Settings ====<br />
Exit your normal user shell and run <code>/usr/sbin/alsactl</code> as root:<br />
$ exit<br />
# alsactl store<br />
This will create '/etc/asound.state', saving the alsamixer settings. <br />
<br />
Also, add the alsa ''daemon'' to your DAEMONS section in /etc/rc.conf to automatically restore the mixer settings on boot-up.<br />
# nano /etc/rc.conf<br />
DAEMONS=(syslog-ng network crond '''alsa''')<br />
''Note that the alsa daemon merely restores your volume mixer levels on boot up by reading /etc/asound.state. It is separate from the alsa audio library (and kernel level API).''<br />
<br />
Expanded information available in the [[ALSA]] wiki entry.<br />
<br />
===Step 2: Install X===<br />
The '''X''' Window System (commonly '''X11''', or just simply '''X''') is a networking and display protocol which provides windowing on bitmap displays. It provides the standard toolkit and protocol to build graphical user interfaces (GUIs) on <code>UNIX</code>-like operating systems.<br />
<br />
'''X''' provides the basic framework, or primitives, for building GUI environments: drawing and moving windows on the screen and interacting with a mouse and/or keyboard. '''X''' does not mandate the user interface — individual client programs handle this. <br />
<br />
'''X''' is so named because it was preceded by the '''W''' Window System, originally developed at Stanford University. <br />
<br />
{{Box Note| If you plan on using an '''open-source''' video driver, and need 3d acceleration, it is recommended to install the libgl library before installing Xorg:}}<br />
<br />
# pacman -S libgl<br />
''(Proprietary video drivers provide their own gl library implementations.)''<br />
<br />
====A: Install X====<br />
Now we will install the base Xorg packages using pacman. This is the first step in building a GUI.<br />
<br />
# pacman -S xorg<br />
With newer versions of xorg, it is suggested (and possibly necessary in most cases) to install the input driver evdev, which should be installed as a dependency for xorg-server, but many seem to be lacking somehow:<br />
# pacman -S xf86-input-evdev<br />
The 3d utilities glxgears and glxinfo are included in the '''mesa''' package:<br />
# pacman -S mesa<br />
<br />
====B: Install Video Driver Package====<br />
Now we have the base packages we need for running the '''X''' Server. You should add the driver for your graphics card now (e.g. xf86-video-<name>). The easiest way to configure X.org is by installing the correct driver packages first, and then generating /etc/X11/xorg.conf using an autoconfiguration script, like Xorg -configure.<br />
<br />
You will need knowledge of which video chipset your machine has. If you do not know, use the <code>/usr/sbin/lspci</code> program:<br />
# lspci | grep VGA<br />
<br />
If you need a list of all '''open-source''' video drivers, do: <br />
# pacman -Ss xf86-video | less<br />
Here is a list of '''open source''' drivers, and the corresponding video chipsets.<br />
*'''xf86-video-apm''' Alliance ProMotion video driver<br />
*'''xf86-video-ark''' ark video driver<br />
*'''xf86-video-ati''' ATI(AMD) video driver<br />
*'''xf86-video-chips''' Chips and Technologies video driver<br />
*'''xf86-video-cirrus''' Cirrus Logic video driver<br />
*'''xf86-video-dummy''' dummy video driver<br />
*'''xf86-video-fbdev''' framebuffer video driver<br />
*'''xf86-video-glint''' GLINT/Permedia video driver<br />
*'''xf86-video-i128''' Number 0 i128 video driver<br />
*'''xf86-video-i740''' Intel i740 video driver<br />
*'''xf86-video-i810''' Intel i810/i830/i9xx video drivers (deprecated - use -intel)<br />
*'''xf86-video-intel''' Newer Version of Intel i810/i830/i9xx video drivers<br />
*'''xf86-video-intel-legacy''' Legacy-driver for older intel cards as 82865G (xf86-video-intel currently crashes with older cards)<br />
*'''xf86-video-imstt''' Integrated Micro Solutions Twin Turbo video driver<br />
*'''xf86-video-mga''' mga video driver (Matrox Graphics Adapter)<br />
*'''xf86-video-neomagic''' neomagic video driver<br />
*'''xf86-video-nv''' Nvidia nv video driver<br />
*'''xf86-video-nouveau''' Open Source 3D acceleration driver for nVidia cards (experimental), check: [http://nouveau.freedesktop.org/wiki/] for Current Status<br />
*'''xf86-video-openchrome''' VIA/S3G UniChrome, UniChrome Pro and Chrome9 video driver<br />
*'''xf86-video-rendition''' Rendition video driver<br />
*'''xf86-video-s3''' S3 video driver<br />
*'''xf86-video-s3virge''' S3 Virge video driver<br />
*'''xf86-video-savage''' savage video driver<br />
*'''xf86-video-siliconmotion''' siliconmotion video driver<br />
*'''xf86-video-sis''' SiS video driver<br />
*'''xf86-video-sisusb''' SiS USB video driver<br />
*'''xf86-video-tdfx''' tdfx video driver<br />
*'''xf86-video-trident''' Trident video driver<br />
*'''xf86-video-tseng''' tseng video driver<br />
*'''xf86-video-unichrome''' VIA S3 Unichrome video drivers<br />
*'''xf86-video-v4l''' v4l video driver<br />
*'''xf86-video-vesa''' vesa video driver<br />
*'''xf86-video-vga''' VGA 16 color video driver<br />
*'''xf86-video-vmware ''' vmware video driver<br />
*'''xf86-video-voodoo ''' voodoo video driver<br />
<br />
* Note that the '''vesa''' driver is the most generic, and should work with almost any modern video chipset. If you cannot find a suitable driver for your video chipset, vesa '''''should''''' work.<br />
<br />
Use pacman to install the appropriate video driver for your video card/onboard video. e.g.:<br />
# pacman -S xf86-video-savage<br />
(for the Savage driver.)<br />
<br />
*If you have an NVIDIA or ATI graphics card you may wish to install the proprietary NVIDIA or ATI drivers. '''Installing proprietary video drivers is covered below.'''.<br />
*If you don't want to install the proprietary drivers or do not have an NVIDIA or ATI graphics card, you should skip down to '''[[#Step 3: Configure X|Step 3: Configure X]]'''.<br />
<br />
<br />
-----<br />
<br />
<br />
=====NVIDIA Graphics Cards=====<br />
The NVIDIA proprietary drivers are generally considered to be of good quality, and offer 3D performance, whereas the open source '''nv''' driver offers only 2d support at this time. <br />
<br />
Before you configure your Graphics Card you will need to know which driver fits. Arch currently has several different driver packages that each match a certain subset of Cards: <br />
<br />
'''1. nvidia-96xx''' ''slightly newer cards up to the GF 4.''<br />
<br />
'''2. nvidia-173xx''' ''Geforce FX series cards''<br />
<br />
'''3. nvidia''' ''newest GPUs after the GF FX''<br />
<br />
{{Box Note| Nvidia-71xx series proprietary drivers, which are required by extremely old cards like TNT and TNT2, have been removed because they do not work with the new Xorg that Arch makes use of and nvidia has discontinued support for such. You should use the xf86-video-nv or xf86-video-vesa drivers instead.}}<br />
<br />
Consult the NVIDIA website to see which one is for you. The difference is only for the installation; Configuration works the same with every driver.<br />
<br />
Select and install the appropriate NVIDIA driver ''for your card'', e.g.: <br />
# pacman -S nvidia-96xx<br />
<br />
The NVIDIA package has a utility for updating your existing /etc/X11/xorg.conf for use with the NVIDIA driver:<br />
# nvidia-xconfig<br />
<br />
It also has several options which will further specify the contents and options of the xorg.conf file.<br />
For example,<br />
# nvidia-xconfig --composite --add-argb-glx-visuals<br />
<br />
For more detailed information, see nvidia-xconfig(1).<br />
<br />
Some useful tweaking options in the device section are (beware that these may not work on your system):<br />
Option &quot;RenderAccel&quot; &quot;true&quot;<br />
Option &quot;NoLogo&quot; &quot;true&quot;<br />
Option &quot;AGPFastWrite&quot; &quot;true&quot;<br />
Option &quot;EnablePageFlip&quot; &quot;true&quot;<br />
Make sure all instances of DRI are commented out:<br />
# Load &quot;dri&quot;<br />
Double check your /etc/X11/xorg.conf to make sure your default depth, horizontal sync, vertical refresh, and resolutions are acceptable.<br />
<br />
Update kernel module dependencies using <code>/sbin/depmod</code>:<br />
# depmod -a<br />
(A reboot may be necessary.)<br />
{{Tip|Advanced instructions for NVIDIA configuration can be found in the [[NVIDIA]] article.}}<br />
<br />
You may now continue with '''[[#Step 3: Configure X|Step 3: Configure X]]''' to familiarize yourself further, or continue the installation process with '''[[#C: Test X|Test X]]'''.<br />
<br />
=====ATI Graphics Cards=====<br />
ATI owners have two options for drivers. If you are unsure which driver to use, please try the open-source one first. The open-source driver will suit most needs along with being generally less problematic.<br />
<br />
<br />
Install the '''open-source''' ATI Driver with<br />
# pacman -S xf86-video-ati<br />
<br />
Currently, the performance of the open-source driver is not on par with that of the proprietary one. It also lacks TV-out, dual-link DVI support, and possibly other features. On the other hand, it supports Aiglx and has better dual-head support.<br />
<br />
The proprietary ATI driver '''Catalyst''' was once a precompiled package offered by Arch in the <code>extra</code> repository, but as of March 2009, official support has been dropped because of dissatisfaction with the quality and speed of development of the proprietary driver.The catalyst driver is now available in [http://aur.archlinux.org/packages.php?ID=22899 AUR]. Installation information for Catalyst driver is available [[ATI#Proprietary_ATI_Catalyst_driver | here]]<br />
<br />
{{Box Note| The latest proprietary driver does support [[AIGLX]] now. To use [[Compiz]] or [[Beryl]] add Option &quot;AIGLX&quot; &quot;True&quot; to Section ServerFlags.}}<br />
{{Tip|Advanced instructions for ATI configuration can be found in the [[ATI | ATI wiki]].}}<br />
<br />
===Step 3: Configure X===<br />
<br />
====A: The xorg.conf file====<br />
<br />
/etc/X11/xorg.conf is the main configuration file for your '''X''' Window System, the foundation of your '''G'''raphical '''U'''ser '''I'''nterface. It is a plain text file ordered into sections and subsections. Important sections are ''Files, InputDevice, Module, Monitor, Modes, Screen, Device, and ServerLayout''. Sections can appear in any order and there may be more than one section of each kind, for example, if you have more than one monitor, or if your laptop has a trackpoint as well as a mouse. <br />
<br />
Since X11R7.2 the X.Org X Server features autoconfiguration so it can function without an xorg.conf file in most cases. ''If'' the autoconfiguration ''works satisfactorily'' and you do not need to specify special features such as aiglx, compositing and so forth, you may forgo creating an xorg.conf file.<br />
<br />
=====Configure Xorg without an xorg.conf file=====<br />
<br />
Newer versions of Xorg (>1.6) don't include the /usr/bin/xorgconfig or /usr/bin/xorgcfg scripts. This causes the 'hwd -xa' command not to work properly. Also if you run into problems using a xorg.conf file, you might want to consider using this guide.<br />
<br />
See the [[Xorg#Without_xorg.conf|article on X.Org, section "Without xorg.conf"]].<br />
<br />
=====Standard xorg.conf generation=====<br />
<br />
Advanced users may wish to manually create their own xorg.conf file. You may also use the <code>/usr/bin/Xorg</code> program with the -configure option to generate a basic config file; As root, do:<br />
# Xorg -configure<br />
This will create a config file at /root/xorg.conf.new <br />
<br />
Copy the file to <code>/etc/X11/</code>:<br />
# cp /root/xorg.conf.new /etc/X11/xorg.conf<br />
<br />
=====Alternative xorg.conf generation=====<br />
{{Box Note| This tool is deprecated. It may or may not work for you. If it doesn't work, delete the xorg.conf it generated and use another method.}}<br />
* Note that if your machine has a successfully configured xorg.conf under another distribution and with the same Xorg version, you may easily copy it over to your current Arch system's <code>/etc/X11/</code> directory.<br />
* You may alternatively use the <code>/usr/bin/hwd</code> tool. Install with:<br />
# pacman -S hwd<br />
And run with<br />
# hwd -xa<br />
{{Box Note| At the time of this writing, hwd generates a xorg.conf with an invalid line for newer xorg packages. After using it, you need to remove or comment out the RgbPath line under Section &quot;Files&quot; via nano /etc/X11/xorg.conf or your equivalent, as root/sudo.}}<br />
<br />
* You may also try the <code>/usr/bin/xorgcfg</code> script:<br />
# xorgcfg <br />
* Lastly, you may choose <code>/usr/bin/xorgconfig</code>, which will interactively prompt you for hardware information to create a basic xorg.conf:<br />
# xorgconfig<br />
<br />
====B: Input hotplugging====<br />
<br />
Input hotplugging is supported since the 1.4 version of the X.Org X Server.<br />
When input hotplugging is enabled, X will purge any devices setup in xorg.conf that are using the kbd and mouse driver. <br />
<br />
{{Box Note | Using input hotplugging without the HAL daemon may result in X appearing to freeze and result in your not being able to move your mouse or use your keyboard.}}<br />
<br />
You must decide whether you will use input hotplugging or disable it.<br />
<br />
{{Tip | See the article on [[Xorg input hotplugging]] for full details.}}<br />
<br />
=====Configure input hotplugging=====<br />
<br />
======Install the evdev input driver ======<br />
# pacman -S xf86-input-evdev<br />
<br />
======Set the keyboard layout if you don't use a standard US keyboard======<br />
# cp /usr/share/hal/fdi/policy/10osvendor/10-keymap.fdi /etc/hal/fdi/policy/<br />
# nano /etc/hal/fdi/policy/10-keymap.fdi<br />
Edit the &quot;input.xkb.layout&quot; key and possibly the &quot;input.xkb.variant&quot; key in this file.<br />
<br />
======the HAL daemon======<br />
Start the hal daemon before anything related to X.Org is started:<br />
# /etc/rc.d/hal start<br />
Add the hal daemon to the DAEMONS array in /etc/rc.conf to start it at every boot.<br />
<br />
=====Disable input hotplugging=====<br />
# nano /etc/X11/xorg.conf<br />
and add the following<br />
Section &quot;ServerFlags&quot;<br />
Option &quot;AutoAddDevices&quot; &quot;False&quot;<br />
EndSection<br />
This will skip devices detected by hal and will use your keyboard/mouse configuration from xorg.conf<br />
<br />
======Set the keyboard layout if you don't use a standard US keyboard======<br />
Add option lines in the &quot;InputDevice&quot; section of the /etc/X11/xorg.conf file specifying the keyboard layout and variant:<br />
Option &quot;XkbLayout&quot; &quot;be&quot;<br />
Option &quot;XkbVariant&quot; &quot;&quot;<br />
<br />
An alternate method is using the setxkbmap command:<br />
# setxkbmap pl <br />
(with your keyboard layout instead of <code>pl</code> of course) should switch your keyboard layout in x.<br />
To make it permanent, add this command to <code>/home/<youruser>/.xinitrc</code> before starting the window manager (before command like <code>exec startxfce4</code>).<br />
<br />
====C: Test X====<br />
<br />
First read the warning about input hotplugging in the previous section. To test the X server, run the '''X''' script with the ''-config'' flag against the ''path/to/xorg.conf'' file. e.g.:<br />
# X -config /etc/X11/xorg.conf<br />
'''X''' should start with the white hollow vector '''X''' in the center of the screen, which should respond to mouse, trackpoint or touchpad movement. Use CTRL-Alt-Backspace to exit '''X'''.<br />
<br />
{{Box Note| Some users have found after the upgrade to Xorg 1.6 that this test fails (no hollow X appears and no capacity for cursor movement is enabled), but this does not indicate a problem with the installation of X. You may want to double check by running the next test in this guide.}}<br />
<br />
{{Box Note| With Xorg 1.6 CTRL-Alt-Backspace has been deprecated and will not work to exit out of this test. A somewhat messy work around is to switch to a different virtual console (CTRL-Alt-F2, for example) and then switch back to the console the test is running in (probably CTRL-Alt-F1). You will then be able to use CTRL-C to kill the X test. You can enable CTRL-Alt-Backspace by editing xorg.conf, as described [http://wiki.archlinux.org/index.php/Xorg#Ctrl-Alt-Backspace_doesn.27t_exit_X here].}}<br />
<br />
=====In case of errors=====<br />
<br />
Inspect your config file:<br />
<br />
# nano /etc/X11/xorg.conf<br />
<br />
Ensure the Xorg -configure script has correctly specified your video driver. e.g.:<br />
Section &quot;Device&quot;<br />
<br />
...<br />
<br />
Driver &quot;savage&quot;<br />
<br />
...<br />
<br />
EndSection<br />
<br />
Ensure there are horizontal sync and vertical refresh specs under section &quot;Monitor&quot;. If not, add them:<br />
Section &quot;Monitor&quot;<br />
Identifier &quot;Monitor0&quot;<br />
VendorName &quot;Monitor Vendor&quot;<br />
ModelName &quot;Monitor Model&quot;<br />
HorizSync 30.0 - 130.0 # Safe for LCD's<br />
VertRefresh 50.0 - 100.0 # Safe for LCD's and most CRT's.<br />
EndSection<br />
(If you do not know these specs, consult your monitor's documentation.)<br />
<br />
Specify your default color depth under section &quot;Screen&quot;:<br />
Section &quot;Screen&quot;<br />
Identifier &quot;Screen0&quot;<br />
Device &quot;Card0&quot;<br />
Monitor &quot;Monitor0&quot;<br />
DefaultDepth 24<br />
(Typically, this will be set to 24 for true color.)<br />
<br />
Also add your desired Modes to your &quot;Display&quot; subsection, at least under the Depth 24 header, e.g.:<br />
SubSection &quot;Display&quot;<br />
Viewport 0 0<br />
Depth 24<br />
Modes &quot;1024x768&quot; &quot;800x600&quot; &quot;640x480&quot;<br />
Add the following section, if you wish to enable eye candy which requires the composite extension: <br />
Section &quot;Extensions&quot;<br />
Option &quot;Composite&quot; &quot;Enable&quot;<br />
EndSection<br />
Try your config again, after modifying:<br />
# X -config /etc/X11/xorg.conf<br />
Detailed instructions in the [[Xorg]] article.<br />
<br />
===Simple baseline X test(if necessary)===<br />
At this point, you should have xorg installed, with a suitable video driver and an /etc/X11/xorg.conf configuration file. If you want to test your configuration quickly, to ensure your ability to successfully start '''X''' from the command line before installing a complete desktop environment, you can do so by configuring ~/.xinitrc to invoke '''Xterm'''. Xterm is a very simple terminal emulator which runs in the '''X '''Server environment; it is installed as part of the base xorg packages. More advanced users who are comfortable with '''X''' configuration may choose to skip this optional step.<br />
==== Prepare for the test by configuring ~/.xinitrc====<br />
<br />
One of the main functions of this file is to dictate what '''X''' Window client is invoked with the '''/usr/bin/startx''' and/or '''/usr/bin/xinit''' program ''on a per-user basis''. (The '''startx''' script is merely a front end to the more versatile '''xinit''' command.) There are vast amounts of additional configurable specifications and commands that may also be added to ~/[[.xinitrc]] as you further customize your system. <br />
{{Box Note | '''[[.xinitrc]]''' is a so-called 'dot' (.) file. Files in a UNIX filesystem which are preceded with a dot (.) are 'hidden', and will not show up with a regular 'ls' command, usually for the sake of keeping directories tidy. Dot files may be seen by issuing '''ls -a'''. The 'rc' denotes ''Run Commands'' and simply indicates that it is a configuration file. Since it controls how a program runs, it is (although historically incorrect) also said to stand for &quot;Run Control&quot;.}}<br />
<br />
'''startx/xinit''' will start the '''X''' server and clients. To determine the client to run, '''startx/xinit''' will first look to parse a [[.xinitrc]] file in the user's home directory. In the absence of file ~/[[.xinitrc]], it defaults to the global xinitrc in the xinit library directory; /etc/X11/xinit/xinitrc, which defaults to using the TWM window manager. (Hence, if you invoke startx without a ~/[[.xinitrc]] file, a TWM session will start.) Further details in the [[.xinitrc]] wiki entry.<br />
<br />
Switch to your '''''normal, non-root''''' user:<br />
# su - ''yourusername''<br />
* /etc/skel/ contains files and directories to provide sane defaults for newly created user accounts. The name '''skel''' is derived from the word '''skeleton''', because the files it contains form the basic structure for users' home directories.<br />
* If you installed from a fresh (Core) install, it does not include the X window manager, so .xinitrc does not exist in /etc/skel. Instead, use the sample provided [[Xinitrc#A_standard_.xinitrc | here]].<br />
Copy the sample xinitrc file from /etc/skel/ to your home directory: <br />
<br />
$ cp /etc/skel/[[.xinitrc]] ~/<br />
Edit the file: <br />
$ nano ~/.xinitrc<br />
and add &quot;<code>exec xterm</code>&quot; so that it looks like this:<br />
<br />
#!/bin/sh<br />
#<br />
# ~/.xinitrc<br />
#<br />
# Executed by startx (run your window manager from here)<br />
#<br />
# exec wmaker<br />
# exec startkde<br />
# exec icewm<br />
# exec blackbox<br />
# exec fluxbox<br />
#<br />
exec xterm<br />
<br />
{{Box Note | ''Be sure to have only '''one''' uncommented '''exec''' line in your ~/.xinitrc''.}}<br />
Below, we shall edit this file again to specify the appropriate desktop environment/window manager of your choice.<br />
<br />
====Perform the test====<br />
<br />
Test your configurations by starting '''X''' as '''normal, non-root''' user, with:<br />
<br />
$ startx<br />
or<br />
$ xinit<br />
<br />
You should have an '''xterm''' session open up. You can test your keyboard and its layout in it.<br />
<br />
You can exit the '''X''' Server with Ctrl+Alt+Backspace, or by typing &quot;exit&quot;. If you have problems starting '''X''', you can look for errors in the /var/log/Xorg.0.log file and on the console output of the console you started '''X''' from.<br />
<br />
If you prove a properly configured /etc/X11/xorg.conf by successfully running the test, you can be assured that your DE/WM of choice will work smoothly.<br />
<br />
{{Tip|Advanced instructions for Xorg configuration can be found in the [[Xorg]] article.}}<br />
<br />
==Part IV: Installing and configuring a Desktop Environment ==<br />
While The '''X''' Window System provides the basic framework for building a ''graphical user interface'' (GUI), a '''Desktop Environment''' (DE), works atop and in conjunction with '''X''', to provide a completely functional and dynamic GUI. A DE typically provides a window manager, icons, applets, windows, toolbars, folders, wallpapers, a suite of applications and abilities like drag and drop. The particular functionalities and designs of each DE will uniquely affect your overall environment and experience. Therefore, choosing a DE is a very subjective and personal decision. Choose the best environment for ''your'' needs.<br />
<br />
* If you want something full-featured and similar to Windows and Mac OSX, '''[[#KDE|KDE]]''' is a good choice<br />
* If you want something slightly more minimalist, which follows the K.I.S.S. principle more closely, '''[[#GNOME|GNOME]]''' is a good choice<br />
* '''[[#Xfce|Xfce]]''' is generally perceived as similar to GNOME, but lighter and less demanding on system resources, yet still visually pleasing and providing a very complete environment.<br />
* '''[[#LXDE|LXDE]]''' is a minimal DE based on the Openbox window manager. It provides most things you need for a modern desktop while keeping relatively low system resource usage. LXDE is a good choice for those who want a quick way of setting up a pre-configured Openbox system.<br />
<br />
If you desire a lighter, less demanding GUI to configure manually, you may choose to simply install a '''Window Manager''', or WM. A WM controls the placement and appearance of application windows in conjunction with the X Window System but does NOT include such features as panels, applets, icons, applications, etc., by default.<br />
* Lightweight floating WM's include: [[#Openbox|'''Openbox''']], [[#Fluxbox|'''Fluxbox''']], [[#fvwm2|'''fvwm2''']], [[PekWM|'''pekwm''']], [[Evilwm|'''evilwm''']], '''Windowmaker, and TWM'''.<br />
* If you need something completely different, try a tiling WM like [[Awesome|'''awesome''']], [[Ion3|'''ion3''']], [[Wmii|'''wmii''']], [[Dwm|'''dwm''']], [[Xmonad|'''xmonad''']], or [[Ratpoison|'''ratpoison''']].<br />
<br />
===Step 1: Install Fonts===<br />
At this point, you may wish to save time by installing visually pleasing, true type fonts, before installing a desktop environment/window manager. Dejavu and bitstream-vera are good, general-purpose font sets. You may also want to have the Microsoft font sets, which are especially popular on websites. <br />
<br />
Install with:<br />
# pacman -S ttf-ms-fonts ttf-dejavu ttf-bitstream-vera<br />
<br />
===Step 2: ~/.xinitrc (again)===<br />
<br />
As '''non-root user''', edit your /home/username/.xinitrc to specify the DE you wish to use. This will allow you to use '''startx/xinit''' from the shell, in the future, to open your DE/WM of choice:<br />
<br />
$ nano ~/.xinitrc<br />
<br />
Uncomment or add the ''''exec''' ..' line of the appropriate desktop environment/window manager. Some examples are below:<br />
<br />
For the Xfce4 desktop environment:<br />
exec startxfce4 <br />
<br />
For the KDE desktop environment:<br />
exec startkde<br />
A '''startkde''' or '''startxfce4''' command starts the KDE or Xfce4 desktop environment. This command does not finish until you logout of the DE. Normally the shell would wait for KDE to finish, then run the next command. The &quot;exec&quot; prefix to this command tells the shell that this is the last command, so the shell does not need to wait to run a subsequent command.<br />
<br />
If you have trouble with automounting, use the following command instead. Replace "startxfce4" with the command that is appropriate for your window manager.<br />
exec ck-launch-session startxfce4<br />
<br />
Remember to have only one uncommented '''exec''' line in your ~/.xinitrc.<br />
<br />
===Step 3: Install a Desktop Environment===<br />
<br />
Continue below, installing the DE/WM of your choice.<br />
<br />
* [[#GNOME|'''GNOME''']]<br />
* [[#KDE|'''KDE''']]<br />
* [[#Xfce|'''Xfce''']]<br />
* [[#LXDE|'''LXDE''']]<br />
* [[#Openbox|'''Openbox''']]<br />
* [[#Fluxbox|'''Fluxbox''']]<br />
* [[#fvwm2|'''fvwm2''']]<br />
<br />
====GNOME====<br />
=====About GNOME=====<br />
The '''G'''NU '''N'''etwork '''O'''bject '''M'''odel '''E'''nvironment. The GNOME project provides two things: The GNOME desktop environment, an intuitive and attractive desktop for end-users, and the GNOME development platform, an extensive framework for building applications that integrate into the rest of the desktop.<br />
<br />
=====Installation=====<br />
Install the base GNOME environment with:<br />
# pacman -S gnome<br />
<br />
Additionally, you can install the extras:<br />
# pacman -S gnome-extra<br />
<br />
It's safe to choose all packages shown in the extra package.<br />
<br />
=====Useful DAEMONS for GNOME=====<br />
Recall from above that a daemon is a program that runs in the background, waiting for events to occur and offering services. Some users prefer to use the '''hal''' daemon. The '''hal''' daemon, among other things, will automate the mounting of disks, optical drives, and USB drives/thumbdrives for use in the GUI. The '''fam''' daemon will allow real-time representation of file alterations in the GUI, allowing instant access to recently installed programs, or changes in the file system. Both '''hal''' and '''fam''' can make life easier for the GNOME user. The hal and fam packages are installed when you install GNOME, but must be invoked to become useful.<br />
<br />
Start hal and fam:<br />
# /etc/rc.d/hal start<br />
<br />
# /etc/rc.d/fam start<br />
<br />
Add them to your /etc/rc.conf DAEMONS section, so they will be invoked at boot:<br />
# nano /etc/rc.conf<br />
<br />
DAEMONS=(syslog-ng network crond alsa '''hal fam gdm''')<br />
(If you prefer to log into the console and manually start X, leave out gdm.)<br />
<br />
<br />
You may want to install a graphical login manager. For GNOME, the '''gdm''' daemon is a good choice. <br />
<br />
As root:<br />
# pacman -S gdm<br />
<br />
As normal user, start X:<br />
$ startx<br />
or<br />
$ xinit<br />
If ~/.xinitrc is not configured for GNOME, you may always start it with '''xinit''', followed by the path to GNOME:<br />
$ xinit /usr/bin/gnome-session<br />
<br />
{{Tip|Advanced instructions for installing and configuring GNOME can be found in the [[Gnome]] article.}}<br />
<br />
Congratulations! Welcome to your GNOME desktop environment on your new Arch Linux system! You may wish to continue by viewing '''[[#Tweaks/Finishing touches|Tweaks and finishing touches]]''', or the rest of the information below. You may also be interested in the [[Post Installation Tips]] wiki article.<br />
<br />
=====Eye Candy=====<br />
By default, GNOME does not come with many themes and icons. You may wish to install some more attractive artwork for GNOME:<br />
<br />
A nice gtk (gui widget) theme engine (includes themes) is the murrine engine. Install with:<br />
# pacman -S gtk-engine-murrine<br />
<br />
Once it has been installed, select it with System -> Preferences -> Appearance -> Theme tab.<br />
<br />
The Arch Linux repositories also have a few more nice themes and engines. Install the following to see for yourself:<br />
<br />
# pacman -S gtk-engines gtk2-themes-collection gtk-aurora-engine gtk-candido-engine gtk-rezlooks-engine<br />
<br />
You can find many more themes, icons, and wallpapers at [http://www.gnome-look.org GNOME-Look].<br />
<br />
====KDE====<br />
=====About KDE=====<br />
The '''K''' '''D'''esktop '''E'''nvironment. KDE is a powerful Free Software graphical desktop environment for GNU/Linux and <code>UNIX</code> workstations. It combines ease of use, contemporary functionality, and outstanding graphical design with the technological superiority of <code>UNIX</code>-like operating systems.<br />
<br />
=====Installation=====<br />
Choose one of the following, then continue below with '''[[#Useful KDE DAEMONS|Useful KDE DAEMONS]]''': <br />
<br />
1. The package '''kde''' is the official and complete vanilla KDE 4.2 residing under the Arch [extra] repo.<br />
<br />
Install base kde (kdm in kdebase-workstation): <br />
# pacman -S kdebase<br />
Install the whole: <br />
# pacman -S kde<br />
<br />
2. Alternatively, there exists a project called '''KDEmod''' (recently referred to collectively as the Chakra project). It is an Arch Linux exclusive, community-driven system, designed for modularity and offers a choice between KDE 3.5.10 or 4.x.x. KDEmod can be installed with pacman, after adding the proper repository to /etc/pacman.conf. The project website, including complete installation instructions, can be found at [http://kdemod.ath.cx/ http://kdemod.ath.cx/].<br />
<br />
=====Useful KDE DAEMONS=====<br />
<br />
Recall from above that a daemon is a program that runs in the background, waiting for events to occur and offering services.<br />
<br />
KDE will require the '''hal''' ('''H'''ardware '''A'''bstraction '''L'''ayer) daemon for optimal functionality. The hal daemon, among other things, will facilitate the automatic mounting of disks, optical drives, and USB drives/thumbdrives for use in the GUI. The hal package is installed when you install xorg-server, but must be invoked to become useful.<br />
<br />
The '''kdm''' daemon is the '''K''' '''D'''isplay '''M'''anager, which provides a '''graphical login''', if desired.<br />
<br />
-----<br />
<br />
Start hal:<br />
# /etc/rc.d/hal start<br />
<br />
{{Box Note|The hal daemon relies on, and will automatically start, the dbus daemon.}}<br />
Edit your DAEMONS array in /etc/rc.conf:<br />
# nano /etc/rc.conf<br />
Add '''hal''' to your DAEMONS array, to invoke it on boot. If you prefer a graphical login, add '''kdm''' as well: <br />
DAEMONS=(syslog-ng '''hal''' network crond alsa '''kdm''')<br />
{{Box Note|If you installed KDEmod3 instead of normal KDE, use kdm3 instead of kdm.}}<br />
<br />
*This method will start the system at runlevel 3, (/etc/inittab default, multiuser mode), and then start KDM as a daemon. <br />
<br />
*Some users prefer an alternative method of starting a display manager like KDM on boot by utilizing the /etc/inittab method and starting the system at runlevel 5. See [[Adding a login manager (KDM, GDM, or XDM) to automatically boot on startup]] for more.<br />
<br />
*If you prefer to log into the '''console''' at runlevel 3, and manually start X, leave out kdm, or comment it out with a bang, ( ! ).<br />
<br />
Now try starting your X Server as normal user:<br />
$ startx<br />
or<br />
$ xinit<br />
{{Tip|Advanced instructions for installing and configuring KDE can be found in the [[KDE]] article.}}<br />
<br />
Congratulations! Welcome to your KDE desktop environment on your new Arch Linux system! You may wish to continue by viewing '''[[Beginners Guide Appendix|The Beginners Guide Appendix]]''', or the rest of the information below. You may also be interested in the [[Post Installation Tips]] wiki article.<br />
<br />
====Xfce====<br />
=====About Xfce=====<br />
The cholesterol-free '''X''' environment. Xfce, like GNOME or KDE, is a desktop environment, but aims to be fast and lightweight while remaining visually appealing and easy to use. It contains a suite of apps like a root window app, window manager, file manager, panel, etc. Xfce is written using the GTK2 toolkit (like GNOME) and contains its own development environment (libraries, daemons, etc) similar to other big DEs. Unlike GNOME or KDE, Xfce is lightweight and designed more around CDE than Windows or Mac. It has a much slower development cycle, but is very stable and fast. Xfce is great for older hardware, and will perform excellently on newer machines as well.<br />
<br />
=====Installation=====<br />
Install Xfce: <br />
# pacman -S xfce4 <br />
You may also wish to install themes and extras:<br />
# pacman -S xfce4-goodies gtk2-themes-collection<br />
Note: '''xfce4-xfapplet-plugin''' (a plugin that allows the use of GNOME applets in the Xfce4 panel) is part of the '''xfce4-goodies''' group and depends on '''gnome-panel''', which in turn depends on '''gnome-desktop'''. You may wish to take this into consideration before installing, since it represents a significant number of extra dependencies.<br />
<br />
If you wish to admire 'Tips and Tricks' on login, install the '''fortune-mod''' package:<br />
# pacman -S fortune-mod<br />
<br />
=====Useful DAEMONS=====<br />
Recall from above that a daemon is a program that runs in the background, waiting for events to occur and offering services. Some Xfce users prefer to use the '''hal''' daemon. The hal daemon, among other things, will automate the mounting of disks, optical drives, and USB drives/thumbdrives for use in the GUI. The fam daemon will allow real-time representation of file alterations in the GUI, allowing instant access to recently installed programs, or changes in the file system. The hal and fam packages are installed when you install Xfce, but must be invoked to become useful.<br />
<br />
Start hal and fam:<br />
<br />
# /etc/rc.d/hal start<br />
<br />
# /etc/rc.d/fam start<br />
{{Box Note|The hal daemon relies on, and will automatically start, the dbus daemon.}}<br />
Edit your DAEMONS array in /etc/rc.conf:<br />
# nano /etc/rc.conf<br />
Add '''hal''' and '''fam''' to your DAEMONS array, to invoke them at boot.<br />
<br />
{{Tip|Advanced instructions for installing and configuring Xfce can be found in the [[Xfce]] article.}}<br />
<br />
If you wish to install one, see [[Adding a login manager (KDM, GDM, or XDM) to automatically boot on startup]]. Otherwise you can login in via the console and run:<br />
<br />
$ startxfce4<br />
<br />
Congratulations! Welcome to your Xfce desktop environment on your new Arch Linux system! You may also be interested in the [[Post Installation Tips]] wiki article.<br />
<br />
====LXDE====<br />
=====About LXDE=====<br />
LXDE, (for ''L''ightweight ''X''11 ''D''esktop ''E''nvironment), is a new project focused on providing a modern desktop environment which aims to be lightweight, fast, intuitive and functional while keeping system resource usage low. LXDE is quite different from other desktop environments, since each component of LXDE is a discrete and independent application, and each can be easily substituted by other programs. This modular design eliminates all unnecessary dependencies and provides more flexibility. Details and screenshots available at: http://lxde.org/ <br />
<br />
LXDE provides:<br />
# The OpenBox windowmanager<br />
# PCManFM File manager<br />
# LXpanel system panel<br />
# LXSession session manager<br />
# LXAppearance GTK+ theme switcher<br />
# GPicView image viewer<br />
# Leafpad simple text editor<br />
# XArchiver: Lightweight, fast, and desktop-independent gtk+-based file archiver<br />
# LXNM (still under development): Lightweight network manager for LXDE supporting wireless connections<br />
These lightweight and versatile tools combine for quick setup, modularity and simplicity.<br />
<br />
Install LXDE with: <br />
# pacman -S lxde<br />
Add:<br />
exec startlxde<br />
to your ~/.xinitrc and start with ''startx'' or ''xinit''<br />
<br />
{{Tip | Further information available at the [[LXDE]] wiki article.}}<br />
<br />
====*box====<br />
=====Fluxbox=====<br />
Fluxbox © is yet another windowmanager for X.<br />
It's based on the Blackbox 0.61.1 code. Fluxbox looks like blackbox and handles styles, colors, window placement and similar things exactly like blackbox (100% theme/style compability).<br />
<br />
Install Fluxbox using <br />
# pacman -S fluxbox fluxconf<br />
<br />
If you use gdm/kdm a new fluxbox session will be automatically added. Otherwise, you should modify your user's .xinitrc and add this to it:<br />
exec startfluxbox <br />
<br />
More information is available in the [[Fluxbox]] article.<br />
<br />
=====Openbox=====<br />
Openbox is a standards compliant, fast, light-weight, extensible window manager.<br />
<br />
Openbox works with your applications, and makes your desktop easier to manage. This is because the approach to its development was the opposite of what seems to be the general case for window managers. Openbox was written first to comply with standards and to work properly. Only when that was in place did the team turn to the visual interface.<br />
<br />
Openbox is fully functional as a stand-alone working environment, or can be used as a drop-in replacement for the default window manager in the GNOME or KDE desktop environments. <br />
<br />
Install openbox using<br />
# pacman -S openbox<br />
Additional configuration tools are also available, if desired:<br />
# pacman -S obconf obmenu<br />
<br />
Once openbox is installed you will get a message to move menu.xml & rc.xml to ~/.config/openbox/ in your home directory:<br />
# su - ''yourusername''<br />
$ mkdir -p ~/.config/openbox/<br />
$ cp /etc/xdg/openbox/rc.xml ~/.config/openbox/<br />
$ cp /etc/xdg/openbox/menu.xml ~/.config/openbox/<br />
<br />
'''rc.xml''' is the main configuration file for OpenBox. It may be manually edited, (or you can use OBconf). '''menu.xml''' configures the right-click menu.<br />
<br />
You may log into OpenBox via graphical login using KDM/GDM, or from the shell using '''startx''', in which case you will need to edit your ~/.xinitrc (as non-root user) and add the following:<br />
<br />
exec openbox-session<br />
<br />
NOTE: If you plan on running dbus (which is required by hal) then make sure your ~/.xinitrc reads:<br />
<br />
exec dbus-launch --exit-with-session openbox-session<br />
<br />
You may also start OpenBox from the shell using '''xinit''':<br />
$ xinit /usr/bin/openbox-session<br />
* Openbox may also be used as the window manager for GNOME, KDE, and Xfce.<br />
For KDM there is nothing left to do; openbox is listed in the sessions menu in KDM.<br />
<br />
Some useful, lightweight programs for OpenBox are:<br />
* PyPanel, Tint2, or LXpanel if you want a panel<br />
* feh if you want to set the background<br />
* ROX if you want a simple file manager (also provides simple icons)<br />
* PcmanFM a lightweight but versatile file manager (also provides desktop icon functionality)<br />
* iDesk (available in [[AUR]]) for providing desktop icons<br />
* Graveman for burning CD's or DVD's<br />
<br />
{{Tip | More information is available in the [[Openbox]] article.}}<br />
<br />
====fvwm2====<br />
FVWM is an extremely powerful ICCCM-compliant multiple virtual desktop window manager for the X Window system. Development is active, and support is excellent. <br />
<br />
Install fvwm2 with<br />
# pacman -S fvwm <br />
<br />
fvwm will automatically be listed in kdm/gdm in the sessions menu. Otherwise, add <br />
exec fvwm <br />
<br />
to your user's .xinitrc.<br />
<br />
==Useful Applications==<br />
To install useful apps, codecs and plugins, see [[Useful Applications]].<br />
<br />
=APPENDIX=<br />
See [[Beginners Guide Appendix]]</div>
Listdata
https://wiki.archlinux.org/index.php?title=Music_Player_Daemon&diff=69387
Music Player Daemon
2009-05-24T21:52:42Z
<p>Listdata: /* Multi-MPD Setup */ minor clarification about what happens when sharing some of the mpd config files across multiple MPD's</p>
<hr />
<div>[[Category:Audio/Video (English)]]<br />
[[Category:Daemons and system services (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|mpd}}<br />
{{i18n_entry|Polski|mpd (polski)}}<br />
{{i18n_entry|Nederlands|Music Player Daemon (Nederlands)}}<br />
{{i18n_entry|Русский|MPD - Music Player Daemon (Русский)}}<br />
{{i18n_entry|简体中文|MPD(简体中文)}}<br />
{{i18n_entry|Türkçe|MPD (Türkçe)}}<br />
{{i18n_links_end}}<br />
<br />
==What is mpd?==<br />
'''mpd''' (Music Player Daemon) is an audio player that has a server-client architecture. mpd runs in the background as a daemon, manages playlists and a music database, and uses very few resources. In order to interface with it, you need a separate client. More information can be found on their [http://www.musicpd.org/ website]<br />
<br />
==Daemon Install Procedure==<br />
<br />
Sync and install with pacman:<br />
# pacman -S mpd<br />
<br />
==Configure mpd==<br />
<br />
For more information about mpd configuration visit http://mpd.wikia.com/wiki/Configuration<br />
<br />
===Timeline of mpd's behavior on a typical working setup===<br />
* mpd is started on boot by /etc/rc.conf, by including it in the DAEMONS array. (Or, this can be done manually each session by running '''/etc/rc.d/mpd start''' with root privileges).<br />
* Since mpd is now started as root, it first reads the /etc/mpd.conf file.<br />
* mpd reads the user variable in the /etc/mpd.conf file, and changes from root to this user.<br />
* mpd then reads the contents of the /etc/mpd.conf file and configures itself accordingly.<br />
<br />
Notice that mpd changes the running user from root to the one named in the /etc/mpd.conf file. This way, uses of "~" in the configuration file point correctly to the home user's directory, and not root's directory. It may be worthwhile to change all uses of "~" to "/home/username" to avoid any confusion over this aspect of mpd's behavior.<br />
<br />
===Quick Single User Installation===<br />
<br />
* As root, check if ''/etc/mpd.conf'' exists and delete the file if it does. This is safe.<br />
<br />
Mpd comes with an example configuration file, available at ''/etc/mpd.conf.example''. This file holds an abundance of information on mpd configuration, and holds default mixer values you can simply uncomment.<br />
<br />
* As root, copy this example file to ''/etc/mpd.conf''.<br />
cp /etc/mpd.conf.example /etc/mpd.conf<br />
<br />
Never put this file in the user's directory like some tutorials suggest. This would complicate things and most of the time doing this is useless (notice you're reading a quick installation howto). If you previously created a .mpdconf file in your home, remove it now. This is important to prevent conflicts. When placing it in /etc, like we do here, mpd will be able to run as a daemon at boot. Otherwise, a script would be needed to run mpd AFTER the user has logged (like kdm or ~/.fluxbox/startup) or it would require a manual move each time. For a single music collection, the method used here is simply better, even while the collection is shared to multiple users. Also, don't be afraid about root privileges: even while mpd runs as a daemon, it never completely runs as root since it automatically drops its root privileges after execution.<br />
<br />
To make audio output actually work ensure that you have setup audio card and mixer correctly. See [[ALSA]]. Do not forget to unmute the required channels in alsamixer, raise the volume and save changes with alsactl store. See ~/.mpd/error if it still doesn't work.<br />
<br />
Make sure your card can do hardware mixing (most of them can, including onboard audio). Or else this could cause problems with multiple sound playback. For example, this can prevent Mplayer from playing back sound while the mpd daemon is running, returning an audio error message stating the device is busy.<br />
<br />
<br />
We can now move on to edit the file, once again, as root:<br />
# EDITOR /etc/mpd.conf<br />
<br />
===New Setup Instructions=== <br />
'''Keeps the setup in /var and uses "mpd" as default user instead of cluttering up ~/. This is the way the arch package is installed.'''<br />
music_directory "/home/user/music" <-- dir to your music collection. Read steps below carefully, permissions need to be set correctly.<br />
playlist_directory "/var/lib/mpd/playlists"<br />
db_file "/var/lib/mpd/db"<br />
log_file "/var/log/mpd/mpd.log"<br />
error_file "/var/log/mpd/mpd.error"<br />
pid_file "/var/run/mpd/mpd.pid"<br />
state_file "/var/lib/mpd/mpdstate"<br />
user "mpd"<br />
bind_to_address "127.0.0.1"<br />
port "6600"<br />
<br />
* Keep user as "mpd", double check to make sure user "mpd" home directory is set to /var/lib/mpd <br />
$ cat /etc/passwd | grep mpd<br />
* Also make sure /var/lib/mpd is owned by mpd:mpd.<br />
$ ls -l /var/lib/mpd<br />
* now as root create the files you specified in /etc/mpd.conf, if directories do not exist, create those as well.<br />
# touch /var/lib/mpd/db<br />
# touch /var/lib/mpd/mpdstate<br />
# touch /var/run/mpd/mpd.pid<br />
# touch /var/log/mpd/mpd.log<br />
# touch /var/log/mpd/mpd.error<br />
* MPD needs to have +x permissions on '''ALL''' parent directories to your music collection(IE. if it's located outisde of "mpd" home directory /var/lib/mpd). <br />
* By default useradd sets permissions on home dir to 1700 drwx------. So if your like me you will need to change permissions of /home/user <br />
* Example... my music collection is located /home/user/music. <br />
$ chmod a+x /home/user<br />
$ chmod -R a+x /home/user/music<br />
* Now change the ownership of the directories and files you created to user "mpd"<br />
# chown -R mpd:mpd /var/lib/mpd<br />
# chown -R mpd:mpd /var/run/mpd<br />
# chown -R mpd:mpd /var/log/mpd<br />
* If your music collection is contained under multiple dir. you can make symbolic link under /var/lib/mpd then set 'music_dir' in mpd.conf to the directory holding the symbolic links. Remeber to set permissions accordingly on the directories being linked. <br />
* Create mpd database as root.<br />
# mpd --create-db<br />
<br />
'''Continue below'''<br />
<br />
===Old setup instructions===<br />
<br />
'''Keeps setup in the ~/ directory of user. This is preferred way as many struggle with permissions running mpd as user "mpd"'''<br />
* In /etc/mpd.conf, look for these options and configure them as listed below: <br />
<br />
music_directory "~/Music"<br />
playlist_directory "~/Playlists"<br />
db_file "~/.mpd/db"<br />
log_file "~/.mpd/log"<br />
error_file "~/.mpd/error"<br />
pid_file "~/.mpd/mpd.pid"<br />
state_file "~/.mpd/mpdstate"<br />
user "mpd" (replace this with your username)<br />
bind_to_address "127.0.0.1"<br />
port "6600"<br />
#connection_timeout "60"<br />
#max_playlist_length "16384"<br />
#filesystem_charset "ISO-8859-1"<br />
#id3v1_encoding "ISO-8859-1"<br />
<br />
<br />
These are the most common lines. You shouldn't need anything else. You may want to change all paths to absolute paths, in order to avoid any ambiguities in the future in case you forget how mpd behaves (see above). See the file /etc/mpd.conf.example for more specific options.<br />
<br />
* Note: It might be advisable to add the following to /etc/mpd.conf so that, when changing the volume in an mpd client, the system wide volume isn't affected:<br />
mixer_type "software"<br />
* Look at the line starting with ''user'' and replace '''mpd''' with your username. Save changes and exit the editor.<br />
* Now exit the root mode and log as the normal user (the same you specified in mpd.conf).<br />
* Create the new directories<br />
$ mkdir ~/Music<br />
$ mkdir ~/Playlists<br />
$ mkdir ~/.mpd<br />
<br />
* Make symbolic links to your music collection:<br />
$ ln -s /media/sda5/music_collection1 ~/Music<br />
$ ln -s /media/sdb7/music_collection2 ~/Music<br />
<br />
* Create the pid file<br />
$ touch ~/.mpd/mpd.pid<br />
<br />
* Create the mpd database (This can take a while depending on the size of your collection.): <br />
$ mpd --create-db<br />
<br />
'''IF YOU FOLLOWED NEW INSTRUCTIONS, CONTINUE HERE.'''<br />
<br />
* Change back to root, and start mpd:<br />
$ /etc/rc.d/mpd start<br />
Although you can start mpd as root with just "mpd", doing the above gives more information (such as on '''htop''').<br />
<br />
* Edit '''/etc/rc.conf''' and add '''mpd''' to the list of daemons to start on bootup.<br />
<br />
* To test it out, install a very small client called mpc<br />
# pacman -S mpc (as root)<br />
$ mpc ls | mpc add (as user)<br />
$ mpc play<br />
<br />
{{Box Note | No sound? mpd's autodetection system may have failed to correctly detect your set-up, please scroll down to ''Troubleshooting''}}<br />
<br />
=== Alternative Setup ===<br />
'''Useful if you you want to run for example an icecast server.'''<br />
MPD neet not be started with root permissions. The only reason why MPD needs to be started as root (by being called from /etc/rc.conf) is because the default files and folders in the default configuration file points to directories owned by root (the /var directory). A less common, but perhaps more sensible, approach is to make MPD work with files and directories owned by a normal user. Running MPD as a normal user has several advantages: (1) can easily have a single directory ~/.mpd (or any other directory under /home/username) for all MPD configuration files, (2) no read/write permission errors, and (3) more flexible calls to MPD by using ~/.xinitrc instead of including 'mpd' in the /etc/rc.conf DAEMONS array.<br />
<br />
The following steps shows how to run MPD as a normal user.<br />
<br />
* Copy the contents of the default MPD configuration file in /etc/mpd.conf.example to your home directory. A good place would be "/home/usr/.mpd/config".<br />
* Follow the 'old setup instructions' from above, ignoring the first part about copying the config to /etc/mpd.conf. <br />
* Let MPD start on bootup by calling it from your ~/.xinitrc as follows:<br />
$ mpd /home/username/.mpd/config<br />
* Note that you don't have to put a "&" at the end of the line here, since MPD will automatically daemonize itself.<br />
<br />
Lastly, delete the entry 'mpd' from your DAEMONS array in /etc/rc.conf, as we are not running it as root anymore.<br />
<br />
====Multi-MPD Setup====<br />
<br />
If you want a second MPD daemon (e.g., with icecast output to share music over the network) to use the same music and playlist as the one above, simply copy the above configuration file and make a new file (e.g., /home/username/.mpd/config-icecast), and only change the log_file, error_file, pid_file, and state_file parameters (e.g., mpd-icecast.log, mpd-icecast.error, and so on); using the same directory paths for the music and playlist directories would ensure that this second MPD daemon would use the same music collection as your first one (e.g., creating and editing a playlist under the first daemon would affect the second daemon as well, so that you don't have to create the same playlists all over again for the second daemon). Then, call this second daemon the same way from your ~/.xinitrc above. (Just be sure to have a different port number, so as to not conflict with your first MPD daemon).<br />
<br />
==Troubleshooting==<br />
<br />
=== Autodetection failed ===<br />
<br />
During the start of mpd, it tries to autodetect your set-up and configure output and volume control accordingly. Though this mostly goes well, it will fail for some systems. It may help to tell mpd specifically what to use as output and mixer control. If you copied /etc/mpd.conf over from /etc/mpd.conf.example as mentionned above, you can simply uncomment:<br />
<br />
Example for alsa output type:<br />
audio_output {<br />
type "alsa"<br />
name "My ALSA Device"<br />
device "hw:0,0" # optional<br />
format "44100:16:2" # optional<br />
}<br />
<br />
Example for alsa mixer:<br />
mixer_type "alsa"<br />
mixer_device "default"<br />
mixer_control "PCM"<br />
<br />
'''Note:''' in case of permission problems when using ESD with mpd run this as root:<br />
# chsh -s /bin/true mpd<br />
<br />
===Tips===<br />
<br />
To get rid of timeouts (i.e. when you paused music for long time) in gpmc and other clients uncomment and increase <code>connection_timeout</code> option in mpd.conf.<br />
<br />
If files and/or titles are shown in wrong encoding, uncomment and change <code>filesystem_charset</code> and <code>id3v1_encoding</code> options.<br />
Note that you cannot set encoding for ID3 v2 tags. To workaround this you may use [http://mpd.wikia.com/wiki/GenericDecoder#Generic_Tagreader external tag readers].<br />
<br />
If you want to use another computer to control mpd over a network, the <code>bind_to_address</code> option in mpd.conf will need to be set to either your IP address, or <code>any</code> if your IP address changes frequently. Remember to add mpd to the /etc/hosts.allow file to enable external access.<br />
<br />
==Client Install Procedure==<br />
<br />
Install a client program for mpd. Popular options are:<br />
<br />
* '''mpc''' - Command Line Client (you'll probably want this one no matter what)<br />
* '''ncmpc''' - NCurses Client (this one is very handy for running in a console) [http://hem.bredband.net/kaw/ncmpc/ Official Website of ncmpc]<br />
* '''ncmpcpp''' - Clone of ncmpc with some new features written in C++ [http://unkart.ovh.org/ncmpcpp/ Official website of ncmpcpp]<br />
* '''sonata''' - Python GTK+ Client [http://sonata.berlios.de/ Official Website of Sonata]<br />
* '''gmpc''' - Gnome Client [http://gmpcwiki.sarine.nl/index.php?title=GMPC Official Website of gmpc]<br />
<br />
<br />
Install with:<br />
# pacman -Sy mpc<br />
# pacman -Sy ncmpc<br />
# pacman -Sy ncmpcpp<br />
# pacman -Sy sonata<br />
# pacman -Sy gmpc<br />
<br />
==Extra stuff==<br />
<br />
===Last.fm scrobbling===<br />
<br />
To scrobble your songs to [http://www.last.fm Last.fm] using MPD there are several alternatives.<br />
<br />
====mpdscribble====<br />
mpdscribble is another daemon, but is only available in the [http://aur.archlinux.org/packages.php?ID=22274 AUR]. This is arguably the best alternative, because it's the semi-official MPD scrobbler and uses the new "idle" feature in MPD for more accurate scrobbling. Also, you don't need root access to configure it, because it doesn't need any changes to <code>/etc</code> at all. Visit [http://mpd.wikia.com/wiki/Client:Mpdscribble the official website] for more information.<br />
<br />
To install mpdscribble, just install it from the AUR and do the following (not as root):<br />
<br />
* mkdir ~/.mpdscribble<br />
* Create the file ~/.mpdscribble/mpdscribble.conf and add the following:<br />
username = <your last.fm username><br />
password = <md5 sum of your last.fm password> # Generated using "echo -n password | md5sum"<br />
host = <your mpd host> # defaults to $MPD_HOST or localhost<br />
port = <your mpd port> # defaults to $MPD_PORT or 6600<br />
log = ~/.mpdscribble/mpdscribble.log<br />
cache = ~/.mpdscribble/mpdscribble.cache<br />
verbose = 2<br />
sleep = 1<br />
musicdir = <your music directory><br />
* Add <code>mpdscribble</code> to your <code>~/.xinitrc</code><br />
<br />
====Sonata====<br />
The easiest way, if you don't care about having to have a program window open all the time, is using Sonata which is a graphical frontend to MPD. It has built-in support for Last.fm scrobbling in its preferences. The downside of this is that Sonata doesn't cache your songs if for some reason you don't happen to have an Internet connection at the time of playing.<br />
<br />
====lastfmsubmitd====<br />
lastfmsubmitd is a daemon which is available in the "community" repository. To install it, first edit <code>/etc/lastfmsubmitd.conf</code> and add both <code>lastfmsubmitd</code> and <code>lastmp</code> to the <code>DAEMONS</code> array in <code>/etc/rc.conf</code>.<br />
<br />
===Last.fm playback with lastfmproxy===<br />
lastfmproxy is a python script that streams a last.fm music stream to another media player. To setup, install from aur <code>yaourt -S lastfmproxy</code> and then edit <code>/usr/share/lastfmproxy/config.py</code>. If you plan to only stream to mpd on the same host, just edit the login info.<br />
<br />
'''NOTE:''' Since it installs to a read only directory but it requires read/write access for features like saving previously listened to stations, it would be wise to copy <code>/usr/share/lastfmproxy</code> to your home directory.<br />
<br />
Start lastfmproxy with <code>lastfmproxy</code> and visit <code>http://localhost:1881/</code> in your web browser. To add a last.fm station navigate to <code>http://localhost:1881/</code> followed by the lastfm:// url. Example: <code>http://localhost:1881/lastfm://globaltags/punk</code>. Navigate back to <code>http://localhost:1881/</code> and download the m3u file by selecting the Start Listening link. Simply add it to your music library path.<br />
<br />
=== Never play on start ===<br />
If you don't want mpd to always play on your system start, but yet you want to preserve the other state information, add the following lines to your <code>/etc/rc.d/mpd</code> file:<br />
'' ...''<br />
'' stat_busy "Starting Music Player Daemon"''<br />
<br />
# always start in paused state<br />
awk '/^state_file[ \t]+"[^"]+"$/ {<br />
match($0, "\".+\"")<br />
sfile = substr($0, RSTART + 1, RLENGTH - 2)<br />
} /^user[ \t]+"[^"]+"$/ {<br />
match($0, "\".+\"")<br />
user = substr($0, RSTART + 1, RLENGTH - 2)<br />
} END {<br />
if (sfile == "")<br />
exit;<br />
if (user != "")<br />
sub(/^~/, "/home/" user, sfile)<br />
system("sed -i \x27s|^\\(state:[ \\t]\\{1,\\}\\)play$|\\1pause|\x27 \x27" sfile "\x27")<br />
}' /etc/mpd.conf<br />
<br />
'' /usr/bin/mpd /etc/mpd.conf &> /dev/null''<br />
'' ...''<br />
<br />
This will change the player status to "paused", if it was stopped while playing. Next, you want this file to be preserved, so mpd updates won't erase this edit. Add (or edit) this line to your <code>/etc/pacman.conf</code>:<br />
NoUpgrade = etc/rc.d/mpd<br />
<br />
=== MPD & Alsa ===<br />
<br />
Sometimes, when you use other audio output, e.g: some web pages containing Flash applets, mpd cannot reproduce anything anymore (until you restart). The error looks something like: (if you search the file /var/log/mpd/mpd.error)<br />
<br />
Error opening alsa device "hw:0,0": Device or resource busy<br />
<br />
And here is the solution (dmix saving our life again). Apply these lines in your /etc/mpd.conf:<br />
<br />
<pre><br />
audio_output {<br />
type "alsa"<br />
name "Sound Card"<br />
options "dev=dmixer"<br />
device "plug:dmix"<br />
}<br />
</pre><br />
<br />
And then restart with /etc/rc.d/mpd restart<br />
<br />
Searching on Internet I found the reason for why that happens in Gentoo's wiki:<br />
* The sound card does not support hardware mixing (uses '''dmix''' plugin)<br />
* An application does not work with ALSA with it's default settings<br />
<br />
====High CPU usage with ALSA====<br />
When using MPD with ALSA, users may experience MPD taking up lots of CPU (around 20-30%). This is caused by most sound cards supporting 48kHz and most music being 44kHz, thus forcing MPD to resample it. This operation takes lots of CPU cycles and results into high usage.<br />
<br />
For most users the problem should be solved by telling MPD not to use resampling by adding <code>auto_resample "no"</code> into audio_output-part of /etc/mpd.conf<br />
<br />
Example from mpd.conf:<br />
<br />
audio_output {<br />
type "alsa"<br />
name "My ALSA Device"<br />
auto_resample "no"<br />
}<br />
<br />
Some users might also want to tell dmix to use 44kHz as well. More info about tuning performance of your MPD can be found from: [http://mpd.wikia.com/wiki/Tuning MPD wiki]<br />
<br />
=== Control mpd with lirc ===<br />
There are already some clients designe for communications between lircd and mpd, however, as far as the practical use, they aren't very useful since their funcstions are limited.<br />
<br />
It's recommended to use mpc with irexec. mpc is a command line player which only sends the command to mpd and exits immediately, which is perfect for irexec, the command runner included in lirc. What irexec does is that it runs a specified command once received a remote control button.<br />
<br />
First of all, please setup your remotes as referred to the '''[[Lirc]]''' article.<br />
<br />
Edit your favored lirc startup configuration file, default location is '''~/.lircrc'''<br />
<br />
Fill the file with the following pattern:<br />
<br />
begin<br />
prog = irexec<br />
button = <button_name><br />
config = <command_to_run><br />
repeat = <0 or 1><br />
end<br />
<br />
An useful example:<br />
<br />
## irexec<br />
begin<br />
prog = irexec<br />
button = play_pause<br />
config = mpc toggle<br />
repeat = 0<br />
end<br />
<br />
begin<br />
prog = irexec<br />
button = stop<br />
config = mpc stop<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = previous<br />
config = mpc prev<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = next<br />
config = mpc next<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = volup<br />
config = mpc volume +2<br />
repeat = 1<br />
end<br />
begin<br />
prog = irexec<br />
button = voldown<br />
config = mpc volume -2<br />
repeat = 1<br />
end<br />
begin<br />
prog = irexec<br />
button = pbc<br />
config = mpc random<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = pdvd<br />
config = mpc update<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = right<br />
config = mpc seek +00:00:05<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = left<br />
config = mpc seek -00:00:05<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = up<br />
config = mpc seek +1%<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = down<br />
config = mpc seek -1%<br />
repeat = 0<br />
end<br />
<br />
There are more functions for mpc, run '''''man mpc''''' for more info.<br />
<br />
==External links==<br />
<br />
* [http://www.musicpd.org/ Official Web Site]<br />
* [http://mpd.wikia.com/wiki/Main_Page Official Wiki]<br />
* [http://mpd.wikia.com/wiki/Clients Sorted List of MPD Clients]<br />
* [http://www.musicpd.org/forum/ MPD forum]</div>
Listdata
https://wiki.archlinux.org/index.php?title=Music_Player_Daemon&diff=67513
Music Player Daemon
2009-04-25T07:34:46Z
<p>Listdata: /* Advanced Setup */</p>
<hr />
<div>[[Category:Audio/Video (English)]]<br />
[[Category:Daemons and system services (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|mpd}}<br />
{{i18n_entry|Polski|mpd (polski)}}<br />
{{i18n_entry|Nederlands|Music Player Daemon (Nederlands)}}<br />
{{i18n_entry|Русский|MPD - Music Player Daemon (Русский)}}<br />
{{i18n_entry|简体中文|MPD(简体中文)}}<br />
{{i18n_entry|Türkçe|MPD (Türkçe)}}<br />
{{i18n_links_end}}<br />
<br />
==What is mpd?==<br />
'''mpd''' (Music Player Daemon) is an audio player that has a server-client architecture. mpd runs in the background as a daemon, manages playlists and a music database, and uses very few resources. In order to interface with it, you need a separate client. More information can be found on their [http://www.musicpd.org/ website]<br />
<br />
==Daemon Install Procedure==<br />
<br />
Sync and install with pacman:<br />
# pacman -S mpd<br />
<br />
==Configure mpd==<br />
<br />
For more information about mpd configuration visit http://mpd.wikia.com/wiki/Configuration<br />
<br />
===Timeline of mpd's behavior on a typical working setup===<br />
* mpd is started on boot by /etc/rc.conf, by including it in the DAEMONS array. (Or, this can be done manually each session by running '''/etc/rc.d/mpd start''' with root privileges).<br />
* Since mpd is now started as root, it first reads the /etc/mpd.conf file.<br />
* mpd reads the user variable in the /etc/mpd.conf file, and changes from root to this user.<br />
* mpd then reads the contents of the /etc/mpd.conf file and configures itself accordingly.<br />
<br />
Notice that mpd changes the running user from root to the one named in the /etc/mpd.conf file. This way, uses of "~" in the configuration file point correctly to the home user's directory, and not root's directory. It may be worthwhile to change all uses of "~" to "/home/username" to avoid any confusion over this aspect of mpd's behavior.<br />
<br />
===Quick Single User Installation===<br />
<br />
* As root, check if ''/etc/mpd.conf'' exists and delete the file if it does. This is safe.<br />
<br />
Mpd comes with an example configuration file, available at ''/etc/mpd.conf.example''. This file holds an abundance of information on mpd configuration, and holds default mixer values you can simply uncomment.<br />
<br />
* As root, copy this example file to ''/etc/mpd.conf''.<br />
cp /etc/mpd.conf.example /etc/mpd.conf<br />
<br />
Never put this file in the user's directory like some tutorials suggest. This would complicate things and most of the time doing this is useless (notice you're reading a quick installation howto). If you previously created a .mpdconf file in your home, remove it now. This is important to prevent conflicts. When placing it in /etc, like we do here, mpd will be able to run as a daemon at boot. Otherwise, a script would be needed to run mpd AFTER the user has logged (like kdm or ~/.fluxbox/startup) or it would require a manual move each time. For a single music collection, the method used here is simply better, even while the collection is shared to multiple users. Also, don't be afraid about root privileges: even while mpd runs as a daemon, it never completely runs as root since it automatically drops its root privileges after execution.<br />
<br />
To make audio output actually work ensure that you have setup audio card and mixer correctly. See [[ALSA]]. Do not forget to unmute the required channels in alsamixer, raise the volume and save changes with alsactl store. See ~/.mpd/error if it still doesn't work.<br />
<br />
Make sure your card can do hardware mixing (most of them can, including onboard audio). Or else this could cause problems with multiple sound playback. For example, this can prevent Mplayer from playing back sound while the mpd daemon is running, returning an audio error message stating the device is busy.<br />
<br />
<br />
We can now move on to edit the file, once again, as root:<br />
$EDITOR /etc/mpd.conf<br />
<br />
* In /etc/mpd.conf, look for these options and configure them as listed below: <br />
<br />
music_directory "~/Music"<br />
playlist_directory "~/Playlists"<br />
db_file "~/.mpd/db"<br />
log_file "~/.mpd/log"<br />
error_file "~/.mpd/error"<br />
pid_file "~/.mpd/mpd.pid"<br />
state_file "~/.mpd/mpdstate"<br />
user "mpd" (replace this with your username)<br />
bind_to_address "127.0.0.1"<br />
port "6600"<br />
#connection_timeout "60"<br />
#max_playlist_length "16384"<br />
#filesystem_charset "ISO-8859-1"<br />
#id3v1_encoding "ISO-8859-1"<br />
<br />
<br />
These are the most common lines. You shouldn't need anything else. You may want to change all paths to absolute paths, in order to avoid any ambiguities in the future in case you forget how mpd behaves (see above). See the file /etc/mpd.conf.example for more specific options.<br />
<br />
* Note: It might be advisable to add the following to /etc/mpd.conf so that, when changing the volume in an mpd client, the system wide volume isn't affected:<br />
mixer_type "software"<br />
<br />
* Look at the line starting with ''user'' and replace '''mpd''' with your username. Save changes and exit the editor.<br />
* Now exit the root mode and log as the normal user (the same you specified in mpd.conf).<br />
* Create the new directories<br />
$ mkdir ~/Music<br />
$ mkdir ~/Playlists<br />
$ mkdir ~/.mpd<br />
<br />
* Make symbolic links to your music collection:<br />
$ ln -s /media/sda5/music_collection1 ~/Music<br />
$ ln -s /media/sdb7/music_collection2 ~/Music<br />
<br />
* Create the pid file<br />
$ touch ~/.mpd/mpd.pid<br />
<br />
* Create the mpd database (This can take a while depending on the size of your collection.): <br />
$ mpd --create-db<br />
<br />
* Change back to root, and start mpd:<br />
$ /etc/rc.d/mpd start<br />
Although you can start mpd as root with just "mpd", doing the above gives more information (such as on '''htop''').<br />
<br />
* Edit '''/etc/rc.conf''' and add '''mpd''' to the list of daemons to start on bootup.<br />
<br />
* To test it out, install a very small client called mpc<br />
# pacman -S mpc (as root)<br />
$ mpc ls | mpc add (as user)<br />
$ mpc play<br />
<br />
{{Box Note | No sound? mpd's autodetection system may have failed to correctly detect your set-up, please scroll down to ''Troubleshooting''}}<br />
<br />
=== Advanced Setup ===<br />
MPD neet not be started with root permissions. The only reason why MPD needs to be started as root (by being called from /etc/rc.conf) is because the default files and folders in the default configuration file points to directories owned by root (the /var directory). A less common, but perhaps more sensible, approach is to make MPD work with files and directories owned by a normal user. Running MPD as a normal user has several advantages: (1) can easily have a single directory ~/.mpd (or any other directory under /home/username) for all MPD configuration files, (2) no read/write permission errors, and (3) more flexible calls to MPD by using ~/.xinitrc instead of including 'mpd' in the /etc/rc.conf DAEMONS array.<br />
<br />
The following steps shows how to run MPD as a normal user.<br />
<br />
First, copy the contents of the default MPD configuration file in /etc/mpd.conf.example to your home directory. A good place would be "/home/usr/.mpd/config".<br />
Second, make sure the relevant variables point to this ~/.mpd directory, as follows: <br />
music_directory "/home/username/.mpd/music" # can be ~/.mpd/music for brevity<br />
playlist_directory "/home/username/.mpd/playlist"<br />
db_file "/home/username/.mpd/mpd.db"<br />
log_file "/home/username/.mpd/mpd.log"<br />
error_file "/home/username/.mpd/mpd.error"<br />
pid_file "/home/username/.mpd/mpd.pid"<br />
state_file "/home/username/.mpd/mpdstate"<br />
user "username"<br />
The only thing that must exist with the above setup is the ~/.mpd directory, along with ~/.mpd/music and ~/.mpd/playlist. This is because any file that does not yet exist (mpd.db, mpd.log, etc.) can be created by MPD automatically, since the target directory/files all reside under the normal user's home directory.<br />
<br />
Third, let MPD start on bootup by calling it from your ~/.xinitrc as follows:<br />
mpd /home/username/.mpd/config<br />
Note that you don't have to put a "&" at the end of the line here, since MPD will automatically daemonize itself.<br />
<br />
Lastly, delete the entry 'mpd' from your DAEMONS array in /etc/rc.conf, as we are not running it as root anymore.<br />
<br />
====Multi-MPD Setup====<br />
<br />
If you want a second MPD daemon (e.g., with icecast output to share music over the network) to use the same music and playlist as the one above, simply copy the above configuration file and make a new file (e.g., /home/username/.mpd/config-icecast), and only change the log_file, error_file, pid_file, and state_file parameters (e.g., mpd-icecast.log, mpd-icecast.error, and so on); using the same directory paths for the music and playlist directories would ensure that this second MPD daemon would use the same music collection as your first one. Then, call this second daemon the same way from your ~/.xinitrc above. (Just be sure to have a different port number, so as to not conflict with your first MPD daemon).<br />
<br />
==Troubleshooting==<br />
<br />
=== Autodetection failed ===<br />
<br />
During the start of mpd, it tries to autodetect your set-up and configure output and volume control accordingly. Though this mostly goes well, it will fail for some systems. It may help to tell mpd specifically what to use as output and mixer control. If you copied /etc/mpd.conf over from /etc/mpd.conf.example as mentionned above, you can simply uncomment:<br />
<br />
Example for alsa output type:<br />
audio_output {<br />
type "alsa"<br />
name "My ALSA Device"<br />
device "hw:0,0" # optional<br />
format "44100:16:2" # optional<br />
}<br />
<br />
Example for alsa mixer:<br />
mixer_type "alsa"<br />
mixer_device "default"<br />
mixer_control "PCM"<br />
<br />
'''Note:''' in case of permission problems when using ESD with mpd run this as root:<br />
# chsh -s /bin/true mpd<br />
<br />
===Tips===<br />
<br />
To get rid of timeouts (i.e. when you paused music for long time) in gpmc and other clients uncomment and increase <code>connection_timeout</code> option in mpd.conf.<br />
<br />
If files and/or titles are shown in wrong encoding, uncomment and change <code>filesystem_charset</code> and <code>id3v1_encoding</code> options.<br />
Note that you cannot set encoding for ID3 v2 tags. To workaround this you may use [http://mpd.wikia.com/wiki/GenericDecoder#Generic_Tagreader external tag readers].<br />
<br />
If you want to use another computer to control mpd over a network, the <code>bind_to_address</code> option in mpd.conf will need to be set to either your IP address, or <code>any</code> if your IP address changes frequently. Remember to add mpd to the /etc/hosts.allow file to enable external access.<br />
<br />
==Client Install Procedure==<br />
<br />
Install a client program for mpd. Popular options are:<br />
<br />
* '''mpc''' - Command Line Client (you'll probably want this one no matter what)<br />
* '''ncmpc''' - NCurses Client (this one is very handy for running in a console) [http://hem.bredband.net/kaw/ncmpc/ Official Website of ncmpc]<br />
* '''ncmpcpp''' - Clone of ncmpc with some new features written in C++ [http://unkart.ovh.org/ncmpcpp/ Official website of ncmpcpp]<br />
* '''sonata''' - Python GTK+ Client [http://sonata.berlios.de/ Official Website of Sonata]<br />
* '''gmpc''' - Gnome Client [http://gmpcwiki.sarine.nl/index.php?title=GMPC Official Website of gmpc]<br />
<br />
<br />
Install with:<br />
# pacman -Sy mpc<br />
# pacman -Sy ncmpc<br />
# pacman -Sy ncmpcpp<br />
# pacman -Sy sonata<br />
# pacman -Sy gmpc<br />
<br />
==Extra stuff==<br />
<br />
===Last.fm scrobbling===<br />
<br />
To scrobble your songs to [http://www.last.fm Last.fm] using MPD there are several alternatives.<br />
<br />
====mpdscribble====<br />
mpdscribble is another daemon, but is only available in the [http://aur.archlinux.org/packages.php?ID=22274 AUR]. This is arguably the best alternative, because it's the semi-official MPD scrobbler and uses the new "idle" feature in MPD for more accurate scrobbling. Also, you don't need root access to configure it, because it doesn't need any changes to <code>/etc</code> at all. Visit [http://mpd.wikia.com/wiki/Client:Mpdscribble the official website] for more information.<br />
<br />
To install mpdscribble, just install it from the AUR and do the following (not as root):<br />
<br />
* mkdir ~/.mpdscribble<br />
* Create the file ~/.mpdscribble/mpdscribble.conf and add the following:<br />
username = <your last.fm username><br />
password = <md5 sum of your last.fm password> # Generated using "echo -n password | md5sum"<br />
host = <your mpd host> # defaults to $MPD_HOST or localhost<br />
port = <your mpd port> # defaults to $MPD_PORT or 6600<br />
log = ~/.mpdscribble/mpdscribble.log<br />
cache = ~/.mpdscribble/mpdscribble.cache<br />
verbose = 2<br />
sleep = 1<br />
musicdir = <your music directory><br />
* Add <code>mpdscribble</code> to your <code>~/.xinitrc</code><br />
<br />
====Sonata====<br />
The easiest way, if you don't care about having to have a program window open all the time, is using Sonata which is a graphical frontend to MPD. It has built-in support for Last.fm scrobbling in its preferences. The downside of this is that Sonata doesn't cache your songs if for some reason you don't happen to have an Internet connection at the time of playing.<br />
<br />
====lastfmsubmitd====<br />
lastfmsubmitd is a daemon which is available in the "community" repository. To install it, first edit <code>/etc/lastfmsubmitd.conf</code> and add both <code>lastfmsubmitd</code> and <code>lastmp</code> to the <code>DAEMONS</code> array in <code>/etc/rc.conf</code>.<br />
<br />
===Last.fm playback with lastfmproxy===<br />
lastfmproxy is a python script that streams a last.fm music stream to another media player. To setup, install from aur <code>yaourt -S lastfmproxy</code> and then edit <code>/usr/share/lastfmproxy/config.py</code>. If you plan to only stream to mpd on the same host, just edit the login info.<br />
<br />
'''NOTE:''' Since it installs to a read only directory but it requires read/write access for features like saving previously listened to stations, it would be wise to copy <code>/usr/share/lastfmproxy</code> to your home directory.<br />
<br />
Start lastfmproxy with <code>lastfmproxy</code> and visit <code>http://localhost:1881/</code> in your web browser. To add a last.fm station navigate to <code>http://localhost:1881/</code> followed by the lastfm:// url. Example: <code>http://localhost:1881/lastfm://globaltags/punk</code>. Navigate back to <code>http://localhost:1881/</code> and download the m3u file by selecting the Start Listening link. Simply add it to your music library path.<br />
<br />
=== Never play on start ===<br />
If you don't want mpd to always play on your system start, but yet you want to preserve the other state information, add the following lines to your <code>/etc/rc.d/mpd</code> file:<br />
'' ...''<br />
'' stat_busy "Starting Music Player Daemon"''<br />
<br />
# always start in paused state<br />
awk '/^state_file[ \t]+"[^"]+"$/ {<br />
match($0, "\".+\"")<br />
sfile = substr($0, RSTART + 1, RLENGTH - 2)<br />
} /^user[ \t]+"[^"]+"$/ {<br />
match($0, "\".+\"")<br />
user = substr($0, RSTART + 1, RLENGTH - 2)<br />
} END {<br />
if (sfile == "")<br />
exit;<br />
if (user != "")<br />
sub(/^~/, "/home/" user, sfile)<br />
system("sed -i \x27s|^\\(state:[ \\t]\\{1,\\}\\)play$|\\1pause|\x27 \x27" sfile "\x27")<br />
}' /etc/mpd.conf<br />
<br />
'' /usr/bin/mpd /etc/mpd.conf &> /dev/null''<br />
'' ...''<br />
<br />
This will change the player status to "paused", if it was stopped while playing. Next, you want this file to be preserved, so mpd updates won't erase this edit. Add (or edit) this line to your <code>/etc/pacman.conf</code>:<br />
NoUpgrade = etc/rc.d/mpd<br />
<br />
=== MPD & Alsa ===<br />
<br />
Sometimes, when you use other audio output, e.g: some web pages containing Flash applets, mpd cannot reproduce anything anymore (until you restart). The error looks something like: (if you search the file /var/log/mpd/mpd.error)<br />
<br />
Error opening alsa device "hw:0,0": Device or resource busy<br />
<br />
And here is the solution (dmix saving our life again). Apply these lines in your /etc/mpd.conf:<br />
<br />
<pre><br />
audio_output {<br />
type "alsa"<br />
name "Sound Card"<br />
options "dev=dmixer"<br />
device "plug:dmix"<br />
}<br />
</pre><br />
<br />
And then restart with /etc/rc.d/mpd restart<br />
<br />
Searching on Internet I found the reason for why that happens in Gentoo's wiki:<br />
* The sound card does not support hardware mixing (uses '''dmix''' plugin)<br />
* An application does not work with ALSA with it's default settings<br />
<br />
====High CPU usage with ALSA====<br />
When using MPD with ALSA, users may experience MPD taking up lots of CPU (around 20-30%). This is caused by most sound cards supporting 48kHz and most music being 44kHz, thus forcing MPD to resample it. This operation takes lots of CPU cycles and results into high usage.<br />
<br />
For most users the problem should be solved by telling MPD not to use resampling by adding <code>auto_resample "no"</code> into audio_output-part of /etc/mpd.conf<br />
<br />
Example from mpd.conf:<br />
<br />
audio_output {<br />
type "alsa"<br />
name "My ALSA Device"<br />
auto_resample "no"<br />
}<br />
<br />
Some users might also want to tell dmix to use 44kHz as well. More info about tuning performance of your MPD can be found from: [http://mpd.wikia.com/wiki/Tuning MPD wiki]<br />
<br />
=== Control mpd with lirc ===<br />
There are already some clients designe for communications between lircd and mpd, however, as far as the practical use, they aren't very useful since their funcstions are limited.<br />
<br />
It's recommended to use mpc with irexec. mpc is a command line player which only sends the command to mpd and exits immediately, which is perfect for irexec, the command runner included in lirc. What irexec does is that it runs a specified command once received a remote control button.<br />
<br />
First of all, please setup your remotes as referred to the '''[[Lirc]]''' article.<br />
<br />
Edit your favored lirc startup configuration file, default location is '''~/.lircrc'''<br />
<br />
Fill the file with the following pattern:<br />
<br />
begin<br />
prog = irexec<br />
button = <button_name><br />
config = <command_to_run><br />
repeat = <0 or 1><br />
end<br />
<br />
An useful example:<br />
<br />
## irexec<br />
begin<br />
prog = irexec<br />
button = play_pause<br />
config = mpc toggle<br />
repeat = 0<br />
end<br />
<br />
begin<br />
prog = irexec<br />
button = stop<br />
config = mpc stop<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = previous<br />
config = mpc prev<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = next<br />
config = mpc next<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = volup<br />
config = mpc volume +2<br />
repeat = 1<br />
end<br />
begin<br />
prog = irexec<br />
button = voldown<br />
config = mpc volume -2<br />
repeat = 1<br />
end<br />
begin<br />
prog = irexec<br />
button = pbc<br />
config = mpc random<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = pdvd<br />
config = mpc update<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = right<br />
config = mpc seek +00:00:05<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = left<br />
config = mpc seek -00:00:05<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = up<br />
config = mpc seek +1%<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = down<br />
config = mpc seek -1%<br />
repeat = 0<br />
end<br />
<br />
There are more functions for mpc, run '''''man mpc''''' for more info.<br />
<br />
==External links==<br />
<br />
* [http://www.musicpd.org/ Official Web Site]<br />
* [http://mpd.wikia.com/wiki/Main_Page Official Wiki]<br />
* [http://mpd.wikia.com/wiki/Clients Sorted List of MPD Clients]<br />
* [http://www.musicpd.org/forum/ MPD forum]</div>
Listdata
https://wiki.archlinux.org/index.php?title=Music_Player_Daemon&diff=67512
Music Player Daemon
2009-04-25T07:34:11Z
<p>Listdata: /* Advanced Setup */ forgot to mention that the music and playlist directories must also exist</p>
<hr />
<div>[[Category:Audio/Video (English)]]<br />
[[Category:Daemons and system services (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|mpd}}<br />
{{i18n_entry|Polski|mpd (polski)}}<br />
{{i18n_entry|Nederlands|Music Player Daemon (Nederlands)}}<br />
{{i18n_entry|Русский|MPD - Music Player Daemon (Русский)}}<br />
{{i18n_entry|简体中文|MPD(简体中文)}}<br />
{{i18n_entry|Türkçe|MPD (Türkçe)}}<br />
{{i18n_links_end}}<br />
<br />
==What is mpd?==<br />
'''mpd''' (Music Player Daemon) is an audio player that has a server-client architecture. mpd runs in the background as a daemon, manages playlists and a music database, and uses very few resources. In order to interface with it, you need a separate client. More information can be found on their [http://www.musicpd.org/ website]<br />
<br />
==Daemon Install Procedure==<br />
<br />
Sync and install with pacman:<br />
# pacman -S mpd<br />
<br />
==Configure mpd==<br />
<br />
For more information about mpd configuration visit http://mpd.wikia.com/wiki/Configuration<br />
<br />
===Timeline of mpd's behavior on a typical working setup===<br />
* mpd is started on boot by /etc/rc.conf, by including it in the DAEMONS array. (Or, this can be done manually each session by running '''/etc/rc.d/mpd start''' with root privileges).<br />
* Since mpd is now started as root, it first reads the /etc/mpd.conf file.<br />
* mpd reads the user variable in the /etc/mpd.conf file, and changes from root to this user.<br />
* mpd then reads the contents of the /etc/mpd.conf file and configures itself accordingly.<br />
<br />
Notice that mpd changes the running user from root to the one named in the /etc/mpd.conf file. This way, uses of "~" in the configuration file point correctly to the home user's directory, and not root's directory. It may be worthwhile to change all uses of "~" to "/home/username" to avoid any confusion over this aspect of mpd's behavior.<br />
<br />
===Quick Single User Installation===<br />
<br />
* As root, check if ''/etc/mpd.conf'' exists and delete the file if it does. This is safe.<br />
<br />
Mpd comes with an example configuration file, available at ''/etc/mpd.conf.example''. This file holds an abundance of information on mpd configuration, and holds default mixer values you can simply uncomment.<br />
<br />
* As root, copy this example file to ''/etc/mpd.conf''.<br />
cp /etc/mpd.conf.example /etc/mpd.conf<br />
<br />
Never put this file in the user's directory like some tutorials suggest. This would complicate things and most of the time doing this is useless (notice you're reading a quick installation howto). If you previously created a .mpdconf file in your home, remove it now. This is important to prevent conflicts. When placing it in /etc, like we do here, mpd will be able to run as a daemon at boot. Otherwise, a script would be needed to run mpd AFTER the user has logged (like kdm or ~/.fluxbox/startup) or it would require a manual move each time. For a single music collection, the method used here is simply better, even while the collection is shared to multiple users. Also, don't be afraid about root privileges: even while mpd runs as a daemon, it never completely runs as root since it automatically drops its root privileges after execution.<br />
<br />
To make audio output actually work ensure that you have setup audio card and mixer correctly. See [[ALSA]]. Do not forget to unmute the required channels in alsamixer, raise the volume and save changes with alsactl store. See ~/.mpd/error if it still doesn't work.<br />
<br />
Make sure your card can do hardware mixing (most of them can, including onboard audio). Or else this could cause problems with multiple sound playback. For example, this can prevent Mplayer from playing back sound while the mpd daemon is running, returning an audio error message stating the device is busy.<br />
<br />
<br />
We can now move on to edit the file, once again, as root:<br />
$EDITOR /etc/mpd.conf<br />
<br />
* In /etc/mpd.conf, look for these options and configure them as listed below: <br />
<br />
music_directory "~/Music"<br />
playlist_directory "~/Playlists"<br />
db_file "~/.mpd/db"<br />
log_file "~/.mpd/log"<br />
error_file "~/.mpd/error"<br />
pid_file "~/.mpd/mpd.pid"<br />
state_file "~/.mpd/mpdstate"<br />
user "mpd" (replace this with your username)<br />
bind_to_address "127.0.0.1"<br />
port "6600"<br />
#connection_timeout "60"<br />
#max_playlist_length "16384"<br />
#filesystem_charset "ISO-8859-1"<br />
#id3v1_encoding "ISO-8859-1"<br />
<br />
<br />
These are the most common lines. You shouldn't need anything else. You may want to change all paths to absolute paths, in order to avoid any ambiguities in the future in case you forget how mpd behaves (see above). See the file /etc/mpd.conf.example for more specific options.<br />
<br />
* Note: It might be advisable to add the following to /etc/mpd.conf so that, when changing the volume in an mpd client, the system wide volume isn't affected:<br />
mixer_type "software"<br />
<br />
* Look at the line starting with ''user'' and replace '''mpd''' with your username. Save changes and exit the editor.<br />
* Now exit the root mode and log as the normal user (the same you specified in mpd.conf).<br />
* Create the new directories<br />
$ mkdir ~/Music<br />
$ mkdir ~/Playlists<br />
$ mkdir ~/.mpd<br />
<br />
* Make symbolic links to your music collection:<br />
$ ln -s /media/sda5/music_collection1 ~/Music<br />
$ ln -s /media/sdb7/music_collection2 ~/Music<br />
<br />
* Create the pid file<br />
$ touch ~/.mpd/mpd.pid<br />
<br />
* Create the mpd database (This can take a while depending on the size of your collection.): <br />
$ mpd --create-db<br />
<br />
* Change back to root, and start mpd:<br />
$ /etc/rc.d/mpd start<br />
Although you can start mpd as root with just "mpd", doing the above gives more information (such as on '''htop''').<br />
<br />
* Edit '''/etc/rc.conf''' and add '''mpd''' to the list of daemons to start on bootup.<br />
<br />
* To test it out, install a very small client called mpc<br />
# pacman -S mpc (as root)<br />
$ mpc ls | mpc add (as user)<br />
$ mpc play<br />
<br />
{{Box Note | No sound? mpd's autodetection system may have failed to correctly detect your set-up, please scroll down to ''Troubleshooting''}}<br />
<br />
=== Advanced Setup ===<br />
MPD neet not be started with root permissions. The only reason why MPD needs to be started as root (by being called from /etc/rc.conf) is because the default files and folders in the default configuration file points to directories owned by root (the /var directory). A less common, but perhaps more sensible, approach is to make MPD work with files and directories owned by a normal user. Running MPD as a normal user has several advantages: (1) can easily have a single directory ~/.mpd (or any other directory under /home/username) for all MPD configuration files, (2) no read/write permission errors, and (3) more flexible calls to MPD by using ~/.xinitrc instead of including 'mpd' in the /etc/rc.conf DAEMONS array.<br />
<br />
The following steps shows how to run MPD as a normal user.<br />
<br />
First, copy the contents of the default MPD configuration file in /etc/mpd.conf.example to your home directory. A good place would be "/home/usr/.mpd/config".<br />
Second, make sure the relevant variables point to this ~/.mpd directory, as follows: <br />
music_directory "/home/username/.mpd/music" # can be ~/.mpd/music for brevity<br />
playlist_directory "/home/username/.mpd/playlist"<br />
db_file "/home/username/.mpd/mpd.db"<br />
log_file "/home/username/.mpd/mpd.log"<br />
error_file "/home/username/.mpd/mpd.error"<br />
pid_file "/home/username/.mpd/mpd.pid"<br />
state_file "/home/username/.mpd/mpdstate"<br />
user "username"<br />
The only thing that must exist with the above setup is the ~/.mpd directory, along with ~/.mpd/music and ~/.mpd/playlist. This is because any file that does not yet exist (mpd.db, mpd.log, etc.) can be created by MPD automatically, since the target directory/files all reside under the normal user's home directory.<br />
<br />
Third, let MPD start on bootup by calling it from your ~/.xinitrc as follows:<br />
mpd /home/username/.mpd/config<br />
Note that you don't have to put a "&" at the end of the line here, since MPD will automatically daemonize itself.<br />
<br />
Lastly, delete the entry 'mpd' from your DAEMONS array in /etc/rc.conf, as we are not running it as root anymore.<br />
<br />
If you want a second MPD daemon (e.g., with icecast output to share music over the network) to use the same music and playlist as the one above, simply copy the above configuration file and make a new file (e.g., /home/username/.mpd/config-icecast), and only change the log_file, error_file, pid_file, and state_file parameters (e.g., mpd-icecast.log, mpd-icecast.error, and so on); using the same directory paths for the music and playlist directories would ensure that this second MPD daemon would use the same music collection as your first one. Then, call this second daemon the same way from your ~/.xinitrc above. (Just be sure to have a different port number, so as to not conflict with your first MPD daemon).<br />
<br />
==Troubleshooting==<br />
<br />
=== Autodetection failed ===<br />
<br />
During the start of mpd, it tries to autodetect your set-up and configure output and volume control accordingly. Though this mostly goes well, it will fail for some systems. It may help to tell mpd specifically what to use as output and mixer control. If you copied /etc/mpd.conf over from /etc/mpd.conf.example as mentionned above, you can simply uncomment:<br />
<br />
Example for alsa output type:<br />
audio_output {<br />
type "alsa"<br />
name "My ALSA Device"<br />
device "hw:0,0" # optional<br />
format "44100:16:2" # optional<br />
}<br />
<br />
Example for alsa mixer:<br />
mixer_type "alsa"<br />
mixer_device "default"<br />
mixer_control "PCM"<br />
<br />
'''Note:''' in case of permission problems when using ESD with mpd run this as root:<br />
# chsh -s /bin/true mpd<br />
<br />
===Tips===<br />
<br />
To get rid of timeouts (i.e. when you paused music for long time) in gpmc and other clients uncomment and increase <code>connection_timeout</code> option in mpd.conf.<br />
<br />
If files and/or titles are shown in wrong encoding, uncomment and change <code>filesystem_charset</code> and <code>id3v1_encoding</code> options.<br />
Note that you cannot set encoding for ID3 v2 tags. To workaround this you may use [http://mpd.wikia.com/wiki/GenericDecoder#Generic_Tagreader external tag readers].<br />
<br />
If you want to use another computer to control mpd over a network, the <code>bind_to_address</code> option in mpd.conf will need to be set to either your IP address, or <code>any</code> if your IP address changes frequently. Remember to add mpd to the /etc/hosts.allow file to enable external access.<br />
<br />
==Client Install Procedure==<br />
<br />
Install a client program for mpd. Popular options are:<br />
<br />
* '''mpc''' - Command Line Client (you'll probably want this one no matter what)<br />
* '''ncmpc''' - NCurses Client (this one is very handy for running in a console) [http://hem.bredband.net/kaw/ncmpc/ Official Website of ncmpc]<br />
* '''ncmpcpp''' - Clone of ncmpc with some new features written in C++ [http://unkart.ovh.org/ncmpcpp/ Official website of ncmpcpp]<br />
* '''sonata''' - Python GTK+ Client [http://sonata.berlios.de/ Official Website of Sonata]<br />
* '''gmpc''' - Gnome Client [http://gmpcwiki.sarine.nl/index.php?title=GMPC Official Website of gmpc]<br />
<br />
<br />
Install with:<br />
# pacman -Sy mpc<br />
# pacman -Sy ncmpc<br />
# pacman -Sy ncmpcpp<br />
# pacman -Sy sonata<br />
# pacman -Sy gmpc<br />
<br />
==Extra stuff==<br />
<br />
===Last.fm scrobbling===<br />
<br />
To scrobble your songs to [http://www.last.fm Last.fm] using MPD there are several alternatives.<br />
<br />
====mpdscribble====<br />
mpdscribble is another daemon, but is only available in the [http://aur.archlinux.org/packages.php?ID=22274 AUR]. This is arguably the best alternative, because it's the semi-official MPD scrobbler and uses the new "idle" feature in MPD for more accurate scrobbling. Also, you don't need root access to configure it, because it doesn't need any changes to <code>/etc</code> at all. Visit [http://mpd.wikia.com/wiki/Client:Mpdscribble the official website] for more information.<br />
<br />
To install mpdscribble, just install it from the AUR and do the following (not as root):<br />
<br />
* mkdir ~/.mpdscribble<br />
* Create the file ~/.mpdscribble/mpdscribble.conf and add the following:<br />
username = <your last.fm username><br />
password = <md5 sum of your last.fm password> # Generated using "echo -n password | md5sum"<br />
host = <your mpd host> # defaults to $MPD_HOST or localhost<br />
port = <your mpd port> # defaults to $MPD_PORT or 6600<br />
log = ~/.mpdscribble/mpdscribble.log<br />
cache = ~/.mpdscribble/mpdscribble.cache<br />
verbose = 2<br />
sleep = 1<br />
musicdir = <your music directory><br />
* Add <code>mpdscribble</code> to your <code>~/.xinitrc</code><br />
<br />
====Sonata====<br />
The easiest way, if you don't care about having to have a program window open all the time, is using Sonata which is a graphical frontend to MPD. It has built-in support for Last.fm scrobbling in its preferences. The downside of this is that Sonata doesn't cache your songs if for some reason you don't happen to have an Internet connection at the time of playing.<br />
<br />
====lastfmsubmitd====<br />
lastfmsubmitd is a daemon which is available in the "community" repository. To install it, first edit <code>/etc/lastfmsubmitd.conf</code> and add both <code>lastfmsubmitd</code> and <code>lastmp</code> to the <code>DAEMONS</code> array in <code>/etc/rc.conf</code>.<br />
<br />
===Last.fm playback with lastfmproxy===<br />
lastfmproxy is a python script that streams a last.fm music stream to another media player. To setup, install from aur <code>yaourt -S lastfmproxy</code> and then edit <code>/usr/share/lastfmproxy/config.py</code>. If you plan to only stream to mpd on the same host, just edit the login info.<br />
<br />
'''NOTE:''' Since it installs to a read only directory but it requires read/write access for features like saving previously listened to stations, it would be wise to copy <code>/usr/share/lastfmproxy</code> to your home directory.<br />
<br />
Start lastfmproxy with <code>lastfmproxy</code> and visit <code>http://localhost:1881/</code> in your web browser. To add a last.fm station navigate to <code>http://localhost:1881/</code> followed by the lastfm:// url. Example: <code>http://localhost:1881/lastfm://globaltags/punk</code>. Navigate back to <code>http://localhost:1881/</code> and download the m3u file by selecting the Start Listening link. Simply add it to your music library path.<br />
<br />
=== Never play on start ===<br />
If you don't want mpd to always play on your system start, but yet you want to preserve the other state information, add the following lines to your <code>/etc/rc.d/mpd</code> file:<br />
'' ...''<br />
'' stat_busy "Starting Music Player Daemon"''<br />
<br />
# always start in paused state<br />
awk '/^state_file[ \t]+"[^"]+"$/ {<br />
match($0, "\".+\"")<br />
sfile = substr($0, RSTART + 1, RLENGTH - 2)<br />
} /^user[ \t]+"[^"]+"$/ {<br />
match($0, "\".+\"")<br />
user = substr($0, RSTART + 1, RLENGTH - 2)<br />
} END {<br />
if (sfile == "")<br />
exit;<br />
if (user != "")<br />
sub(/^~/, "/home/" user, sfile)<br />
system("sed -i \x27s|^\\(state:[ \\t]\\{1,\\}\\)play$|\\1pause|\x27 \x27" sfile "\x27")<br />
}' /etc/mpd.conf<br />
<br />
'' /usr/bin/mpd /etc/mpd.conf &> /dev/null''<br />
'' ...''<br />
<br />
This will change the player status to "paused", if it was stopped while playing. Next, you want this file to be preserved, so mpd updates won't erase this edit. Add (or edit) this line to your <code>/etc/pacman.conf</code>:<br />
NoUpgrade = etc/rc.d/mpd<br />
<br />
=== MPD & Alsa ===<br />
<br />
Sometimes, when you use other audio output, e.g: some web pages containing Flash applets, mpd cannot reproduce anything anymore (until you restart). The error looks something like: (if you search the file /var/log/mpd/mpd.error)<br />
<br />
Error opening alsa device "hw:0,0": Device or resource busy<br />
<br />
And here is the solution (dmix saving our life again). Apply these lines in your /etc/mpd.conf:<br />
<br />
<pre><br />
audio_output {<br />
type "alsa"<br />
name "Sound Card"<br />
options "dev=dmixer"<br />
device "plug:dmix"<br />
}<br />
</pre><br />
<br />
And then restart with /etc/rc.d/mpd restart<br />
<br />
Searching on Internet I found the reason for why that happens in Gentoo's wiki:<br />
* The sound card does not support hardware mixing (uses '''dmix''' plugin)<br />
* An application does not work with ALSA with it's default settings<br />
<br />
====High CPU usage with ALSA====<br />
When using MPD with ALSA, users may experience MPD taking up lots of CPU (around 20-30%). This is caused by most sound cards supporting 48kHz and most music being 44kHz, thus forcing MPD to resample it. This operation takes lots of CPU cycles and results into high usage.<br />
<br />
For most users the problem should be solved by telling MPD not to use resampling by adding <code>auto_resample "no"</code> into audio_output-part of /etc/mpd.conf<br />
<br />
Example from mpd.conf:<br />
<br />
audio_output {<br />
type "alsa"<br />
name "My ALSA Device"<br />
auto_resample "no"<br />
}<br />
<br />
Some users might also want to tell dmix to use 44kHz as well. More info about tuning performance of your MPD can be found from: [http://mpd.wikia.com/wiki/Tuning MPD wiki]<br />
<br />
=== Control mpd with lirc ===<br />
There are already some clients designe for communications between lircd and mpd, however, as far as the practical use, they aren't very useful since their funcstions are limited.<br />
<br />
It's recommended to use mpc with irexec. mpc is a command line player which only sends the command to mpd and exits immediately, which is perfect for irexec, the command runner included in lirc. What irexec does is that it runs a specified command once received a remote control button.<br />
<br />
First of all, please setup your remotes as referred to the '''[[Lirc]]''' article.<br />
<br />
Edit your favored lirc startup configuration file, default location is '''~/.lircrc'''<br />
<br />
Fill the file with the following pattern:<br />
<br />
begin<br />
prog = irexec<br />
button = <button_name><br />
config = <command_to_run><br />
repeat = <0 or 1><br />
end<br />
<br />
An useful example:<br />
<br />
## irexec<br />
begin<br />
prog = irexec<br />
button = play_pause<br />
config = mpc toggle<br />
repeat = 0<br />
end<br />
<br />
begin<br />
prog = irexec<br />
button = stop<br />
config = mpc stop<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = previous<br />
config = mpc prev<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = next<br />
config = mpc next<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = volup<br />
config = mpc volume +2<br />
repeat = 1<br />
end<br />
begin<br />
prog = irexec<br />
button = voldown<br />
config = mpc volume -2<br />
repeat = 1<br />
end<br />
begin<br />
prog = irexec<br />
button = pbc<br />
config = mpc random<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = pdvd<br />
config = mpc update<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = right<br />
config = mpc seek +00:00:05<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = left<br />
config = mpc seek -00:00:05<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = up<br />
config = mpc seek +1%<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = down<br />
config = mpc seek -1%<br />
repeat = 0<br />
end<br />
<br />
There are more functions for mpc, run '''''man mpc''''' for more info.<br />
<br />
==External links==<br />
<br />
* [http://www.musicpd.org/ Official Web Site]<br />
* [http://mpd.wikia.com/wiki/Main_Page Official Wiki]<br />
* [http://mpd.wikia.com/wiki/Clients Sorted List of MPD Clients]<br />
* [http://www.musicpd.org/forum/ MPD forum]</div>
Listdata
https://wiki.archlinux.org/index.php?title=Music_Player_Daemon&diff=67511
Music Player Daemon
2009-04-25T07:29:40Z
<p>Listdata: moved normal-user/multi-MPD setup info from 'troubleshooting' to 'Configure mpd'</p>
<hr />
<div>[[Category:Audio/Video (English)]]<br />
[[Category:Daemons and system services (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|mpd}}<br />
{{i18n_entry|Polski|mpd (polski)}}<br />
{{i18n_entry|Nederlands|Music Player Daemon (Nederlands)}}<br />
{{i18n_entry|Русский|MPD - Music Player Daemon (Русский)}}<br />
{{i18n_entry|简体中文|MPD(简体中文)}}<br />
{{i18n_entry|Türkçe|MPD (Türkçe)}}<br />
{{i18n_links_end}}<br />
<br />
==What is mpd?==<br />
'''mpd''' (Music Player Daemon) is an audio player that has a server-client architecture. mpd runs in the background as a daemon, manages playlists and a music database, and uses very few resources. In order to interface with it, you need a separate client. More information can be found on their [http://www.musicpd.org/ website]<br />
<br />
==Daemon Install Procedure==<br />
<br />
Sync and install with pacman:<br />
# pacman -S mpd<br />
<br />
==Configure mpd==<br />
<br />
For more information about mpd configuration visit http://mpd.wikia.com/wiki/Configuration<br />
<br />
===Timeline of mpd's behavior on a typical working setup===<br />
* mpd is started on boot by /etc/rc.conf, by including it in the DAEMONS array. (Or, this can be done manually each session by running '''/etc/rc.d/mpd start''' with root privileges).<br />
* Since mpd is now started as root, it first reads the /etc/mpd.conf file.<br />
* mpd reads the user variable in the /etc/mpd.conf file, and changes from root to this user.<br />
* mpd then reads the contents of the /etc/mpd.conf file and configures itself accordingly.<br />
<br />
Notice that mpd changes the running user from root to the one named in the /etc/mpd.conf file. This way, uses of "~" in the configuration file point correctly to the home user's directory, and not root's directory. It may be worthwhile to change all uses of "~" to "/home/username" to avoid any confusion over this aspect of mpd's behavior.<br />
<br />
===Quick Single User Installation===<br />
<br />
* As root, check if ''/etc/mpd.conf'' exists and delete the file if it does. This is safe.<br />
<br />
Mpd comes with an example configuration file, available at ''/etc/mpd.conf.example''. This file holds an abundance of information on mpd configuration, and holds default mixer values you can simply uncomment.<br />
<br />
* As root, copy this example file to ''/etc/mpd.conf''.<br />
cp /etc/mpd.conf.example /etc/mpd.conf<br />
<br />
Never put this file in the user's directory like some tutorials suggest. This would complicate things and most of the time doing this is useless (notice you're reading a quick installation howto). If you previously created a .mpdconf file in your home, remove it now. This is important to prevent conflicts. When placing it in /etc, like we do here, mpd will be able to run as a daemon at boot. Otherwise, a script would be needed to run mpd AFTER the user has logged (like kdm or ~/.fluxbox/startup) or it would require a manual move each time. For a single music collection, the method used here is simply better, even while the collection is shared to multiple users. Also, don't be afraid about root privileges: even while mpd runs as a daemon, it never completely runs as root since it automatically drops its root privileges after execution.<br />
<br />
To make audio output actually work ensure that you have setup audio card and mixer correctly. See [[ALSA]]. Do not forget to unmute the required channels in alsamixer, raise the volume and save changes with alsactl store. See ~/.mpd/error if it still doesn't work.<br />
<br />
Make sure your card can do hardware mixing (most of them can, including onboard audio). Or else this could cause problems with multiple sound playback. For example, this can prevent Mplayer from playing back sound while the mpd daemon is running, returning an audio error message stating the device is busy.<br />
<br />
<br />
We can now move on to edit the file, once again, as root:<br />
$EDITOR /etc/mpd.conf<br />
<br />
* In /etc/mpd.conf, look for these options and configure them as listed below: <br />
<br />
music_directory "~/Music"<br />
playlist_directory "~/Playlists"<br />
db_file "~/.mpd/db"<br />
log_file "~/.mpd/log"<br />
error_file "~/.mpd/error"<br />
pid_file "~/.mpd/mpd.pid"<br />
state_file "~/.mpd/mpdstate"<br />
user "mpd" (replace this with your username)<br />
bind_to_address "127.0.0.1"<br />
port "6600"<br />
#connection_timeout "60"<br />
#max_playlist_length "16384"<br />
#filesystem_charset "ISO-8859-1"<br />
#id3v1_encoding "ISO-8859-1"<br />
<br />
<br />
These are the most common lines. You shouldn't need anything else. You may want to change all paths to absolute paths, in order to avoid any ambiguities in the future in case you forget how mpd behaves (see above). See the file /etc/mpd.conf.example for more specific options.<br />
<br />
* Note: It might be advisable to add the following to /etc/mpd.conf so that, when changing the volume in an mpd client, the system wide volume isn't affected:<br />
mixer_type "software"<br />
<br />
* Look at the line starting with ''user'' and replace '''mpd''' with your username. Save changes and exit the editor.<br />
* Now exit the root mode and log as the normal user (the same you specified in mpd.conf).<br />
* Create the new directories<br />
$ mkdir ~/Music<br />
$ mkdir ~/Playlists<br />
$ mkdir ~/.mpd<br />
<br />
* Make symbolic links to your music collection:<br />
$ ln -s /media/sda5/music_collection1 ~/Music<br />
$ ln -s /media/sdb7/music_collection2 ~/Music<br />
<br />
* Create the pid file<br />
$ touch ~/.mpd/mpd.pid<br />
<br />
* Create the mpd database (This can take a while depending on the size of your collection.): <br />
$ mpd --create-db<br />
<br />
* Change back to root, and start mpd:<br />
$ /etc/rc.d/mpd start<br />
Although you can start mpd as root with just "mpd", doing the above gives more information (such as on '''htop''').<br />
<br />
* Edit '''/etc/rc.conf''' and add '''mpd''' to the list of daemons to start on bootup.<br />
<br />
* To test it out, install a very small client called mpc<br />
# pacman -S mpc (as root)<br />
$ mpc ls | mpc add (as user)<br />
$ mpc play<br />
<br />
{{Box Note | No sound? mpd's autodetection system may have failed to correctly detect your set-up, please scroll down to ''Troubleshooting''}}<br />
<br />
=== Advanced Setup ===<br />
MPD neet not be started with root permissions. The only reason why MPD needs to be started as root (by being called from /etc/rc.conf) is because the default files and folders in the default configuration file points to directories owned by root (the /var directory). A less common, but perhaps more sensible, approach is to make MPD work with files and directories owned by a normal user. Running MPD as a normal user has several advantages: (1) can easily have a single directory ~/.mpd (or any other directory under /home/username) for all MPD configuration files, (2) no read/write permission errors, and (3) more flexible calls to MPD by using ~/.xinitrc instead of including 'mpd' in the /etc/rc.conf DAEMONS array.<br />
<br />
The following steps shows how to run MPD as a normal user.<br />
<br />
First, copy the contents of the default MPD configuration file in /etc/mpd.conf.example to your home directory. A good place would be "/home/usr/.mpd/config".<br />
Second, make sure the relevant variables point to this ~/.mpd directory, as follows: <br />
music_directory "/home/username/.mpd/music" # can be ~/.mpd/music for brevity<br />
playlist_directory "/home/username/.mpd/playlist"<br />
db_file "/home/username/.mpd/mpd.db"<br />
log_file "/home/username/.mpd/mpd.log"<br />
error_file "/home/username/.mpd/mpd.error"<br />
pid_file "/home/username/.mpd/mpd.pid"<br />
state_file "/home/username/.mpd/mpdstate"<br />
user "username"<br />
The only thing that must exist with the above setup is the ~/.mpd directory. This is because any file that does not yet exist (mpd.db, mpd.log, etc.) can be created by MPD automatically, since the target directory/files all reside under the normal user's home directory.<br />
<br />
Third, let MPD start on bootup by calling it from your ~/.xinitrc as follows:<br />
mpd /home/username/.mpd/config<br />
Note that you don't have to put a "&" at the end of the line here, since MPD will automatically daemonize itself.<br />
<br />
Lastly, delete the entry 'mpd' from your DAEMONS array in /etc/rc.conf, as we are not running it as root anymore.<br />
<br />
If you want a second MPD daemon (e.g., with icecast output to share music over the network) to use the same music and playlist as the one above, simply copy the above configuration file and make a new file (e.g., /home/username/.mpd/config-icecast), and only change the log_file, error_file, pid_file, and state_file parameters (e.g., mpd-icecast.log, mpd-icecast.error, and so on); using the same directory paths for the music and playlist directories would ensure that this second MPD daemon would use the same music collection as your first one. Then, call this second daemon the same way from your ~/.xinitrc above. (Just be sure to have a different port number, so as to not conflict with your first MPD daemon).<br />
<br />
==Troubleshooting==<br />
<br />
=== Autodetection failed ===<br />
<br />
During the start of mpd, it tries to autodetect your set-up and configure output and volume control accordingly. Though this mostly goes well, it will fail for some systems. It may help to tell mpd specifically what to use as output and mixer control. If you copied /etc/mpd.conf over from /etc/mpd.conf.example as mentionned above, you can simply uncomment:<br />
<br />
Example for alsa output type:<br />
audio_output {<br />
type "alsa"<br />
name "My ALSA Device"<br />
device "hw:0,0" # optional<br />
format "44100:16:2" # optional<br />
}<br />
<br />
Example for alsa mixer:<br />
mixer_type "alsa"<br />
mixer_device "default"<br />
mixer_control "PCM"<br />
<br />
'''Note:''' in case of permission problems when using ESD with mpd run this as root:<br />
# chsh -s /bin/true mpd<br />
<br />
===Tips===<br />
<br />
To get rid of timeouts (i.e. when you paused music for long time) in gpmc and other clients uncomment and increase <code>connection_timeout</code> option in mpd.conf.<br />
<br />
If files and/or titles are shown in wrong encoding, uncomment and change <code>filesystem_charset</code> and <code>id3v1_encoding</code> options.<br />
Note that you cannot set encoding for ID3 v2 tags. To workaround this you may use [http://mpd.wikia.com/wiki/GenericDecoder#Generic_Tagreader external tag readers].<br />
<br />
If you want to use another computer to control mpd over a network, the <code>bind_to_address</code> option in mpd.conf will need to be set to either your IP address, or <code>any</code> if your IP address changes frequently. Remember to add mpd to the /etc/hosts.allow file to enable external access.<br />
<br />
==Client Install Procedure==<br />
<br />
Install a client program for mpd. Popular options are:<br />
<br />
* '''mpc''' - Command Line Client (you'll probably want this one no matter what)<br />
* '''ncmpc''' - NCurses Client (this one is very handy for running in a console) [http://hem.bredband.net/kaw/ncmpc/ Official Website of ncmpc]<br />
* '''ncmpcpp''' - Clone of ncmpc with some new features written in C++ [http://unkart.ovh.org/ncmpcpp/ Official website of ncmpcpp]<br />
* '''sonata''' - Python GTK+ Client [http://sonata.berlios.de/ Official Website of Sonata]<br />
* '''gmpc''' - Gnome Client [http://gmpcwiki.sarine.nl/index.php?title=GMPC Official Website of gmpc]<br />
<br />
<br />
Install with:<br />
# pacman -Sy mpc<br />
# pacman -Sy ncmpc<br />
# pacman -Sy ncmpcpp<br />
# pacman -Sy sonata<br />
# pacman -Sy gmpc<br />
<br />
==Extra stuff==<br />
<br />
===Last.fm scrobbling===<br />
<br />
To scrobble your songs to [http://www.last.fm Last.fm] using MPD there are several alternatives.<br />
<br />
====mpdscribble====<br />
mpdscribble is another daemon, but is only available in the [http://aur.archlinux.org/packages.php?ID=22274 AUR]. This is arguably the best alternative, because it's the semi-official MPD scrobbler and uses the new "idle" feature in MPD for more accurate scrobbling. Also, you don't need root access to configure it, because it doesn't need any changes to <code>/etc</code> at all. Visit [http://mpd.wikia.com/wiki/Client:Mpdscribble the official website] for more information.<br />
<br />
To install mpdscribble, just install it from the AUR and do the following (not as root):<br />
<br />
* mkdir ~/.mpdscribble<br />
* Create the file ~/.mpdscribble/mpdscribble.conf and add the following:<br />
username = <your last.fm username><br />
password = <md5 sum of your last.fm password> # Generated using "echo -n password | md5sum"<br />
host = <your mpd host> # defaults to $MPD_HOST or localhost<br />
port = <your mpd port> # defaults to $MPD_PORT or 6600<br />
log = ~/.mpdscribble/mpdscribble.log<br />
cache = ~/.mpdscribble/mpdscribble.cache<br />
verbose = 2<br />
sleep = 1<br />
musicdir = <your music directory><br />
* Add <code>mpdscribble</code> to your <code>~/.xinitrc</code><br />
<br />
====Sonata====<br />
The easiest way, if you don't care about having to have a program window open all the time, is using Sonata which is a graphical frontend to MPD. It has built-in support for Last.fm scrobbling in its preferences. The downside of this is that Sonata doesn't cache your songs if for some reason you don't happen to have an Internet connection at the time of playing.<br />
<br />
====lastfmsubmitd====<br />
lastfmsubmitd is a daemon which is available in the "community" repository. To install it, first edit <code>/etc/lastfmsubmitd.conf</code> and add both <code>lastfmsubmitd</code> and <code>lastmp</code> to the <code>DAEMONS</code> array in <code>/etc/rc.conf</code>.<br />
<br />
===Last.fm playback with lastfmproxy===<br />
lastfmproxy is a python script that streams a last.fm music stream to another media player. To setup, install from aur <code>yaourt -S lastfmproxy</code> and then edit <code>/usr/share/lastfmproxy/config.py</code>. If you plan to only stream to mpd on the same host, just edit the login info.<br />
<br />
'''NOTE:''' Since it installs to a read only directory but it requires read/write access for features like saving previously listened to stations, it would be wise to copy <code>/usr/share/lastfmproxy</code> to your home directory.<br />
<br />
Start lastfmproxy with <code>lastfmproxy</code> and visit <code>http://localhost:1881/</code> in your web browser. To add a last.fm station navigate to <code>http://localhost:1881/</code> followed by the lastfm:// url. Example: <code>http://localhost:1881/lastfm://globaltags/punk</code>. Navigate back to <code>http://localhost:1881/</code> and download the m3u file by selecting the Start Listening link. Simply add it to your music library path.<br />
<br />
=== Never play on start ===<br />
If you don't want mpd to always play on your system start, but yet you want to preserve the other state information, add the following lines to your <code>/etc/rc.d/mpd</code> file:<br />
'' ...''<br />
'' stat_busy "Starting Music Player Daemon"''<br />
<br />
# always start in paused state<br />
awk '/^state_file[ \t]+"[^"]+"$/ {<br />
match($0, "\".+\"")<br />
sfile = substr($0, RSTART + 1, RLENGTH - 2)<br />
} /^user[ \t]+"[^"]+"$/ {<br />
match($0, "\".+\"")<br />
user = substr($0, RSTART + 1, RLENGTH - 2)<br />
} END {<br />
if (sfile == "")<br />
exit;<br />
if (user != "")<br />
sub(/^~/, "/home/" user, sfile)<br />
system("sed -i \x27s|^\\(state:[ \\t]\\{1,\\}\\)play$|\\1pause|\x27 \x27" sfile "\x27")<br />
}' /etc/mpd.conf<br />
<br />
'' /usr/bin/mpd /etc/mpd.conf &> /dev/null''<br />
'' ...''<br />
<br />
This will change the player status to "paused", if it was stopped while playing. Next, you want this file to be preserved, so mpd updates won't erase this edit. Add (or edit) this line to your <code>/etc/pacman.conf</code>:<br />
NoUpgrade = etc/rc.d/mpd<br />
<br />
=== MPD & Alsa ===<br />
<br />
Sometimes, when you use other audio output, e.g: some web pages containing Flash applets, mpd cannot reproduce anything anymore (until you restart). The error looks something like: (if you search the file /var/log/mpd/mpd.error)<br />
<br />
Error opening alsa device "hw:0,0": Device or resource busy<br />
<br />
And here is the solution (dmix saving our life again). Apply these lines in your /etc/mpd.conf:<br />
<br />
<pre><br />
audio_output {<br />
type "alsa"<br />
name "Sound Card"<br />
options "dev=dmixer"<br />
device "plug:dmix"<br />
}<br />
</pre><br />
<br />
And then restart with /etc/rc.d/mpd restart<br />
<br />
Searching on Internet I found the reason for why that happens in Gentoo's wiki:<br />
* The sound card does not support hardware mixing (uses '''dmix''' plugin)<br />
* An application does not work with ALSA with it's default settings<br />
<br />
====High CPU usage with ALSA====<br />
When using MPD with ALSA, users may experience MPD taking up lots of CPU (around 20-30%). This is caused by most sound cards supporting 48kHz and most music being 44kHz, thus forcing MPD to resample it. This operation takes lots of CPU cycles and results into high usage.<br />
<br />
For most users the problem should be solved by telling MPD not to use resampling by adding <code>auto_resample "no"</code> into audio_output-part of /etc/mpd.conf<br />
<br />
Example from mpd.conf:<br />
<br />
audio_output {<br />
type "alsa"<br />
name "My ALSA Device"<br />
auto_resample "no"<br />
}<br />
<br />
Some users might also want to tell dmix to use 44kHz as well. More info about tuning performance of your MPD can be found from: [http://mpd.wikia.com/wiki/Tuning MPD wiki]<br />
<br />
=== Control mpd with lirc ===<br />
There are already some clients designe for communications between lircd and mpd, however, as far as the practical use, they aren't very useful since their funcstions are limited.<br />
<br />
It's recommended to use mpc with irexec. mpc is a command line player which only sends the command to mpd and exits immediately, which is perfect for irexec, the command runner included in lirc. What irexec does is that it runs a specified command once received a remote control button.<br />
<br />
First of all, please setup your remotes as referred to the '''[[Lirc]]''' article.<br />
<br />
Edit your favored lirc startup configuration file, default location is '''~/.lircrc'''<br />
<br />
Fill the file with the following pattern:<br />
<br />
begin<br />
prog = irexec<br />
button = <button_name><br />
config = <command_to_run><br />
repeat = <0 or 1><br />
end<br />
<br />
An useful example:<br />
<br />
## irexec<br />
begin<br />
prog = irexec<br />
button = play_pause<br />
config = mpc toggle<br />
repeat = 0<br />
end<br />
<br />
begin<br />
prog = irexec<br />
button = stop<br />
config = mpc stop<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = previous<br />
config = mpc prev<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = next<br />
config = mpc next<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = volup<br />
config = mpc volume +2<br />
repeat = 1<br />
end<br />
begin<br />
prog = irexec<br />
button = voldown<br />
config = mpc volume -2<br />
repeat = 1<br />
end<br />
begin<br />
prog = irexec<br />
button = pbc<br />
config = mpc random<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = pdvd<br />
config = mpc update<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = right<br />
config = mpc seek +00:00:05<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = left<br />
config = mpc seek -00:00:05<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = up<br />
config = mpc seek +1%<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = down<br />
config = mpc seek -1%<br />
repeat = 0<br />
end<br />
<br />
There are more functions for mpc, run '''''man mpc''''' for more info.<br />
<br />
==External links==<br />
<br />
* [http://www.musicpd.org/ Official Web Site]<br />
* [http://mpd.wikia.com/wiki/Main_Page Official Wiki]<br />
* [http://mpd.wikia.com/wiki/Clients Sorted List of MPD Clients]<br />
* [http://www.musicpd.org/forum/ MPD forum]</div>
Listdata
https://wiki.archlinux.org/index.php?title=Music_Player_Daemon&diff=67510
Music Player Daemon
2009-04-25T07:02:25Z
<p>Listdata: /* Troubleshooting */ running MPD as a normal user, not root</p>
<hr />
<div>[[Category:Audio/Video (English)]]<br />
[[Category:Daemons and system services (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|mpd}}<br />
{{i18n_entry|Polski|mpd (polski)}}<br />
{{i18n_entry|Nederlands|Music Player Daemon (Nederlands)}}<br />
{{i18n_entry|Русский|MPD - Music Player Daemon (Русский)}}<br />
{{i18n_entry|简体中文|MPD(简体中文)}}<br />
{{i18n_entry|Türkçe|MPD (Türkçe)}}<br />
{{i18n_links_end}}<br />
<br />
==What is mpd?==<br />
'''mpd''' (Music Player Daemon) is an audio player that has a server-client architecture. mpd runs in the background as a daemon, manages playlists and a music database, and uses very few resources. In order to interface with it, you need a separate client. More information can be found on their [http://www.musicpd.org/ website]<br />
<br />
==Daemon Install Procedure==<br />
<br />
Sync and install with pacman:<br />
# pacman -S mpd<br />
<br />
==Configure mpd==<br />
<br />
For more information about mpd configuration visit http://mpd.wikia.com/wiki/Configuration<br />
<br />
===Timeline of mpd's behavior on a typical working setup===<br />
* mpd is started on boot by /etc/rc.conf, by including it in the DAEMONS array. (Or, this can be done manually each session by running '''/etc/rc.d/mpd start''' with root privileges).<br />
* Since mpd is now started as root, it first reads the /etc/mpd.conf file.<br />
* mpd reads the user variable in the /etc/mpd.conf file, and changes from root to this user.<br />
* mpd then reads the contents of the /etc/mpd.conf file and configures itself accordingly.<br />
<br />
Notice that mpd changes the running user from root to the one named in the /etc/mpd.conf file. This way, uses of "~" in the configuration file point correctly to the home user's directory, and not root's directory. It may be worthwhile to change all uses of "~" to "/home/username" to avoid any confusion over this aspect of mpd's behavior.<br />
<br />
===Quick Single User Installation===<br />
<br />
* As root, check if ''/etc/mpd.conf'' exists and delete the file if it does. This is safe.<br />
<br />
Mpd comes with an example configuration file, available at ''/etc/mpd.conf.example''. This file holds an abundance of information on mpd configuration, and holds default mixer values you can simply uncomment.<br />
<br />
* As root, copy this example file to ''/etc/mpd.conf''.<br />
cp /etc/mpd.conf.example /etc/mpd.conf<br />
<br />
Never put this file in the user's directory like some tutorials suggest. This would complicate things and most of the time doing this is useless (notice you're reading a quick installation howto). If you previously created a .mpdconf file in your home, remove it now. This is important to prevent conflicts. When placing it in /etc, like we do here, mpd will be able to run as a daemon at boot. Otherwise, a script would be needed to run mpd AFTER the user has logged (like kdm or ~/.fluxbox/startup) or it would require a manual move each time. For a single music collection, the method used here is simply better, even while the collection is shared to multiple users. Also, don't be afraid about root privileges: even while mpd runs as a daemon, it never completely runs as root since it automatically drops its root privileges after execution.<br />
<br />
To make audio output actually work ensure that you have setup audio card and mixer correctly. See [[ALSA]]. Do not forget to unmute the required channels in alsamixer, raise the volume and save changes with alsactl store. See ~/.mpd/error if it still doesn't work.<br />
<br />
Make sure your card can do hardware mixing (most of them can, including onboard audio). Or else this could cause problems with multiple sound playback. For example, this can prevent Mplayer from playing back sound while the mpd daemon is running, returning an audio error message stating the device is busy.<br />
<br />
<br />
We can now move on to edit the file, once again, as root:<br />
$EDITOR /etc/mpd.conf<br />
<br />
* In /etc/mpd.conf, look for these options and configure them as listed below: <br />
<br />
music_directory "~/Music"<br />
playlist_directory "~/Playlists"<br />
db_file "~/.mpd/db"<br />
log_file "~/.mpd/log"<br />
error_file "~/.mpd/error"<br />
pid_file "~/.mpd/mpd.pid"<br />
state_file "~/.mpd/mpdstate"<br />
user "mpd" (replace this with your username)<br />
bind_to_address "127.0.0.1"<br />
port "6600"<br />
#connection_timeout "60"<br />
#max_playlist_length "16384"<br />
#filesystem_charset "ISO-8859-1"<br />
#id3v1_encoding "ISO-8859-1"<br />
<br />
<br />
These are the most common lines. You shouldn't need anything else. You may want to change all paths to absolute paths, in order to avoid any ambiguities in the future in case you forget how mpd behaves (see above). See the file /etc/mpd.conf.example for more specific options.<br />
<br />
* Note: It might be advisable to add the following to /etc/mpd.conf so that, when changing the volume in an mpd client, the system wide volume isn't affected:<br />
mixer_type "software"<br />
<br />
* Look at the line starting with ''user'' and replace '''mpd''' with your username. Save changes and exit the editor.<br />
* Now exit the root mode and log as the normal user (the same you specified in mpd.conf).<br />
* Create the new directories<br />
$ mkdir ~/Music<br />
$ mkdir ~/Playlists<br />
$ mkdir ~/.mpd<br />
<br />
* Make symbolic links to your music collection:<br />
$ ln -s /media/sda5/music_collection1 ~/Music<br />
$ ln -s /media/sdb7/music_collection2 ~/Music<br />
<br />
* Create the pid file<br />
$ touch ~/.mpd/mpd.pid<br />
<br />
* Create the mpd database (This can take a while depending on the size of your collection.): <br />
$ mpd --create-db<br />
<br />
* Change back to root, and start mpd:<br />
$ /etc/rc.d/mpd start<br />
Although you can start mpd as root with just "mpd", doing the above gives more information (such as on '''htop''').<br />
<br />
* Edit '''/etc/rc.conf''' and add '''mpd''' to the list of daemons to start on bootup.<br />
<br />
* To test it out, install a very small client called mpc<br />
# pacman -S mpc (as root)<br />
$ mpc ls | mpc add (as user)<br />
$ mpc play<br />
<br />
{{Box Note | No sound? mpd's autodetection system may have failed to correctly detect your set-up, please scroll down to ''Troubleshooting''}}<br />
<br />
==Troubleshooting==<br />
<br />
=== Read/write permission problems ===<br />
Unbeknownst to many, MPD does not have to be started with root permissions. The only reason why MPD needs to be started as root (by being called from /etc/rc.conf) is because the default files and folders in the default configuration file points to directories owned by root (the /var directory). A less common, but perhaps more sensible, approach is to make MPD work with files and directories owned by a normal user (indeed, the manpage for MPD encourages this way of using MPD by saying that running "mpd" without any parameters make MPD look for the configuration file first from the normal user's directory (~/.mpdconf) and then the system directory (/etc/mpd.conf)). The following steps shows how to run MPD as a normal user.<br />
<br />
First, copy the contents of the default MPD configuration file in /etc/mpd.conf.example to your home directory. A good place would be "/home/usr/.mpd/config".<br />
Second, make sure the relevant variables point to this ~/.mpd directory, as follows: <br />
music_directory "/home/username/.mpd/music" # can be ~/.mpd/music for brevity<br />
playlist_directory "/home/username/.mpd/playlist"<br />
db_file "/home/username/.mpd/mpd.db"<br />
log_file "/home/username/.mpd/mpd.log"<br />
error_file "/home/username/.mpd/mpd.error"<br />
pid_file "/home/username/.mpd/mpd.pid"<br />
state_file "/home/username/.mpd/mpdstate"<br />
user "username"<br />
The only thing that must exist with the above setup is the ~/.mpd directory. This is because any file that does not yet exist (mpd.db, mpd.log, etc.) can be created by MPD automatically, since the target directory/files all reside under the normal user's home directory.<br />
<br />
Third, let MPD start on bootup by calling it from your ~/.xinitrc as follows:<br />
mpd /home/username/.mpd/config<br />
Note that you don't have to put a "&" at the end of the line here, since MPD will automatically daemonize itself.<br />
<br />
Lastly, delete the entry 'mpd' from your DAEMONS array in /etc/rc.conf, as we are not running it as root anymore.<br />
<br />
If you want a second MPD daemon (e.g., with icecast output to share music over the network) to use the same music and playlist as the one above, you could copy the above configuration file and make a new file (e.g., /home/username/.mpd/config-icecast), and only change the log_file, error_file, pid_file, and state_file parameters (e.g., mpd-icecast.log, mpd-icecast.error, and so on). And then you could call this second daemon the same way from your ~/.xinitrc above. (Just be sure to have a different port number, so as to not conflict with your first MPD daemon).<br />
<br />
=== Autodetection failed ===<br />
<br />
During the start of mpd, it tries to autodetect your set-up and configure output and volume control accordingly. Though this mostly goes well, it will fail for some systems. It may help to tell mpd specifically what to use as output and mixer control. If you copied /etc/mpd.conf over from /etc/mpd.conf.example as mentionned above, you can simply uncomment:<br />
<br />
Example for alsa output type:<br />
audio_output {<br />
type "alsa"<br />
name "My ALSA Device"<br />
device "hw:0,0" # optional<br />
format "44100:16:2" # optional<br />
}<br />
<br />
Example for alsa mixer:<br />
mixer_type "alsa"<br />
mixer_device "default"<br />
mixer_control "PCM"<br />
<br />
'''Note:''' in case of permission problems when using ESD with mpd run this as root:<br />
# chsh -s /bin/true mpd<br />
<br />
===Tips===<br />
<br />
To get rid of timeouts (i.e. when you paused music for long time) in gpmc and other clients uncomment and increase <code>connection_timeout</code> option in mpd.conf.<br />
<br />
If files and/or titles are shown in wrong encoding, uncomment and change <code>filesystem_charset</code> and <code>id3v1_encoding</code> options.<br />
Note that you cannot set encoding for ID3 v2 tags. To workaround this you may use [http://mpd.wikia.com/wiki/GenericDecoder#Generic_Tagreader external tag readers].<br />
<br />
If you want to use another computer to control mpd over a network, the <code>bind_to_address</code> option in mpd.conf will need to be set to either your IP address, or <code>any</code> if your IP address changes frequently. Remember to add mpd to the /etc/hosts.allow file to enable external access.<br />
<br />
==Client Install Procedure==<br />
<br />
Install a client program for mpd. Popular options are:<br />
<br />
* '''mpc''' - Command Line Client (you'll probably want this one no matter what)<br />
* '''ncmpc''' - NCurses Client (this one is very handy for running in a console) [http://hem.bredband.net/kaw/ncmpc/ Official Website of ncmpc]<br />
* '''ncmpcpp''' - Clone of ncmpc with some new features written in C++ [http://unkart.ovh.org/ncmpcpp/ Official website of ncmpcpp]<br />
* '''sonata''' - Python GTK+ Client [http://sonata.berlios.de/ Official Website of Sonata]<br />
* '''gmpc''' - Gnome Client [http://gmpcwiki.sarine.nl/index.php?title=GMPC Official Website of gmpc]<br />
<br />
<br />
Install with:<br />
# pacman -Sy mpc<br />
# pacman -Sy ncmpc<br />
# pacman -Sy ncmpcpp<br />
# pacman -Sy sonata<br />
# pacman -Sy gmpc<br />
<br />
==Extra stuff==<br />
<br />
===Last.fm scrobbling===<br />
<br />
To scrobble your songs to [http://www.last.fm Last.fm] using MPD there are several alternatives.<br />
<br />
====mpdscribble====<br />
mpdscribble is another daemon, but is only available in the [http://aur.archlinux.org/packages.php?ID=22274 AUR]. This is arguably the best alternative, because it's the semi-official MPD scrobbler and uses the new "idle" feature in MPD for more accurate scrobbling. Also, you don't need root access to configure it, because it doesn't need any changes to <code>/etc</code> at all. Visit [http://mpd.wikia.com/wiki/Client:Mpdscribble the official website] for more information.<br />
<br />
To install mpdscribble, just install it from the AUR and do the following (not as root):<br />
<br />
* mkdir ~/.mpdscribble<br />
* Create the file ~/.mpdscribble/mpdscribble.conf and add the following:<br />
username = <your last.fm username><br />
password = <md5 sum of your last.fm password> # Generated using "echo -n password | md5sum"<br />
host = <your mpd host> # defaults to $MPD_HOST or localhost<br />
port = <your mpd port> # defaults to $MPD_PORT or 6600<br />
log = ~/.mpdscribble/mpdscribble.log<br />
cache = ~/.mpdscribble/mpdscribble.cache<br />
verbose = 2<br />
sleep = 1<br />
musicdir = <your music directory><br />
* Add <code>mpdscribble</code> to your <code>~/.xinitrc</code><br />
<br />
====Sonata====<br />
The easiest way, if you don't care about having to have a program window open all the time, is using Sonata which is a graphical frontend to MPD. It has built-in support for Last.fm scrobbling in its preferences. The downside of this is that Sonata doesn't cache your songs if for some reason you don't happen to have an Internet connection at the time of playing.<br />
<br />
====lastfmsubmitd====<br />
lastfmsubmitd is a daemon which is available in the "community" repository. To install it, first edit <code>/etc/lastfmsubmitd.conf</code> and add both <code>lastfmsubmitd</code> and <code>lastmp</code> to the <code>DAEMONS</code> array in <code>/etc/rc.conf</code>.<br />
<br />
===Last.fm playback with lastfmproxy===<br />
lastfmproxy is a python script that streams a last.fm music stream to another media player. To setup, install from aur <code>yaourt -S lastfmproxy</code> and then edit <code>/usr/share/lastfmproxy/config.py</code>. If you plan to only stream to mpd on the same host, just edit the login info.<br />
<br />
'''NOTE:''' Since it installs to a read only directory but it requires read/write access for features like saving previously listened to stations, it would be wise to copy <code>/usr/share/lastfmproxy</code> to your home directory.<br />
<br />
Start lastfmproxy with <code>lastfmproxy</code> and visit <code>http://localhost:1881/</code> in your web browser. To add a last.fm station navigate to <code>http://localhost:1881/</code> followed by the lastfm:// url. Example: <code>http://localhost:1881/lastfm://globaltags/punk</code>. Navigate back to <code>http://localhost:1881/</code> and download the m3u file by selecting the Start Listening link. Simply add it to your music library path.<br />
<br />
=== Never play on start ===<br />
If you don't want mpd to always play on your system start, but yet you want to preserve the other state information, add the following lines to your <code>/etc/rc.d/mpd</code> file:<br />
'' ...''<br />
'' stat_busy "Starting Music Player Daemon"''<br />
<br />
# always start in paused state<br />
awk '/^state_file[ \t]+"[^"]+"$/ {<br />
match($0, "\".+\"")<br />
sfile = substr($0, RSTART + 1, RLENGTH - 2)<br />
} /^user[ \t]+"[^"]+"$/ {<br />
match($0, "\".+\"")<br />
user = substr($0, RSTART + 1, RLENGTH - 2)<br />
} END {<br />
if (sfile == "")<br />
exit;<br />
if (user != "")<br />
sub(/^~/, "/home/" user, sfile)<br />
system("sed -i \x27s|^\\(state:[ \\t]\\{1,\\}\\)play$|\\1pause|\x27 \x27" sfile "\x27")<br />
}' /etc/mpd.conf<br />
<br />
'' /usr/bin/mpd /etc/mpd.conf &> /dev/null''<br />
'' ...''<br />
<br />
This will change the player status to "paused", if it was stopped while playing. Next, you want this file to be preserved, so mpd updates won't erase this edit. Add (or edit) this line to your <code>/etc/pacman.conf</code>:<br />
NoUpgrade = etc/rc.d/mpd<br />
<br />
=== MPD & Alsa ===<br />
<br />
Sometimes, when you use other audio output, e.g: some web pages containing Flash applets, mpd cannot reproduce anything anymore (until you restart). The error looks something like: (if you search the file /var/log/mpd/mpd.error)<br />
<br />
Error opening alsa device "hw:0,0": Device or resource busy<br />
<br />
And here is the solution (dmix saving our life again). Apply these lines in your /etc/mpd.conf:<br />
<br />
<pre><br />
audio_output {<br />
type "alsa"<br />
name "Sound Card"<br />
options "dev=dmixer"<br />
device "plug:dmix"<br />
}<br />
</pre><br />
<br />
And then restart with /etc/rc.d/mpd restart<br />
<br />
Searching on Internet I found the reason for why that happens in Gentoo's wiki:<br />
* The sound card does not support hardware mixing (uses '''dmix''' plugin)<br />
* An application does not work with ALSA with it's default settings<br />
<br />
====High CPU usage with ALSA====<br />
When using MPD with ALSA, users may experience MPD taking up lots of CPU (around 20-30%). This is caused by most sound cards supporting 48kHz and most music being 44kHz, thus forcing MPD to resample it. This operation takes lots of CPU cycles and results into high usage.<br />
<br />
For most users the problem should be solved by telling MPD not to use resampling by adding <code>auto_resample "no"</code> into audio_output-part of /etc/mpd.conf<br />
<br />
Example from mpd.conf:<br />
<br />
audio_output {<br />
type "alsa"<br />
name "My ALSA Device"<br />
auto_resample "no"<br />
}<br />
<br />
Some users might also want to tell dmix to use 44kHz as well. More info about tuning performance of your MPD can be found from: [http://mpd.wikia.com/wiki/Tuning MPD wiki]<br />
<br />
=== Control mpd with lirc ===<br />
There are already some clients designe for communications between lircd and mpd, however, as far as the practical use, they aren't very useful since their funcstions are limited.<br />
<br />
It's recommended to use mpc with irexec. mpc is a command line player which only sends the command to mpd and exits immediately, which is perfect for irexec, the command runner included in lirc. What irexec does is that it runs a specified command once received a remote control button.<br />
<br />
First of all, please setup your remotes as referred to the '''[[Lirc]]''' article.<br />
<br />
Edit your favored lirc startup configuration file, default location is '''~/.lircrc'''<br />
<br />
Fill the file with the following pattern:<br />
<br />
begin<br />
prog = irexec<br />
button = <button_name><br />
config = <command_to_run><br />
repeat = <0 or 1><br />
end<br />
<br />
An useful example:<br />
<br />
## irexec<br />
begin<br />
prog = irexec<br />
button = play_pause<br />
config = mpc toggle<br />
repeat = 0<br />
end<br />
<br />
begin<br />
prog = irexec<br />
button = stop<br />
config = mpc stop<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = previous<br />
config = mpc prev<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = next<br />
config = mpc next<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = volup<br />
config = mpc volume +2<br />
repeat = 1<br />
end<br />
begin<br />
prog = irexec<br />
button = voldown<br />
config = mpc volume -2<br />
repeat = 1<br />
end<br />
begin<br />
prog = irexec<br />
button = pbc<br />
config = mpc random<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = pdvd<br />
config = mpc update<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = right<br />
config = mpc seek +00:00:05<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = left<br />
config = mpc seek -00:00:05<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = up<br />
config = mpc seek +1%<br />
repeat = 0<br />
end<br />
begin<br />
prog = irexec<br />
button = down<br />
config = mpc seek -1%<br />
repeat = 0<br />
end<br />
<br />
There are more functions for mpc, run '''''man mpc''''' for more info.<br />
<br />
==External links==<br />
<br />
* [http://www.musicpd.org/ Official Web Site]<br />
* [http://mpd.wikia.com/wiki/Main_Page Official Wiki]<br />
* [http://mpd.wikia.com/wiki/Clients Sorted List of MPD Clients]<br />
* [http://www.musicpd.org/forum/ MPD forum]</div>
Listdata
https://wiki.archlinux.org/index.php?title=XScreenSaver&diff=65830
XScreenSaver
2009-03-27T18:58:17Z
<p>Listdata: /* Starting Xscreensaver */</p>
<hr />
<div>[[Category:Utilities (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|:Xscreensaver}}<br />
{{i18n_entry|Italiano|:Xscreensaver (Italiano)}}<br />
{{i18n_entry|Español|:Xscreensaver (Español)}}<br />
{{i18n_links_end}}<br />
<br />
==Installing Xscreensaver==<br />
Install the Xscreensaver by: <br />
# pacman -S xscreensaver<br />
<br />
==Starting Xscreensaver==<br />
<br />
On some machines, simply installing the xscreensaver program is not enough to have it working properly. The xscreensaver program has to be started, which is commonly done by your desktop manager.<br />
<br />
However, some DMs do not do this (egs: IceWM).<br />
<br />
To start the xscreensaver program manually, just type in <br />
<tt>xscreensaver</tt> <br />
into a terminal.<br />
<br />
Or, to start the xscreensaver program automatically every time you get into the X11 environment, type this into your '~/.xinitrc' file above the line specifying which DM to load.<br />
<br />
<tt>xscreensaver -no-splash &</tt><br />
<br />
The ampersand '&' argument makes xscreensaver run in the background, and is required.<br />
<br />
==Lock Screen==<br />
You may immediately trigger xscreensaver, if it is running, and lock the screen with the following command<br />
<tt>xscreensaver-command --lock</tt><br />
<br />
==Theming==<br />
XScreensaver's unlock screen can be themed, see [[Xdefaults#xscreensaver_theming|XScreensaver Theming]]<br />
<br />
==Example ~/.xinitrc==<br />
#!/bin/sh<br />
<br />
#<br />
# ~/.xinitrc<br />
#<br />
# Executed by startx (run your window manager from here)<br />
#<br />
<br />
xscreensaver -no-splash &<br />
# exec wmaker<br />
# exec startkde<br />
# exec icewm<br />
# exec blackbox<br />
# exec fluxbox<br />
exec xfce4-session</div>
Listdata
https://wiki.archlinux.org/index.php?title=Brother_MFC-9840CDW&diff=62742
Brother MFC-9840CDW
2009-02-21T06:23:55Z
<p>Listdata: /* Introduction */</p>
<hr />
<div>[[Category:Printers_(English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
=Introduction=<br />
<br />
This is a small tutorial to make the printer Brother MFC-9840CDW work on Arch, through a wired (ethernet cable) network connection.<br />
<br />
Currently, you can set it up with either the generic postscript drivers (recommended), or PCL-6 drivers with gutenprint (as the MFC-9840CDW supports PCL-6 emulation). The postscript driver has fewer settings, and is easy to set up, whereas the PCL-6 driver has more options, although it is more experimental (and doesn't support color). As of February 2009, the postscript driver always has color on by default, whereas the PCL-6 driver is always set to greyscale -- so you may want to add two printers, with one for each.<br />
<br />
'''TIP: You can add multiple versions of the MFC-9840CDW by repeating the steps below, and then for each version, changing the printer settings with the ''Set Printer Options'' button in CUPS. This way, you can quickly set up default settings that you use often (e.g., color vs. greyscale), and then print with these options by simply selecting the corresponding printer in your application.'''<br />
<br />
=Setup with PostScript=<br />
<br />
The MFC-9840CDW natively supports the postscript format, so for basic printing functionality we'll be using the generic postscript driver that comes with the foomatic packages. (Although it's probably better to convert the official Brother drivers for Linux (currently available in either .rpm or .deb format), no one has done so yet.)<br />
<br />
* Install the '''cups''' package. Make sure it's working by going to http://localhost:631<br />
* Install the '''foomatic-db''', '''foomatic-db-engine''', and '''foomatic-filters''' packages (to get the generic postscript driver that we need).<br />
* Make sure the printer is connected to your network router/switch. If your router is acting as a DHCP server, the MFC-9840CDW will automatically get an IP address assigned. Make note of this IP address. (You could also assign a static IP address to your printer, but that is outside the scope of this article).<br />
* Go to http://localhost:631 to open up the CUPS web interface.<br />
* Click on the '''Administration''' tab and then click on '''Add printer.'''<br />
* Select the "Internet Printing Protocol (http)" option for the Device.<br />
* For the Device URI, use: '''http://IPADDRESSOFPRINTER:631/postscript_p1'''. E.g., '''http://192.168.0.102:631/postscript_p1'''<br />
* For the Make/Manufacturer, click on '''Generic''', then '''Generic PostScript Printer Foomatic/Postscript (en)''' (do not choose the "Level 1" variant, as it is an older postcript driver for older printers)<br />
* Click on '''Add Printer''' to finish the wizard.<br />
<br />
Print out a test page to see if everything works. The above configuration allows you to change the duplex and resolution (dpi) settings within CUPS, via the '''Set Printer Options''' button under the '''Printers''' tab, but is missing the "Toner save" option. Of course, this and all other settings are still accessible via the printer's own web interface, which makes any changes the default settings of the printer (see the official Brother documentation).<br />
<br />
=Setup with PCL-6 and Gutenprint=<br />
<br />
The MFC-9840CDW also natively supports (via emulation) the PCL-6 format, so we can take advantage of this feature. The procedure is essentially identical as with the postscript configuration above, except for a couple of things.<br />
<br />
* Install the '''gutenprint''' package.<br />
* Instead of '''postscript_p1''' in the Device URI field, use '''pcl_p1''' (the '''pcl''' has a lowercase 'L', not a numeral 'one').<br />
* Under For the Make/Manufacturer, click on '''Generic''' again, but instead choose the '''Generic PCL 6/PCL XL Printer - CUPS+Gutenprint v.5.2.3 (en)''' option. (The Gutenprint version number is dependant, of course, on which version of '''gutenprint''' you have installed.)<br />
<br />
Customize the default printer settings, to the extent that they are controlled by CUPS, by clicking on the '''Set Printer Options''' button in the CUPS web interface. You will notice that the Gutenprint driver has many more options than the generic PostScript driver. You may want to repeat the procedure above and add a second printer, and then customize this second printer's settings to your liking (e.g., color instead of greyscale).<br />
<br />
''Note: As there are many different PCL-6 drivers available, you may want to experiment with using these different ones instead of the CUPS+Gutenprint one. To change the driver, click on '''Modify Printer''' and go through the wizard, just like when you were adding the printer from the beginning.''</div>
Listdata
https://wiki.archlinux.org/index.php?title=Brother_MFC-9840CDW&diff=62741
Brother MFC-9840CDW
2009-02-21T06:20:14Z
<p>Listdata: /* Introduction */</p>
<hr />
<div>[[Category:Printers_(English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
=Introduction=<br />
<br />
This is a small tutorial to make the printer Brother MFC-9840CDW work on Arch, through a wired (ethernet cable) network connection.<br />
<br />
Currently, you can set it up with either the generic postscript drivers (recommended), or PCL-6 drivers with gutenprint (as the MFC-9840CDW supports PCL-6 emulation). The postscript driver has fewer settings, and is easy to set up, whereas the PCL-6 driver has more options, although it is more experimental (and doesn't support color).<br />
<br />
'''TIP: You can add multiple versions of the MFC-9840CDW by repeating the steps below, and then for each version, changing the printer settings with the ''Set Printer Options'' button in CUPS. This way, you can quickly set up default settings that you use often (e.g., color vs. greyscale), and then print with these options by simply selecting the corresponding printer in your application.'''<br />
<br />
=Setup with PostScript=<br />
<br />
The MFC-9840CDW natively supports the postscript format, so for basic printing functionality we'll be using the generic postscript driver that comes with the foomatic packages. (Although it's probably better to convert the official Brother drivers for Linux (currently available in either .rpm or .deb format), no one has done so yet.)<br />
<br />
* Install the '''cups''' package. Make sure it's working by going to http://localhost:631<br />
* Install the '''foomatic-db''', '''foomatic-db-engine''', and '''foomatic-filters''' packages (to get the generic postscript driver that we need).<br />
* Make sure the printer is connected to your network router/switch. If your router is acting as a DHCP server, the MFC-9840CDW will automatically get an IP address assigned. Make note of this IP address. (You could also assign a static IP address to your printer, but that is outside the scope of this article).<br />
* Go to http://localhost:631 to open up the CUPS web interface.<br />
* Click on the '''Administration''' tab and then click on '''Add printer.'''<br />
* Select the "Internet Printing Protocol (http)" option for the Device.<br />
* For the Device URI, use: '''http://IPADDRESSOFPRINTER:631/postscript_p1'''. E.g., '''http://192.168.0.102:631/postscript_p1'''<br />
* For the Make/Manufacturer, click on '''Generic''', then '''Generic PostScript Printer Foomatic/Postscript (en)''' (do not choose the "Level 1" variant, as it is an older postcript driver for older printers)<br />
* Click on '''Add Printer''' to finish the wizard.<br />
<br />
Print out a test page to see if everything works. The above configuration allows you to change the duplex and resolution (dpi) settings within CUPS, via the '''Set Printer Options''' button under the '''Printers''' tab, but is missing the "Toner save" option. Of course, this and all other settings are still accessible via the printer's own web interface, which makes any changes the default settings of the printer (see the official Brother documentation).<br />
<br />
=Setup with PCL-6 and Gutenprint=<br />
<br />
The MFC-9840CDW also natively supports (via emulation) the PCL-6 format, so we can take advantage of this feature. The procedure is essentially identical as with the postscript configuration above, except for a couple of things.<br />
<br />
* Install the '''gutenprint''' package.<br />
* Instead of '''postscript_p1''' in the Device URI field, use '''pcl_p1''' (the '''pcl''' has a lowercase 'L', not a numeral 'one').<br />
* Under For the Make/Manufacturer, click on '''Generic''' again, but instead choose the '''Generic PCL 6/PCL XL Printer - CUPS+Gutenprint v.5.2.3 (en)''' option. (The Gutenprint version number is dependant, of course, on which version of '''gutenprint''' you have installed.)<br />
<br />
Customize the default printer settings, to the extent that they are controlled by CUPS, by clicking on the '''Set Printer Options''' button in the CUPS web interface. You will notice that the Gutenprint driver has many more options than the generic PostScript driver. You may want to repeat the procedure above and add a second printer, and then customize this second printer's settings to your liking (e.g., color instead of greyscale).<br />
<br />
''Note: As there are many different PCL-6 drivers available, you may want to experiment with using these different ones instead of the CUPS+Gutenprint one. To change the driver, click on '''Modify Printer''' and go through the wizard, just like when you were adding the printer from the beginning.''</div>
Listdata
https://wiki.archlinux.org/index.php?title=Brother_MFC-9840CDW&diff=62740
Brother MFC-9840CDW
2009-02-21T06:15:20Z
<p>Listdata: /* Setup with PostScript */</p>
<hr />
<div>[[Category:Printers_(English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
=Introduction=<br />
<br />
This is a small tutorial to make the printer Brother MFC-9840CDW work on Arch, through a wired (ethernet cable) network connection.<br />
<br />
Currently, you can set it up with either the generic postscript drivers, or PCL-6 drivers with gutenprint (as the MFC-9840CDW supports PCL-6 emulation).<br />
<br />
'''TIP: You can add multiple versions of the MFC-9840CDW by repeating the steps below, and then for each version, changing the printer settings with the ''Set Printer Options'' button in CUPS. This way, you can quickly set up default settings that you use often (e.g., color vs. greyscale), and then print with these options by simply selecting the corresponding printer in your application.'''<br />
<br />
=Setup with PostScript=<br />
<br />
The MFC-9840CDW natively supports the postscript format, so for basic printing functionality we'll be using the generic postscript driver that comes with the foomatic packages. (Although it's probably better to convert the official Brother drivers for Linux (currently available in either .rpm or .deb format), no one has done so yet.)<br />
<br />
* Install the '''cups''' package. Make sure it's working by going to http://localhost:631<br />
* Install the '''foomatic-db''', '''foomatic-db-engine''', and '''foomatic-filters''' packages (to get the generic postscript driver that we need).<br />
* Make sure the printer is connected to your network router/switch. If your router is acting as a DHCP server, the MFC-9840CDW will automatically get an IP address assigned. Make note of this IP address. (You could also assign a static IP address to your printer, but that is outside the scope of this article).<br />
* Go to http://localhost:631 to open up the CUPS web interface.<br />
* Click on the '''Administration''' tab and then click on '''Add printer.'''<br />
* Select the "Internet Printing Protocol (http)" option for the Device.<br />
* For the Device URI, use: '''http://IPADDRESSOFPRINTER:631/postscript_p1'''. E.g., '''http://192.168.0.102:631/postscript_p1'''<br />
* For the Make/Manufacturer, click on '''Generic''', then '''Generic PostScript Printer Foomatic/Postscript (en)''' (do not choose the "Level 1" variant, as it is an older postcript driver for older printers)<br />
* Click on '''Add Printer''' to finish the wizard.<br />
<br />
Print out a test page to see if everything works. The above configuration allows you to change the duplex and resolution (dpi) settings within CUPS, via the '''Set Printer Options''' button under the '''Printers''' tab, but is missing the "Toner save" option. Of course, this and all other settings are still accessible via the printer's own web interface, which makes any changes the default settings of the printer (see the official Brother documentation).<br />
<br />
=Setup with PCL-6 and Gutenprint=<br />
<br />
The MFC-9840CDW also natively supports (via emulation) the PCL-6 format, so we can take advantage of this feature. The procedure is essentially identical as with the postscript configuration above, except for a couple of things.<br />
<br />
* Install the '''gutenprint''' package.<br />
* Instead of '''postscript_p1''' in the Device URI field, use '''pcl_p1''' (the '''pcl''' has a lowercase 'L', not a numeral 'one').<br />
* Under For the Make/Manufacturer, click on '''Generic''' again, but instead choose the '''Generic PCL 6/PCL XL Printer - CUPS+Gutenprint v.5.2.3 (en)''' option. (The Gutenprint version number is dependant, of course, on which version of '''gutenprint''' you have installed.)<br />
<br />
Customize the default printer settings, to the extent that they are controlled by CUPS, by clicking on the '''Set Printer Options''' button in the CUPS web interface. You will notice that the Gutenprint driver has many more options than the generic PostScript driver. You may want to repeat the procedure above and add a second printer, and then customize this second printer's settings to your liking (e.g., color instead of greyscale).<br />
<br />
''Note: As there are many different PCL-6 drivers available, you may want to experiment with using these different ones instead of the CUPS+Gutenprint one. To change the driver, click on '''Modify Printer''' and go through the wizard, just like when you were adding the printer from the beginning.''</div>
Listdata
https://wiki.archlinux.org/index.php?title=Brother_MFC-9840CDW&diff=62739
Brother MFC-9840CDW
2009-02-21T06:14:49Z
<p>Listdata: /* Introduction */</p>
<hr />
<div>[[Category:Printers_(English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
=Introduction=<br />
<br />
This is a small tutorial to make the printer Brother MFC-9840CDW work on Arch, through a wired (ethernet cable) network connection.<br />
<br />
Currently, you can set it up with either the generic postscript drivers, or PCL-6 drivers with gutenprint (as the MFC-9840CDW supports PCL-6 emulation).<br />
<br />
'''TIP: You can add multiple versions of the MFC-9840CDW by repeating the steps below, and then for each version, changing the printer settings with the ''Set Printer Options'' button in CUPS. This way, you can quickly set up default settings that you use often (e.g., color vs. greyscale), and then print with these options by simply selecting the corresponding printer in your application.'''<br />
<br />
=Setup with PostScript=<br />
<br />
The MFC-9840CDW natively supports the postscript format, so for basic printing functionality we'll be using the generic postscript driver that comes with the foomatic packages. (Although it's probably better to convert the official Brother drivers for Linux (currently available in either .rpm or .deb format), no one has done so yet.)<br />
<br />
Currently, the following postscript setup results in somewhat fuzzy text. Use the PCL-6 drivers to get crispy-clean (although limited to 600x600 dpi) results.<br />
<br />
* Install the '''cups''' package. Make sure it's working by going to http://localhost:631<br />
* Install the '''foomatic-db''', '''foomatic-db-engine''', and '''foomatic-filters''' packages (to get the generic postscript driver that we need).<br />
* Make sure the printer is connected to your network router/switch. If your router is acting as a DHCP server, the MFC-9840CDW will automatically get an IP address assigned. Make note of this IP address. (You could also assign a static IP address to your printer, but that is outside the scope of this article).<br />
* Go to http://localhost:631 to open up the CUPS web interface.<br />
* Click on the '''Administration''' tab and then click on '''Add printer.'''<br />
* Select the "Internet Printing Protocol (http)" option for the Device.<br />
* For the Device URI, use: '''http://IPADDRESSOFPRINTER:631/postscript_p1'''. E.g., '''http://192.168.0.102:631/postscript_p1'''<br />
* For the Make/Manufacturer, click on '''Generic''', then '''Generic PostScript Printer Foomatic/Postscript (en)''' (do not choose the "Level 1" variant, as it is an older postcript driver for older printers)<br />
* Click on '''Add Printer''' to finish the wizard.<br />
<br />
Print out a test page to see if everything works. The above configuration allows you to change the duplex and resolution (dpi) settings within CUPS, via the '''Set Printer Options''' button under the '''Printers''' tab, but is missing the "Toner save" option. Of course, this and all other settings are still accessible via the printer's own web interface, which makes any changes the default settings of the printer (see the official Brother documentation).<br />
<br />
=Setup with PCL-6 and Gutenprint=<br />
<br />
The MFC-9840CDW also natively supports (via emulation) the PCL-6 format, so we can take advantage of this feature. The procedure is essentially identical as with the postscript configuration above, except for a couple of things.<br />
<br />
* Install the '''gutenprint''' package.<br />
* Instead of '''postscript_p1''' in the Device URI field, use '''pcl_p1''' (the '''pcl''' has a lowercase 'L', not a numeral 'one').<br />
* Under For the Make/Manufacturer, click on '''Generic''' again, but instead choose the '''Generic PCL 6/PCL XL Printer - CUPS+Gutenprint v.5.2.3 (en)''' option. (The Gutenprint version number is dependant, of course, on which version of '''gutenprint''' you have installed.)<br />
<br />
Customize the default printer settings, to the extent that they are controlled by CUPS, by clicking on the '''Set Printer Options''' button in the CUPS web interface. You will notice that the Gutenprint driver has many more options than the generic PostScript driver. You may want to repeat the procedure above and add a second printer, and then customize this second printer's settings to your liking (e.g., color instead of greyscale).<br />
<br />
''Note: As there are many different PCL-6 drivers available, you may want to experiment with using these different ones instead of the CUPS+Gutenprint one. To change the driver, click on '''Modify Printer''' and go through the wizard, just like when you were adding the printer from the beginning.''</div>
Listdata
https://wiki.archlinux.org/index.php?title=Brother_MFC-9840CDW&diff=62738
Brother MFC-9840CDW
2009-02-21T05:53:34Z
<p>Listdata: /* Setup with PCL-6 and Gutenprint */</p>
<hr />
<div>[[Category:Printers_(English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
=Introduction=<br />
<br />
This is a small tutorial to make the printer Brother MFC-9840CDW work on Arch, through a wired (ethernet cable) network connection.<br />
<br />
Currently, you can set it up with either the generic postscript drivers, or the more high-quality (and experimental?) PCL-6 drivers with gutenprint (as the MFC-9840CDW supports PCL-6 emulation).<br />
<br />
'''TIP: You can add multiple versions of the MFC-9840CDW by repeating the steps below, and then for each version, changing the printer settings with the ''Set Printer Options'' button in CUPS. This way, you can quickly set up default settings that you use often (e.g., color vs. greyscale), and then print with these options by simply selecting the corresponding printer in your application.'''<br />
<br />
=Setup with PostScript=<br />
<br />
The MFC-9840CDW natively supports the postscript format, so for basic printing functionality we'll be using the generic postscript driver that comes with the foomatic packages. (Although it's probably better to convert the official Brother drivers for Linux (currently available in either .rpm or .deb format), no one has done so yet.)<br />
<br />
Currently, the following postscript setup results in somewhat fuzzy text. Use the PCL-6 drivers to get crispy-clean (although limited to 600x600 dpi) results.<br />
<br />
* Install the '''cups''' package. Make sure it's working by going to http://localhost:631<br />
* Install the '''foomatic-db''', '''foomatic-db-engine''', and '''foomatic-filters''' packages (to get the generic postscript driver that we need).<br />
* Make sure the printer is connected to your network router/switch. If your router is acting as a DHCP server, the MFC-9840CDW will automatically get an IP address assigned. Make note of this IP address. (You could also assign a static IP address to your printer, but that is outside the scope of this article).<br />
* Go to http://localhost:631 to open up the CUPS web interface.<br />
* Click on the '''Administration''' tab and then click on '''Add printer.'''<br />
* Select the "Internet Printing Protocol (http)" option for the Device.<br />
* For the Device URI, use: '''http://IPADDRESSOFPRINTER:631/postscript_p1'''. E.g., '''http://192.168.0.102:631/postscript_p1'''<br />
* For the Make/Manufacturer, click on '''Generic''', then '''Generic PostScript Printer Foomatic/Postscript (en)''' (do not choose the "Level 1" variant, as it is an older postcript driver for older printers)<br />
* Click on '''Add Printer''' to finish the wizard.<br />
<br />
Print out a test page to see if everything works. The above configuration allows you to change the duplex and resolution (dpi) settings within CUPS, via the '''Set Printer Options''' button under the '''Printers''' tab, but is missing the "Toner save" option. Of course, this and all other settings are still accessible via the printer's own web interface, which makes any changes the default settings of the printer (see the official Brother documentation).<br />
<br />
=Setup with PCL-6 and Gutenprint=<br />
<br />
The MFC-9840CDW also natively supports (via emulation) the PCL-6 format, so we can take advantage of this feature. The procedure is essentially identical as with the postscript configuration above, except for a couple of things.<br />
<br />
* Install the '''gutenprint''' package.<br />
* Instead of '''postscript_p1''' in the Device URI field, use '''pcl_p1''' (the '''pcl''' has a lowercase 'L', not a numeral 'one').<br />
* Under For the Make/Manufacturer, click on '''Generic''' again, but instead choose the '''Generic PCL 6/PCL XL Printer - CUPS+Gutenprint v.5.2.3 (en)''' option. (The Gutenprint version number is dependant, of course, on which version of '''gutenprint''' you have installed.)<br />
<br />
Customize the default printer settings, to the extent that they are controlled by CUPS, by clicking on the '''Set Printer Options''' button in the CUPS web interface. You will notice that the Gutenprint driver has many more options than the generic PostScript driver. You may want to repeat the procedure above and add a second printer, and then customize this second printer's settings to your liking (e.g., color instead of greyscale).<br />
<br />
''Note: As there are many different PCL-6 drivers available, you may want to experiment with using these different ones instead of the CUPS+Gutenprint one. To change the driver, click on '''Modify Printer''' and go through the wizard, just like when you were adding the printer from the beginning.''</div>
Listdata
https://wiki.archlinux.org/index.php?title=Brother_MFC-9840CDW&diff=62736
Brother MFC-9840CDW
2009-02-21T05:44:39Z
<p>Listdata: /* Introduction */</p>
<hr />
<div>[[Category:Printers_(English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
=Introduction=<br />
<br />
This is a small tutorial to make the printer Brother MFC-9840CDW work on Arch, through a wired (ethernet cable) network connection.<br />
<br />
Currently, you can set it up with either the generic postscript drivers, or the more high-quality (and experimental?) PCL-6 drivers with gutenprint (as the MFC-9840CDW supports PCL-6 emulation).<br />
<br />
'''TIP: You can add multiple versions of the MFC-9840CDW by repeating the steps below, and then for each version, changing the printer settings with the ''Set Printer Options'' button in CUPS. This way, you can quickly set up default settings that you use often (e.g., color vs. greyscale), and then print with these options by simply selecting the corresponding printer in your application.'''<br />
<br />
=Setup with PostScript=<br />
<br />
The MFC-9840CDW natively supports the postscript format, so for basic printing functionality we'll be using the generic postscript driver that comes with the foomatic packages. (Although it's probably better to convert the official Brother drivers for Linux (currently available in either .rpm or .deb format), no one has done so yet.)<br />
<br />
Currently, the following postscript setup results in somewhat fuzzy text. Use the PCL-6 drivers to get crispy-clean (although limited to 600x600 dpi) results.<br />
<br />
* Install the '''cups''' package. Make sure it's working by going to http://localhost:631<br />
* Install the '''foomatic-db''', '''foomatic-db-engine''', and '''foomatic-filters''' packages (to get the generic postscript driver that we need).<br />
* Make sure the printer is connected to your network router/switch. If your router is acting as a DHCP server, the MFC-9840CDW will automatically get an IP address assigned. Make note of this IP address. (You could also assign a static IP address to your printer, but that is outside the scope of this article).<br />
* Go to http://localhost:631 to open up the CUPS web interface.<br />
* Click on the '''Administration''' tab and then click on '''Add printer.'''<br />
* Select the "Internet Printing Protocol (http)" option for the Device.<br />
* For the Device URI, use: '''http://IPADDRESSOFPRINTER:631/postscript_p1'''. E.g., '''http://192.168.0.102:631/postscript_p1'''<br />
* For the Make/Manufacturer, click on '''Generic''', then '''Generic PostScript Printer Foomatic/Postscript (en)''' (do not choose the "Level 1" variant, as it is an older postcript driver for older printers)<br />
* Click on '''Add Printer''' to finish the wizard.<br />
<br />
Print out a test page to see if everything works. The above configuration allows you to change the duplex and resolution (dpi) settings within CUPS, via the '''Set Printer Options''' button under the '''Printers''' tab, but is missing the "Toner save" option. Of course, this and all other settings are still accessible via the printer's own web interface, which makes any changes the default settings of the printer (see the official Brother documentation).<br />
<br />
=Setup with PCL-6 and Gutenprint=<br />
<br />
The MFC-9840CDW also natively supports (via emulation) the PCL-6 format, so we can take advantage of this feature. The procedure is essentially identical as with the postscript configuration above, except for a couple of things.<br />
<br />
* Install the '''gutenprint''' package.<br />
* Instead of '''postscript_p1''' in the Device URI field, use '''pcl_p1''' (the '''pcl''' has a lowercase 'L', not a numeral 'one').<br />
* Under For the Make/Manufacturer, click on '''Generic''' again, but instead choose the '''Generic PCL 6/PCL XL Printer - CUPS+Gutenprint v.5.2.3 (en)''' option. (The Gutenprint version number is dependant, of course, on which version of '''gutenprint''' you have installed.)<br />
<br />
Customize the default printer settings, to the extent that they are controlled by CUPS, by clicking on the '''Set Printer Options''' button in the CUPS web interface. You will notice that the Gutenprint driver has many more options than the generic PostScript driver. You may want to repeat the procedure above and add a second printer, and then customize this second printer's settings to your liking (e.g., color instead of greyscale).</div>
Listdata
https://wiki.archlinux.org/index.php?title=Brother_MFC-9840CDW&diff=62735
Brother MFC-9840CDW
2009-02-21T05:44:17Z
<p>Listdata: /* Introduction */</p>
<hr />
<div>[[Category:Printers_(English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
=Introduction=<br />
<br />
This is a small tutorial to make the printer Brother MFC-9840CDW work on Arch, through a wired (ethernet cable) network connection.<br />
<br />
Currently, you can set it up with either the generic postscript drivers, or the more high-quality (and experimental?) PCL-6 drivers with gutenprint (as the MFC-9840CDW supports PCL-6 emulation).<br />
<br />
'''TIP: You can add multiple versions of the MFC-9840CDW by repeating the steps below, and then for each version, changing the printer settings with the ''Set Printer Options'' button in CUPS. This way, you can quickly set up default settings that you use often (e.g., color vs. greyscale), and then print with these options by simply selecting a different printer in your application.'''<br />
<br />
=Setup with PostScript=<br />
<br />
The MFC-9840CDW natively supports the postscript format, so for basic printing functionality we'll be using the generic postscript driver that comes with the foomatic packages. (Although it's probably better to convert the official Brother drivers for Linux (currently available in either .rpm or .deb format), no one has done so yet.)<br />
<br />
Currently, the following postscript setup results in somewhat fuzzy text. Use the PCL-6 drivers to get crispy-clean (although limited to 600x600 dpi) results.<br />
<br />
* Install the '''cups''' package. Make sure it's working by going to http://localhost:631<br />
* Install the '''foomatic-db''', '''foomatic-db-engine''', and '''foomatic-filters''' packages (to get the generic postscript driver that we need).<br />
* Make sure the printer is connected to your network router/switch. If your router is acting as a DHCP server, the MFC-9840CDW will automatically get an IP address assigned. Make note of this IP address. (You could also assign a static IP address to your printer, but that is outside the scope of this article).<br />
* Go to http://localhost:631 to open up the CUPS web interface.<br />
* Click on the '''Administration''' tab and then click on '''Add printer.'''<br />
* Select the "Internet Printing Protocol (http)" option for the Device.<br />
* For the Device URI, use: '''http://IPADDRESSOFPRINTER:631/postscript_p1'''. E.g., '''http://192.168.0.102:631/postscript_p1'''<br />
* For the Make/Manufacturer, click on '''Generic''', then '''Generic PostScript Printer Foomatic/Postscript (en)''' (do not choose the "Level 1" variant, as it is an older postcript driver for older printers)<br />
* Click on '''Add Printer''' to finish the wizard.<br />
<br />
Print out a test page to see if everything works. The above configuration allows you to change the duplex and resolution (dpi) settings within CUPS, via the '''Set Printer Options''' button under the '''Printers''' tab, but is missing the "Toner save" option. Of course, this and all other settings are still accessible via the printer's own web interface, which makes any changes the default settings of the printer (see the official Brother documentation).<br />
<br />
=Setup with PCL-6 and Gutenprint=<br />
<br />
The MFC-9840CDW also natively supports (via emulation) the PCL-6 format, so we can take advantage of this feature. The procedure is essentially identical as with the postscript configuration above, except for a couple of things.<br />
<br />
* Install the '''gutenprint''' package.<br />
* Instead of '''postscript_p1''' in the Device URI field, use '''pcl_p1''' (the '''pcl''' has a lowercase 'L', not a numeral 'one').<br />
* Under For the Make/Manufacturer, click on '''Generic''' again, but instead choose the '''Generic PCL 6/PCL XL Printer - CUPS+Gutenprint v.5.2.3 (en)''' option. (The Gutenprint version number is dependant, of course, on which version of '''gutenprint''' you have installed.)<br />
<br />
Customize the default printer settings, to the extent that they are controlled by CUPS, by clicking on the '''Set Printer Options''' button in the CUPS web interface. You will notice that the Gutenprint driver has many more options than the generic PostScript driver. You may want to repeat the procedure above and add a second printer, and then customize this second printer's settings to your liking (e.g., color instead of greyscale).</div>
Listdata
https://wiki.archlinux.org/index.php?title=Brother_MFC-9840CDW&diff=62734
Brother MFC-9840CDW
2009-02-21T05:41:59Z
<p>Listdata: /* Setup with PostScript */</p>
<hr />
<div>[[Category:Printers_(English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
=Introduction=<br />
<br />
This is a small tutorial to make the printer Brother MFC-9840CDW work on Arch, through a wired (ethernet cable) network connection.<br />
<br />
Currently, you can set it up with either the generic postscript drivers, or the more high-quality (and experimental?) PCL-6 drivers with gutenprint (as the MFC-9840CDW supports PCL-6 emulation).<br />
<br />
'''TIP: You can add multiple versions of the MFC-9840CDW by repeating the steps below, and then for each version, changing the printer settings with the ''Set Printer Options'' button in CUPS. This way, you can quickly set up default settings that you use often (e.g., color vs. greyscale).'''<br />
<br />
=Setup with PostScript=<br />
<br />
The MFC-9840CDW natively supports the postscript format, so for basic printing functionality we'll be using the generic postscript driver that comes with the foomatic packages. (Although it's probably better to convert the official Brother drivers for Linux (currently available in either .rpm or .deb format), no one has done so yet.)<br />
<br />
Currently, the following postscript setup results in somewhat fuzzy text. Use the PCL-6 drivers to get crispy-clean (although limited to 600x600 dpi) results.<br />
<br />
* Install the '''cups''' package. Make sure it's working by going to http://localhost:631<br />
* Install the '''foomatic-db''', '''foomatic-db-engine''', and '''foomatic-filters''' packages (to get the generic postscript driver that we need).<br />
* Make sure the printer is connected to your network router/switch. If your router is acting as a DHCP server, the MFC-9840CDW will automatically get an IP address assigned. Make note of this IP address. (You could also assign a static IP address to your printer, but that is outside the scope of this article).<br />
* Go to http://localhost:631 to open up the CUPS web interface.<br />
* Click on the '''Administration''' tab and then click on '''Add printer.'''<br />
* Select the "Internet Printing Protocol (http)" option for the Device.<br />
* For the Device URI, use: '''http://IPADDRESSOFPRINTER:631/postscript_p1'''. E.g., '''http://192.168.0.102:631/postscript_p1'''<br />
* For the Make/Manufacturer, click on '''Generic''', then '''Generic PostScript Printer Foomatic/Postscript (en)''' (do not choose the "Level 1" variant, as it is an older postcript driver for older printers)<br />
* Click on '''Add Printer''' to finish the wizard.<br />
<br />
Print out a test page to see if everything works. The above configuration allows you to change the duplex and resolution (dpi) settings within CUPS, via the '''Set Printer Options''' button under the '''Printers''' tab, but is missing the "Toner save" option. Of course, this and all other settings are still accessible via the printer's own web interface, which makes any changes the default settings of the printer (see the official Brother documentation).<br />
<br />
=Setup with PCL-6 and Gutenprint=<br />
<br />
The MFC-9840CDW also natively supports (via emulation) the PCL-6 format, so we can take advantage of this feature. The procedure is essentially identical as with the postscript configuration above, except for a couple of things.<br />
<br />
* Install the '''gutenprint''' package.<br />
* Instead of '''postscript_p1''' in the Device URI field, use '''pcl_p1''' (the '''pcl''' has a lowercase 'L', not a numeral 'one').<br />
* Under For the Make/Manufacturer, click on '''Generic''' again, but instead choose the '''Generic PCL 6/PCL XL Printer - CUPS+Gutenprint v.5.2.3 (en)''' option. (The Gutenprint version number is dependant, of course, on which version of '''gutenprint''' you have installed.)<br />
<br />
Customize the default printer settings, to the extent that they are controlled by CUPS, by clicking on the '''Set Printer Options''' button in the CUPS web interface. You will notice that the Gutenprint driver has many more options than the generic PostScript driver. You may want to repeat the procedure above and add a second printer, and then customize this second printer's settings to your liking (e.g., color instead of greyscale).</div>
Listdata
https://wiki.archlinux.org/index.php?title=Brother_MFC-9840CDW&diff=62733
Brother MFC-9840CDW
2009-02-21T05:37:04Z
<p>Listdata: /* Setup with PCL-6 and Gutenprint */</p>
<hr />
<div>[[Category:Printers_(English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
=Introduction=<br />
<br />
This is a small tutorial to make the printer Brother MFC-9840CDW work on Arch, through a wired (ethernet cable) network connection.<br />
<br />
Currently, you can set it up with either the generic postscript drivers, or the more high-quality (and experimental?) PCL-6 drivers with gutenprint (as the MFC-9840CDW supports PCL-6 emulation).<br />
<br />
'''TIP: You can add multiple versions of the MFC-9840CDW by repeating the steps below, and then for each version, changing the printer settings with the ''Set Printer Options'' button in CUPS. This way, you can quickly set up default settings that you use often (e.g., color vs. greyscale).'''<br />
<br />
=Setup with PostScript=<br />
<br />
The MFC-9840CDW natively supports the postscript format, so for basic printing functionality we'll be using the generic postscript driver that comes with the foomatic packages. (Although it's probably better to convert the official Brother drivers for Linux (currently available in either .rpm or .deb format), no one has done so yet.)<br />
<br />
Currently, the following postscript setup results in somewhat fuzzy text. Use the PCL-6 drivers to get crispy-clean (although limited to 600x600 dpi) results.<br />
<br />
* Install the '''cups''' package. Make sure it's working by going to http://localhost:631<br />
* Install the '''foomatic-db''', '''foomatic-db-engine''', and '''foomatic-filters''' packages (to get the generic postscript driver that we need).<br />
* Make sure the printer is connected to your network router/switch. If your router is acting as a DHCP server, the MFC-9840CDW will automatically get an IP address assigned. Make note of this IP address. (You could also assign a static IP address to your printer, but that is outside the scope of this article).<br />
* Go to http://localhost:631 to open up the CUPS web interface.<br />
* Click on "Manage Printers" and then "Add printer."<br />
* Select the "Internet Printing Protocol (http)" option for the Device.<br />
* For the Device URI, use: '''http://IPADDRESSOFPRINTER:631/postscript_p1'''. E.g., '''http://192.168.0.102:631/postscript_p1'''<br />
* For the Make/Manufacturer, click on '''Generic''', then '''Generic PostScript Printer Foomatic/Postscript (en)''' (do not choose the "Level 1" variant, as it is an older postcript driver for older printers)<br />
* Click on '''Add Printer''' to finish the wizard.<br />
<br />
Print out a test page to see if everything works. The above configuration allows you to change the duplex and resolution (dpi) settings within CUPS, via the '''Set Printer Options''' button under the '''Printers''' tab, but is missing the "Toner save" option. Of course, this and all other settings are still accessible via the printer's own web interface, which makes any changes the default settings of the printer (see the official Brother documentation).<br />
<br />
=Setup with PCL-6 and Gutenprint=<br />
<br />
The MFC-9840CDW also natively supports (via emulation) the PCL-6 format, so we can take advantage of this feature. The procedure is essentially identical as with the postscript configuration above, except for a couple of things.<br />
<br />
* Install the '''gutenprint''' package.<br />
* Instead of '''postscript_p1''' in the Device URI field, use '''pcl_p1''' (the '''pcl''' has a lowercase 'L', not a numeral 'one').<br />
* Under For the Make/Manufacturer, click on '''Generic''' again, but instead choose the '''Generic PCL 6/PCL XL Printer - CUPS+Gutenprint v.5.2.3 (en)''' option. (The Gutenprint version number is dependant, of course, on which version of '''gutenprint''' you have installed.)<br />
<br />
Customize the default printer settings, to the extent that they are controlled by CUPS, by clicking on the '''Set Printer Options''' button in the CUPS web interface. You will notice that the Gutenprint driver has many more options than the generic PostScript driver. You may want to repeat the procedure above and add a second printer, and then customize this second printer's settings to your liking (e.g., color instead of greyscale).</div>
Listdata
https://wiki.archlinux.org/index.php?title=Brother_MFC-9840CDW&diff=62732
Brother MFC-9840CDW
2009-02-21T05:35:25Z
<p>Listdata: </p>
<hr />
<div>[[Category:Printers_(English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
=Introduction=<br />
<br />
This is a small tutorial to make the printer Brother MFC-9840CDW work on Arch, through a wired (ethernet cable) network connection.<br />
<br />
Currently, you can set it up with either the generic postscript drivers, or the more high-quality (and experimental?) PCL-6 drivers with gutenprint (as the MFC-9840CDW supports PCL-6 emulation).<br />
<br />
'''TIP: You can add multiple versions of the MFC-9840CDW by repeating the steps below, and then for each version, changing the printer settings with the ''Set Printer Options'' button in CUPS. This way, you can quickly set up default settings that you use often (e.g., color vs. greyscale).'''<br />
<br />
=Setup with PostScript=<br />
<br />
The MFC-9840CDW natively supports the postscript format, so for basic printing functionality we'll be using the generic postscript driver that comes with the foomatic packages. (Although it's probably better to convert the official Brother drivers for Linux (currently available in either .rpm or .deb format), no one has done so yet.)<br />
<br />
Currently, the following postscript setup results in somewhat fuzzy text. Use the PCL-6 drivers to get crispy-clean (although limited to 600x600 dpi) results.<br />
<br />
* Install the '''cups''' package. Make sure it's working by going to http://localhost:631<br />
* Install the '''foomatic-db''', '''foomatic-db-engine''', and '''foomatic-filters''' packages (to get the generic postscript driver that we need).<br />
* Make sure the printer is connected to your network router/switch. If your router is acting as a DHCP server, the MFC-9840CDW will automatically get an IP address assigned. Make note of this IP address. (You could also assign a static IP address to your printer, but that is outside the scope of this article).<br />
* Go to http://localhost:631 to open up the CUPS web interface.<br />
* Click on "Manage Printers" and then "Add printer."<br />
* Select the "Internet Printing Protocol (http)" option for the Device.<br />
* For the Device URI, use: '''http://IPADDRESSOFPRINTER:631/postscript_p1'''. E.g., '''http://192.168.0.102:631/postscript_p1'''<br />
* For the Make/Manufacturer, click on '''Generic''', then '''Generic PostScript Printer Foomatic/Postscript (en)''' (do not choose the "Level 1" variant, as it is an older postcript driver for older printers)<br />
* Click on '''Add Printer''' to finish the wizard.<br />
<br />
Print out a test page to see if everything works. The above configuration allows you to change the duplex and resolution (dpi) settings within CUPS, via the '''Set Printer Options''' button under the '''Printers''' tab, but is missing the "Toner save" option. Of course, this and all other settings are still accessible via the printer's own web interface, which makes any changes the default settings of the printer (see the official Brother documentation).<br />
<br />
=Setup with PCL-6 and Gutenprint=<br />
<br />
The MFC-9840CDW also natively supports (via emulation) the PCL-6 format, so we can take advantage of this feature. The procedure is essentially identical as with the postscript configuration above, except for a couple of things.<br />
<br />
* Install the '''gutenprint''' package.<br />
* Instead of '''postscript_p1''' in the Device URI field, use '''pcl_p1''' (the '''pcl''' has a lowercase 'L', not a numeral 'one').<br />
* Under For the Make/Manufacturer, click on '''Generic''' again, but instead choose the '''Generic PCL 6/PCL XL Printer - CUPS+Gutenprint v.5.2.3 (en)''' option. (The Gutenprint version number is dependant, of course, on which version of '''gutenprint''' you have installed.)<br />
<br />
Customize the default printer settings, to the extent that they are controlled by CUPS, by clicking on the '''Set Printer Options''' button in the CUPS web interface. You may want to repeat the procedure above and add a second printer, and then customize this second printer's settings to your liking (e.g., color instead of greyscale).</div>
Listdata
https://wiki.archlinux.org/index.php?title=Brother_MFC-9840CDW&diff=62731
Brother MFC-9840CDW
2009-02-21T05:18:09Z
<p>Listdata: /* Introduction */</p>
<hr />
<div>[[Category:Printers_(English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
=Introduction=<br />
<br />
This is a small tutorial to make the printer Brother MFC-9840CDW work on Arch, through a wired (ethernet cable) network connection.<br />
<br />
Currently, you can set it up with either the generic postscript drivers, or the more high-quality (and experimental?) PCL-6 drivers with gutenprint (as the MFC-9840CDW supports PCL-6 emulation).<br />
<br />
=Setup with PostScript=<br />
<br />
The MFC-9840CDW natively supports the postscript format, so for basic printing functionality we'll be using the generic postscript driver that comes with the foomatic packages. (Although it's probably better to convert the official Brother drivers for Linux (currently available in either .rpm or .deb format), no one has done so yet.)<br />
<br />
* Install the '''cups''' package.<br />
* Install the '''foomatic-db''', '''foomatic-db-engine''', and '''foomatic-filters''' packages (to get the generic postscript driver that we need).<br />
* Make sure the printer is connected to your network router/switch. If your router is acting as a DHCP server, the MFC-9840CDW will automatically get an IP address assigned. Make note of this IP address. (You could also assign a static IP address to your printer, but that is outside the scope of this article).<br />
* Go to http://localhost:631 to open up the CUPS web interface.<br />
* Click on "Manage Printers" and then "Add printer."<br />
* Select the "Internet Printing Protocol (http)" option for the Device.<br />
* For the Device URI, use: '''http://IPADDRESSOFPRINTER:631/postscript_p1'''. E.g., '''http://192.168.0.102:631/postscript_p1'''<br />
* For the Make/Manufacturer, click on '''Generic''', then '''Generic PostScript Printer Foomatic/Postscript (en)''' (do not choose the "Level 1" variant, as it is an older postcript driver for older printers)<br />
* Click on '''Add Printer''' to finish the wizard.<br />
<br />
Print out a test page to see if everything works. The above configuration allows you to change the duplex and resolution (dpi) settings, but is missing the "Toner save" option. Of course, this and all other settings are still accessible via the printer's own web interface, which makes any changes the default settings of the printer (see the official Brother documentation).</div>
Listdata
https://wiki.archlinux.org/index.php?title=Brother_MFC-9840CDW&diff=62730
Brother MFC-9840CDW
2009-02-21T04:40:58Z
<p>Listdata: New page: Category:Printers_(English) Category:HOWTOs (English) =Introduction= This is a small tutorial to make the printer Brother MFC-9840CDW work on Arch, through a wired (ethernet cabl...</p>
<hr />
<div>[[Category:Printers_(English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
=Introduction=<br />
<br />
This is a small tutorial to make the printer Brother MFC-9840CDW work on Arch, through a wired (ethernet cable) network connection.<br />
<br />
=Setup with PostScript=<br />
<br />
The MFC-9840CDW natively supports the postscript format, so for basic printing functionality we'll be using the generic postscript driver that comes with the foomatic packages. (Although it's probably better to convert the official Brother drivers for Linux (currently available in either .rpm or .deb format), no one has done so yet.)<br />
<br />
* Install the '''cups''' package.<br />
* Install the '''foomatic-db''', '''foomatic-db-engine''', and '''foomatic-filters''' packages (to get the generic postscript driver that we need).<br />
* Make sure the printer is connected to your network router/switch. If your router is acting as a DHCP server, the MFC-9840CDW will automatically get an IP address assigned. Make note of this IP address. (You could also assign a static IP address to your printer, but that is outside the scope of this article).<br />
* Go to http://localhost:631 to open up the CUPS web interface.<br />
* Click on "Manage Printers" and then "Add printer."<br />
* Select the "Internet Printing Protocol (http)" option for the Device.<br />
* For the Device URI, use: '''http://IPADDRESSOFPRINTER:631/postscript_p1'''. E.g., '''http://192.168.0.102:631/postscript_p1'''<br />
* For the Make/Manufacturer, click on '''Generic''', then '''Generic PostScript Printer Foomatic/Postscript (en)''' (do not choose the "Level 1" variant, as it is an older postcript driver for older printers)<br />
* Click on '''Add Printer''' to finish the wizard.<br />
<br />
Print out a test page to see if everything works. The above configuration allows you to change the duplex and resolution (dpi) settings, but is missing the "Toner save" option. Of course, this and all other settings are still accessible via the printer's own web interface, which makes any changes the default settings of the printer (see the official Brother documentation).</div>
Listdata
https://wiki.archlinux.org/index.php?title=Post_Installation_Tips&diff=60970
Post Installation Tips
2009-02-10T11:01:18Z
<p>Listdata: /* Getting a colored manpage */ Clarification of the two ways to achieve colored manpages (letting the reader know of the existence of 2 methods earlier up in the wiki) ; also, some info about ANSI</p>
<hr />
<div>[[Category:Getting and installing Arch (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|Česky|Poinstalační tipy (Česky)}}<br />
{{i18n_entry|English|Post Installation Tips}}<br />
{{i18n_entry|Español|Consejos para después de Instalar (Español)}}<br />
{{i18n_entry|Italiano|Suggerimenti Post Installazione}}<br />
{{i18n_entry|Ελληνικά|Post Installation Tips (Ελληνικά)}}<br />
{{i18n_entry|简体中文|ArchTips(简体中文)}}<br />
{{i18n_entry|Türkçe|Kurulum Sonrası Ayarları (Türkçe)}}<br />
{{i18n_links_end}}<br />
<br />
==Introduction==<br />
Here are some performance tweaks and other useful information for Arch Linux newbies.<br />
<br />
==Hardware Auto-Recognition==<br />
* <code>lshwd</code> is your hardware auto-recognition tool. It will inform you which module you need to load and set.<br />
* Or you can use <code>hwdetect</code>. In my experience it detects more hardware and is faster than lshwd. More information: [[hwdetect]]<br />
<br />
==Lilo Boot Process Speed-Up==<br />
* To speed up lilo boot process, add the following command to <code>/etc/lilo.conf</code>:<br />
compact<br />
<br />
==End of Boot Process==<br />
After the boot process, the screen is cleared and the login prompt appears. Some users may want to modify this behavior such that they can see the messages that appeared during the boot process still.<br />
<br />
You can either add one of the following to the bottom of your /etc/rc.local file:<br />
* Wait at the end of the process until you press a key before clearing the screen and letting you log in:<br />
read -n1<br />
* Wait for at most 5 seconds or until you press a key:<br />
read -t5 -n1<br />
<br />
Or:<br />
* Remove the first 3 characters in <code>/etc/issue</code> file, which is a "clear screen" escape code. Obviously this will stop the screen from being cleared after you log out from your login session as well as just after boot.<br />
* Run <code>dmesg</code> from the shell prompt to display all the boot messages generated by the kernel.<br />
* comment out the agetty instance that runs on vc/1 in /etc/inittab.<br />
<pre>#c1:2345:respawn:/sbin/agetty -8 38400 vc/1 linux</pre><br />
<br />
==Colorize your console prompt (PS1)==<br />
~/.bashrc and /root/.bash_profile contain the default PS1 (shell prompt) variables for normal user and root, respectively.<br />
<br />
As normal user:<br />
$ nano ~/.bashrc<br />
Comment out the default prompt:<br />
#PS1='[\u@\h \W]\$ '<br />
And add:<br />
PS1='\[\e[0;32m\]\u\[\e[m\] \[\e[1;34m\]\w\[\e[m\] \[\e[m\] \[\e[1;32m\]\$ \[\e[m\]\[\e[1;37m\] '<br />
This will give a very pleasing, colorful prompt and theme for the console with bright white text.<br />
The awkward string above contains color-set escape sequences (start coloring: \[\e[color\], end coloring: \[\e[m\]) and info placeholders:<br />
*'''\u''' - username, your original prompt has also '''\h''' - host name<br />
*'''\w''' - current absolute path, use '''\W''' for current relative path<br />
*'''\$''' - the prompt character (eg. '#')<br />
<br />
The last color-set sequence "\[\e[1;37m\]" is not closed, so the remaining text (everything you type, output of the programs) will be in that (bright white) color. You may wish to change this color or delete sequence for default color.<br />
<br />
<br />
As root, edit the /root/.bashrc:<br />
# nano /root/.bash_profile<br />
Comment out the default PS1:<br />
#PS1='[\u@\h \W]\$ '<br />
The following PS1 is useful for a root bash prompt, with red designation and green console text:<br />
PS1='\[\e[0;31m\]\u\[\e[m\] \[\e[1;34m\]\w\[\e[m\] \[\e[0;31m\]\$ \[\e[m\]\[\e[0;32m\] '<br />
<br />
For more, see the [[Color Bash Prompt]] wiki entry.<br />
<br />
==Colorize the output of 'ls'==<br />
Your <code>~/.bashrc</code> should already have the following entry copied from <code>/etc/skel/.bashrc</code><br />
alias ls='ls --color=auto'<br />
<br />
Just add to your <code>~/.bashrc</code><br />
eval `dircolors -b`<br />
This will further enhance the colored <code>ls</code> output; for example, broken (orphan) symlinks will show in red, etc.<br><br />
''Note the backquote/backtick/grave accent character used here - this is not a single quote/apostrophe.''<br />
<br />
==Colorize the output of 'grep'==<br />
In your <code>~/.bashrc</code> file add the following entry:<br />
export GREP_COLOR="1;33"<br />
alias grep='grep --color=auto'<br />
<br />
The variable <code>GREP_COLOR</code> here is used to specify the output color, in this example a light yellow color.<br />
<br />
==Less on steroids==<br />
If you are a frequent user of the command line interface, you might want to install lesspipe (that you will find on AUR). It will allow you to type:<br />
less lesspipe.tar.gz<br />
==> use tar_file:contained_file to view a file in the archive<br />
-rw------- solstice/users 695 2008-01-04 19:24 lesspipe/PKGBUILD<br />
-rw------- solstice/users 43 2007-11-07 11:17 lesspipe/lesspipe.sh<br />
lesspipe.tar.gz (END)<br />
<br />
i.e. use less to see the content of many files, instead of using specific command each time.<br />
Use <tt>man lesspipe</tt> to see how to activate it.<br />
<br />
==Change Console Fonts==<br />
Terminus is a popular favorite amongst Archers. Install with:<br />
pacman -S terminus-font<br />
Edit /etc/rc.conf:<br />
CONSOLEFONT="ter-v16b"<br />
Or find other fonts(with other sizes and styles) in /usr/share/kbd/consolefonts.<br />
Switch fonts on-the-fly with '''setfont''':<br />
setfont ter-v16b<br />
If the console font is changed during the boot process and you get a strange character output, add the "keymap" hook to the mkinitcpio.conf and create the initramfs image again: [[Mkinitcpio#Available_hooks|available Hooks in mkinitcpio]].<br />
<br />
==Getting a colored manpage==<br />
If you're new to linux, you will have to read a lot of manpages if you want to learn. However color will allow a clearer presentation of the contents and hopefully easier digestion. There are two ways to get color in your manpages. <br />
<br />
'''First method'''<br />
<br />
The first, more basic method is to install a reader program like most(8).<br />
# pacman -S most<br />
<br />
This is similar to less and more but also allows you to render text in color in an easier way.<br />
<br />
To get it up and running change the /etc/man.conf file and change the PAGER and BROWSER variable to:<br />
PAGER /usr/bin/most -s<br />
BROWSER /usr/bin/most -s<br />
<br />
Now you can type:<br />
$ man whatever_man_page<br />
to see it in clarifying colors.<br />
<br />
If you want to modify the colors, experiment with the ~/.mostrc file (create it if it isn't there) or use /etc/most.conf.<br />
<br />
example ~/.mostrc:<br />
<br />
% Color settings<br />
<br />
color normal lightgray black<br />
color status yellow blue<br />
color underline yellow black<br />
color overstrike brightblue black<br />
<br />
another example for less-like keybindings (jump to line with 'J'):<br />
<br />
% less-like keybindings<br />
<br />
unsetkey "^K"<br />
unsetkey "g"<br />
unsetkey "G"<br />
unsetkey ":"<br />
<br />
setkey next_file ":n"<br />
setkey find_file ":e"<br />
setkey next_file ":p"<br />
setkey toggle_options ":o"<br />
setkey toggle_case ":c"<br />
setkey delete_file ":d"<br />
setkey exit ":q"<br />
<br />
setkey bob "g"<br />
setkey eob "G"<br />
setkey down "e"<br />
setkey down "E"<br />
setkey down "j"<br />
setkey down "^N"<br />
setkey up "y"<br />
setkey up "^Y"<br />
setkey up "k"<br />
setkey up "^P"<br />
setkey up "^K"<br />
setkey page_down "f"<br />
setkey page_down "^F"<br />
setkey page_up "b"<br />
setkey page_up "^B"<br />
setkey other_window "z"<br />
setkey other_window "w"<br />
setkey search_backward "?"<br />
setkey bob "p"<br />
setkey goto_mark "'"<br />
setkey find_file "E"<br />
setkey edit "v"<br />
<br />
'''Second method'''<br />
<br />
Alternatively you can get the same coloured result for manpages with less. This method has the advantage that less has many more features than most, so it comes much more handy for advanced users. Just add the following to your ~/.SHELLrc (i.e., ~/.bashrc if you use bash, or ~/.zshrc if you use zsh). To customize the colors, use different ANSI color codes; see http://en.wikipedia.org/wiki/ANSI_escape_code.<br />
<br />
export LESS_TERMCAP_mb=$'\E[01;31m'<br />
export LESS_TERMCAP_md=$'\E[01;31m'<br />
export LESS_TERMCAP_me=$'\E[0m'<br />
export LESS_TERMCAP_se=$'\E[0m' <br />
export LESS_TERMCAP_so=$'\E[01;44;33m' <br />
export LESS_TERMCAP_ue=$'\E[0m'<br />
export LESS_TERMCAP_us=$'\E[01;32m'<br />
<br />
Source: http://nion.modprobe.de/blog/archives/572-less-colors-for-man-pages.html<br />
<br />
==Accessing AUR seamlessly==<br />
Everyone should know how to use AUR, ABS, and makepkg if they want to build packages. Tracking and updating your custom built packages can become tedious, especially if you have many. There are some programs and scripts that help make building packages more convenient.<br />
<br />
The most popular third-party program that can search AUR is called [http://aur.archlinux.org/packages.php?ID=5863 yaourt].<br />
<br />
[[AUR User Guidelines#List of AUR-DMS|See a list of other programs that help you access AUR]]<br />
<br />
==Enabling History Search==<br />
Usually, when typing <code>ls</code> and pressing <up> key, your current input will be replaced with the last command used. If you are using history search, only past commands beginning with <code>ls</code> (the current input) will be shown.<br />
<br />
You can enable this mode by adding to <code>/etc/inputrc</code> or your <code>~/.inputrc</code>:<br />
"\e[A":history-search-backward<br />
"\e[B":history-search-forward<br />
<br />
==Enabling shellcompletion==<br />
This is a very desirable feature that you will no doubt benefit greatly from.<br />
# pacman -S bash-completion<br />
<br />
and afterwards add to ~/.bashrc<br />
if [ -f /etc/bash_completion ]; then<br />
. /etc/bash_completion<br />
fi<br />
<br />
'''Note:''' You may not need the above ~/.bashrc entries as /etc/profile will load any profiles from /etc/profile.d<br><br />
In there, bash_completion.sh will source /etc/bash_completion anyway.<br />
<br />
==Enabling mouse support in console (gpm)==<br />
* You can enable mouse support in the console by installing <b>gpm</b>:<br />
# pacman -S gpm<br />
* If you see the mouse cursor flickering and it doesn't work properly, you will need to change <code>/etc/conf.d/gpm</code>.<br />
'''For PS/2 mouse replace the existing line with:'''<br />
[ED: This is what works for my Synaptics touchpad, neither syn nor synps2 did.]<br />
GPM_ARGS="-m /dev/psaux -t ps2"<br />
'''For USB mouse replace the existing line with:'''<br />
GPM_ARGS="-m /dev/input/mice -t imps2"<br />
'''For IBM Trackpoint, replace the existing line with:'''<br />
GPM_ARGS="-m /dev/input/mice -t ps2"<br />
<br />
* When it works, you can add <code>gpm</code> into <code>DAEMONS</code> array in <code>/etc/rc.conf</code> to have it started at boot.<br />
* Mouse support in the console is useful for many things, including programs such as Links and Lynx.<br />
<br />
==Start X at boot==<br />
* [[Start X at boot]]<br />
<br />
==Beautifying Fonts for LCD's==<br />
See [[Fonts]]<br />
<br />
==Activating Numlock on Bootup==<br />
* [[Activating Numlock on Bootup]]<br />
<br />
==ABS to build your own packages==<br />
* If you use [[ABS]] to build your own packages, remember to do it outside of the main /var/abs tree. Copy the PKGBUILD and all accompanying files to an empty directory in your homedir and build from there. That way you won't risk your modifications getting overwritten on the next <code>abs</code> run and it's easier to keep track of them.<br />
<br />
==Optimizing your packages==<br />
* For optimizing the packages you build using makepkg (the kernel is a good example), set your GCC preferred settings in <code>/etc/makepkg.conf</code>:<br />
(example for Athlon CPU)<br />
export CFLAGS="-march=athlon -O2 -pipe -fomit-frame-pointer"<br />
export CXXFLAGS="-march=athlon -O2 -pipe -fomit-frame-pointer"<br />
See [[Safe Cflags|Safe CFlags]] for more info.<br />
<br />
==Timesaving Command-aliases==<br />
* You can create your own commands-aliases using <code><homedir>/.bashrc</code> or <code>/etc/profile</code>. Both can be used to define your own aliases:<br />
<pre><br />
alias ll="ls -lh"<br />
alias la="ls -a"<br />
alias exit="clear; exit"<br />
alias x="startx"<br />
<br />
# Lets you search through all available packages simply using 'pacsearch packagename'<br />
alias pacsearch="pacman -Sl | cut -d' ' -f2 | grep "<br />
<br />
# sudo pacman -Syu by typing pacup (sudo must be installed and configured first)<br />
alias pacup="sudo pacman -Syu"<br />
<br />
# sudo pacman -S by typing pac<br />
alias pac="sudo pacman -S"<br />
</pre><br />
<br />
Colorized pacman -Ss search output: <br />
# colorized pacman output with pacs alias:<br />
alias pacs="pacsearch"<br />
pacsearch() {<br />
echo -e "$(pacman -Ss "$@" | sed \<br />
-e 's#^core/.*#\\033[1;31m&\\033[0;37m#g' \<br />
-e 's#^extra/.*#\\033[0;32m&\\033[0;37m#g' \<br />
-e 's#^community/.*#\\033[1;35m&\\033[0;37m#g' \<br />
-e 's#^.*/.* [0-9].*#\\033[0;36m&\\033[0;37m#g' ) \<br />
\033[0m"<br />
}<br />
<br />
You can also download pacman-color from the [http://aur.archlinux.org/packages.php?ID=11827 AUR].<br />
<br />
==Disabling IPv6==<br />
Until the widespread adoption of IPv6, you may benefit from [[IPv6_-_Disabling_the_Module|disabling the IPv6 module]]. <br />
<br />
==Useful Commands & Programs==<br />
*<code>grep</code> - searches for files by its contents (example: <code>grep -i syslog /etc/*</code> will search all files in /etc for those containing the word "syslog"; NOT case-sensitive (using the <code>-i</code> parameter))<br />
*<code>pkill/killall <process_name></code> - kills processes by name (example: <code>killall kdm</code>)<br />
*<code>pidof <process_name></code> - find the pid of the processes by name (example: <code>pidof init</code>)<br />
*<code>ps</code> - display process status (example: <code>ps xau</code> will display all active processes)<br />
*<code>locate</code> - quickly locates files on your hard drive (use <code>updatedb</code> to create a database of them first) (example: <code>locate Xservers</code> will find all files named Xservers)<br />
<br />
====pacman====<br />
There are some nice ways to do a bunch of things easily with bash commands. If we want to install a number of packages sharing similar patterns in their names - not the entire group nor all matching packages - eg. '''kdemod''', we can do:<br />
pacman -S kdemod-{applets,theme,tools}<br />
Of course, that is not limited and can be expanded to however many levels you need:<br />
pacman -S kdemod-{ui-{kde,kdemod},kdeartwork}<br />
Pacman has the '''-q''' option to hide the version column, and we can do something like reinstall packages with "compiz" as part of their name:<br />
pacman -S `pacman -Qq | grep compiz`<br />
The above can be achieved without '''-q''' by issuing an '''awk''' operation:<br />
pacman -S `pacman -Q | awk '/compiz/ { print $1 }'`<br />
Want to reinstall everything? Easy! Wait - not so fast. Listing currently installed packages will output everything including those that have been built with ''makepkg''. Simply running<br />
pacman -S `pacman -Qq`<br />
will output errors because some (or many) of them were not found in the database. We need a way to list only packages that have been installed by pacman. In order to do so, we must combine a command to list all packages, and another to hide the list of foreign packages. This, we achieve by using '''comm -3''' to show only the packages that are not foreign packages.<br />
pacman -S $(comm -3 <(pacman -Qq) <(pacman -Qqm))<br />
<br />
====makepkg====<br />
An automated tool to create packages - it actually automates the <code>./configure && make && make install</code> procedure, (or whatever combination of commands involved in the building of the application) and packs it up into a .pkg.tar.gz to be easily installed with pacman. It uses a script file called a PKGBUILD which must exist in the build directory. View a PKGBUILD file and read the installation document to learn more about how to work with makepkg.<br />
<br />
====ABS====<br />
An automated toolkit that allows you to rebuild any of pacman's packages (so you may provide your own compiler and linker settings, for better optimization, debugging info, etc). Simply executing abs will synchronize all PKGBUILD scripts from the SVN repository into <code>/var/abs</code>.<br />
<br />
==Extracting compressed files==<br />
file.tar : tar xvf file.tar<br />
file.tgz : tar xvzf file.tgz<br />
file.tar.gz : tar xvzf file.tar.gz<br />
file.bz : bzip -cd file.bz | tar xvf -<br />
file.bz2 : tar xvjf file.tar.bz2 <b>OR</b> bzip2 -cd file.bz2 | tar xvf -<br />
file.zip : unzip file.zip<br />
file.rar : unrar x file.rar<br />
The construction of these tar arguments is quite archaic (but nevertheless handy). Have a look at the bsdtar manpage, section COMPATIBILITY for how they work in detail. (bsdtar comes in the libarchive package)<br />
<br />
The following function will decompress a wide range of compressed filetypes. Add the function to '~/.bashrc' and then run with the syntax 'extract MyCompressedFile'<br />
<br />
extract () {<br />
if [ -f $1 ] ; then<br />
case $1 in<br />
*.tar.bz2) tar xvjf $1 ;;<br />
*.tar.gz) tar xvzf $1 ;;<br />
*.bz2) bunzip2 $1 ;;<br />
*.rar) rar x $1 ;;<br />
*.gz) gunzip $1 ;;<br />
*.tar) tar xvf $1 ;;<br />
*.tbz2) tar xvjf $1 ;;<br />
*.tgz) tar xvzf $1 ;;<br />
*.zip) unzip $1 ;;<br />
*.Z) uncompress $1 ;;<br />
*.7z) 7z x $1 ;;<br />
*) echo "don't know how to extract '$1'..." ;;<br />
esac<br />
else<br />
echo "'$1' is not a valid file!"<br />
fi<br />
}<br />
<br />
==Speeding up DNS queries==<br />
* [[Speeding up DNS with dnsmasq]]</div>
Listdata
https://wiki.archlinux.org/index.php?title=Music_Player_Daemon&diff=59290
Music Player Daemon
2009-01-26T10:50:34Z
<p>Listdata: /* Configure mpd */ new crude timeline about how mpd behaves when run as root, and some suggestions on how to start it as root</p>
<hr />
<div>[[Category:Audio/Video (English)]]<br />
[[Category:Daemons and system services (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|mpd}}<br />
{{i18n_entry|Polski|mpd (polski)}}<br />
{{i18n_entry|Nederlands|Music Player Daemon (Nederlands)}}<br />
{{i18n_entry|Русский|MPD - Music Player Daemon (Русский)}}<br />
{{i18n_entry|简体中文|MPD(简体中文)}}<br />
{{i18n_links_end}}<br />
<br />
==What is mpd?==<br />
'''mpd''' (Music Player Daemon) is an audio player that has a server-client architecture. mpd runs in the background as a daemon, manages playlists and a music database, and uses very few resources. In order to interface with it, you need a separate client. More information can be found on their [http://www.musicpd.org/ website]<br />
<br />
==Daemon Install Procedure==<br />
<br />
Sync and install with pacman:<br />
# pacman -S mpd<br />
<br />
==Configure mpd==<br />
<br />
For more information about mpd configuration visit http://mpd.wikia.com/wiki/Configuration<br />
<br />
===Timeline of mpd's behavior on a typical working setup===<br />
* mpd is started on boot by /etc/rc.conf, by including it in the DAEMONS array. (Or, this can be done manually each session by running '''/etc/rc.d/mpd start''' with root privileges).<br />
* Since mpd is now started as root, it first reads the /etc/mpd.conf file.<br />
* mpd reads the user variable in the /etc/mpd.conf file, and changes from root to this user.<br />
* mpd then reads the contents of the /etc/mpd.conf file and configures itself accordingly.<br />
<br />
Notice that mpd changes the running user from root to the one named in the /etc/mpd.conf file. This way, uses of "~" in the configuration file point correctly to the home user's directory, and not root's directory. It may be worthwhile to change all uses of "~" to "/home/username" to avoid any confusion over this aspect of mpd's behavior.<br />
<br />
===Quick Single User Installation===<br />
<br />
* As root, create and edit '''/etc/mpd.conf''' (If it already exists delete it first, this is safe.)<br />
# rm /etc/mpd.conf<br />
# $EDITOR /etc/mpd.conf<br />
<br />
Never put this file in the user's directory like some tutorials suggest. This would complicate things and most of the time doing this is useless (notice you're reading a quick installation howto). If you previously created a .mpdconf file in your home, remove it now. This is important to prevent conflicts. When placing it in /etc, like we do here, mpd will be able to run as a daemon at boot. Otherwise, a script would be needed to run mpd AFTER the user has logged (like kdm or ~/.fluxbox/startup) or it would require a manual move each time. For a single music collection, the method used here is simply better, even while the collection is shared to multiple users. Also, don't be afraid about root privileges: even while mpd runs as a daemon, it never completely runs as root since it automatically drops its root privileges after execution.<br />
<br />
To make audio output actually work ensure that you have setup audio card and mixer correctly. See [[ALSA]]. Do not forget to unmute the required channels in alsamixer, raise the volume and save changes with alsactl store. See ~/.mpd/error if it still doesn't work.<br />
<br />
Make sure your card can do hardware mixing (most of them can, including onboard audio). Or else this could cause problems with multiple sound playback. For example, this can prevent Mplayer from playing back sound while the mpd daemon is running, returning an audio error message stating the device is busy.<br />
<br />
<br />
* In /etc/mpd.conf add the lines <br />
<pre><br />
music_directory "~/Music"<br />
playlist_directory "~/Playlists"<br />
db_file "~/.mpd/db"<br />
log_file "~/.mpd/log"<br />
error_file "~/.mpd/error"<br />
pid_file "~/.mpd/mpd.pid"<br />
state_file "~/.mpd/mpdstate"<br />
user "mpd"<br />
bind_to_address "127.0.0.1"<br />
port "6600"<br />
#connection_timeout "60"<br />
#max_playlist_length "16384"<br />
#filesystem_charset "ISO-8859-1"<br />
#id3v1_encoding "ISO-8859-1"<br />
</pre><br />
<br />
These are the most common lines. You shouldn't need anything else. You may want to change all paths to absolute paths, in order to avoid any ambiguities in the future in case you forget how mpd behaves (see above). See the file /etc/mpd.conf.example for more specific options.<br />
<br />
* Look at the line starting with ''user'' and replace '''mpd''' with your username. Save changes and exit the editor.<br />
* Now exit the root mode and log as the normal user (the same you specified in mpd.conf).<br />
* Create the new directories<br />
$ mkdir ~/Music<br />
$ mkdir ~/Playlists<br />
$ mkdir ~/.mpd<br />
<br />
* Make symbolic links to your music collection:<br />
$ ln -s /media/sda5/music_collection1 ~/Music<br />
$ ln -s /media/sdb7/music_collection2 ~/Music<br />
<br />
* Create the pid file<br />
$ touch ~/.mpd/mpd.pid<br />
<br />
* Create the mpd database (This can take a while depending on the size of your collection.): <br />
$ mpd --create-db<br />
<br />
* Change back to root, and start mpd:<br />
$ /etc/rc.d/mpd start<br />
Although you can start mpd as root with just "mpd", doing the above gives more information (such as on '''htop''').<br />
<br />
* Edit '''/etc/rc.conf''' and add '''mpd''' to the list of daemons to start on bootup.<br />
<br />
* To test it out, install a very small client called mpc<br />
# pacman -S mpc (as root)<br />
$ mpc ls | mpc add (as user)<br />
$ mpc play<br />
<br />
==Troubleshooting==<br />
<br />
'''Note:''' in case of permission problems when using ESD with mpd run this as root:<br />
# chsh -s /bin/true mpd<br />
<br />
===Tips===<br />
<br />
To get rid of timeouts (i.e. when you paused music for long time) in gpmc and other clients uncomment and increase <code>connection_timeout</code> option in mpd.conf.<br />
<br />
If files and/or titles are shown in wrong encoding, uncomment and change <code>filesystem_charset</code> and <code>id3v1_encoding</code> options.<br />
Note that you cannot set encoding for ID3 v2 tags. To workaround this you may use [http://mpd.wikia.com/wiki/GenericDecoder#Generic_Tagreader external tag readers].<br />
<br />
If you want to use another computer to control mpd over a network, the <code>bind_to_address</code> option in mpd.conf will need to be set to either your IP address, or <code>any</code> if your IP address changes frequently. Remember to add mpd to the /etc/hosts.allow file to enable external access.<br />
<br />
==Client Install Procedure==<br />
<br />
Install a client program for mpd. Popular options are:<br />
<br />
* '''mpc''' - Command Line Client (you'll probably want this one no matter what)<br />
* '''ncmpc''' - NCurses Client (this one is very handy for running in a console) [http://hem.bredband.net/kaw/ncmpc/ Official Website of ncmpc]<br />
* '''sonata''' - Python GTK+ Client [http://sonata.berlios.de/ Official Website of Sonata]<br />
* '''gmpc''' - Gnome Client [http://gmpcwiki.sarine.nl/index.php?title=GMPC Official Website of gmpc]<br />
<br />
<br />
Install with:<br />
# pacman -Sy mpc<br />
# pacman -Sy ncmpc<br />
# pacman -Sy sonata<br />
# pacman -Sy gmpc<br />
<br />
==Extra stuff==<br />
<br />
===Last.fm scrobbling===<br />
<br />
To scrobble your songs to [http://www.last.fm Last.fm] using MPD there are several alternatives. The easiest way, if you don't care about having to have a program window open all the time, is using Sonata which is a graphical frontend to MPD. It has built-in support for Last.fm scrobbling in its preferences.<br />
<br />
If you're not too keen on using Sonata (and having it open at all times) there is the very popular mpdscribble which acts as a background process which continuously fetches information about the status of MPD and quietly submits the information to Last.fm. It's fairly easy to configure and also easy to monitor using <code>/var/log/mpdscribble.log</code>.<br />
<br />
=== Never play on start ===<br />
If you don't want mpd to always play on your system start, but yet you want to preserve the other state information, add the following lines to your <code>/etc/rc.d/mpd</code> file:<br />
'' ...''<br />
'' stat_busy "Starting Music Player Daemon"''<br />
<br />
# always start in paused state<br />
awk '/^state_file[ \t]+"[^"]+"$/ {<br />
match($0, "\".+\"")<br />
sfile = substr($0, RSTART + 1, RLENGTH - 2)<br />
} /^user[ \t]+"[^"]+"$/ {<br />
match($0, "\".+\"")<br />
user = substr($0, RSTART + 1, RLENGTH - 2)<br />
} END {<br />
if (sfile == "")<br />
exit;<br />
if (user != "")<br />
sub(/^~/, "/home/" user, sfile)<br />
system("sed -i \x27s|^\\(state:[ \\t]\\{1,\\}\\)play$|\\1pause|\x27 \x27" sfile "\x27")<br />
}' /etc/mpd.conf<br />
<br />
'' /usr/bin/mpd /etc/mpd.conf &> /dev/null''<br />
'' ...''<br />
<br />
This will change the player status to "paused", if it was stopped while playing. Next, you want this file to be preserved, so mpd updates won't erase this edit. Add (or edit) this line to your <code>/etc/pacman.conf</code>:<br />
NoUpgrade = etc/rc.d/mpd<br />
<br />
=== MPD & Alsa ===<br />
<br />
Sometimes, when you use other audio output, e.g: some web pages containing Flash applets, mpd cannot reproduce anything anymore (until you restart). The error looks something like: (if you search the file /var/log/mpd/mpd.error)<br />
<br />
Error opening alsa device "hw:0,0": Device or resource busy<br />
<br />
And here is the solution (dmix saving our life again). Apply these lines in your /etc/mpd.conf:<br />
<br />
<pre><br />
audio_output {<br />
type "alsa"<br />
name "Sound Card"<br />
options "dev=dmixer"<br />
device "plug:dmix"<br />
}<br />
</pre><br />
<br />
And then restart with /etc/rc.d/mpd restart<br />
<br />
Searching on Internet I found the reason for why that happens in Gentoo's wiki:<br />
* The sound card does not support hardware mixing (uses '''dmix''' plugin)<br />
* An application does not work with ALSA with it's default settings<br />
<br />
==External links==<br />
<br />
* [http://www.musicpd.org/ Official Web Site]<br />
* [http://mpd.wikia.com/wiki/Main_Page Official Wiki]<br />
* [http://mpd.wikia.com/wiki/Clients Sorted List of MPD Clients]<br />
* [http://www.musicpd.org/forum/ MPD forum]</div>
Listdata
https://wiki.archlinux.org/index.php?title=Music_Player_Daemon&diff=59289
Music Player Daemon
2009-01-26T09:01:41Z
<p>Listdata: /* Quick Single User Installation */ use symlinks instead of recursively copying huge music collections (as this wastes hard drive space unnecessarily)</p>
<hr />
<div>[[Category:Audio/Video (English)]]<br />
[[Category:Daemons and system services (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|mpd}}<br />
{{i18n_entry|Polski|mpd (polski)}}<br />
{{i18n_entry|Nederlands|Music Player Daemon (Nederlands)}}<br />
{{i18n_entry|Русский|MPD - Music Player Daemon (Русский)}}<br />
{{i18n_entry|简体中文|MPD(简体中文)}}<br />
{{i18n_links_end}}<br />
<br />
==What is mpd?==<br />
'''mpd''' (Music Player Daemon) is an audio player that has a server-client architecture. mpd runs in the background as a daemon, manages playlists and a music database, and uses very few resources. In order to interface with it, you need a separate client. More information can be found on their [http://www.musicpd.org/ website]<br />
<br />
==Daemon Install Procedure==<br />
<br />
Sync and install with pacman:<br />
# pacman -S mpd<br />
<br />
==Configure mpd==<br />
<br />
For more information about mpd configuration visit http://mpd.wikia.com/wiki/Configuration<br />
<br />
===Quick Single User Installation===<br />
<br />
* As root, create and edit '''/etc/mpd.conf''' (If it already exists delete it first, this is safe.)<br />
# rm /etc/mpd.conf<br />
# $EDITOR /etc/mpd.conf<br />
<br />
Never put this file in the user's directory like some tutorials suggest. This would complicate things and most of the time doing this is useless (notice you're reading a quick installation howto). If you previously created a .mpdconf file in your home, remove it now. This is important to prevent conflicts. When placing it in /etc, like we do here, mpd will be able to run as a daemon at boot. Otherwise, a script would be needed to run mpd AFTER the user has logged (like kdm or ~/.fluxbox/startup) or it would require a manual move each time. For a single music collection, the method used here is simply better, even while the collection is shared to multiple users. Also, don't be afraid about root privileges: even while mpd runs as a daemon, it never completely runs as root since it automatically drops its root privileges after execution.<br />
<br />
To make audio output actually work ensure that you have setup audio card and mixer correctly. See [[ALSA]]. Do not forget to unmute the required channels in alsamixer, raise the volume and save changes with alsactl store. See ~/.mpd/error if it still doesn't work.<br />
<br />
Make sure your card can do hardware mixing (most of them can, including onboard audio). Or else this could cause problems with multiple sound playback. For example, this can prevent Mplayer from playing back sound while the mpd daemon is running, returning an audio error message stating the device is busy.<br />
<br />
<br />
* In /etc/mpd.conf add the lines <br />
<pre><br />
music_directory "~/Music"<br />
playlist_directory "~/Playlists"<br />
db_file "~/.mpd/db"<br />
log_file "~/.mpd/log"<br />
error_file "~/.mpd/error"<br />
pid_file "~/.mpd/mpd.pid"<br />
state_file "~/.mpd/mpdstate"<br />
user "mpd"<br />
bind_to_address "127.0.0.1"<br />
port "6600"<br />
#connection_timeout "60"<br />
#max_playlist_length "16384"<br />
#filesystem_charset "ISO-8859-1"<br />
#id3v1_encoding "ISO-8859-1"<br />
</pre><br />
<br />
These are the most common lines. You shouldn't need anything else. See the file /etc/mpd.conf.example for more specific options.<br />
<br />
* Look at the line starting with ''user'' and replace '''mpd''' with your username. Save changes and exit the editor.<br />
* Now exit the root mode and log as the normal user (the same you specified in mpd.conf).<br />
* Create the new directories<br />
$ mkdir ~/Music<br />
$ mkdir ~/Playlists<br />
$ mkdir ~/.mpd<br />
<br />
* Make symbolic links to your music collection:<br />
$ ln -s /media/sda5/music_collection1 ~/Music<br />
$ ln -s /media/sdb7/music_collection2 ~/Music<br />
<br />
* Create the pid file<br />
$ touch ~/.mpd/mpd.pid<br />
<br />
* Create the mpd database (This can take a while depending on the size of your collection.): <br />
$ mpd --create-db<br />
<br />
* Start mpd:<br />
$ mpd<br />
<br />
* Edit '''/etc/rc.conf''' and add '''mpd''' to the list of daemons to start on bootup.<br />
<br />
* To test it out, install a very small client called mpc<br />
# pacman -S mpc (as root)<br />
$ mpc ls | mpc add (as user)<br />
$ mpc play<br />
<br />
==Troubleshooting==<br />
<br />
'''Note:''' in case of permission problems when using ESD with mpd run this as root:<br />
# chsh -s /bin/true mpd<br />
<br />
===Tips===<br />
<br />
To get rid of timeouts (i.e. when you paused music for long time) in gpmc and other clients uncomment and increase <code>connection_timeout</code> option in mpd.conf.<br />
<br />
If files and/or titles are shown in wrong encoding, uncomment and change <code>filesystem_charset</code> and <code>id3v1_encoding</code> options.<br />
Note that you cannot set encoding for ID3 v2 tags. To workaround this you may use [http://mpd.wikia.com/wiki/GenericDecoder#Generic_Tagreader external tag readers].<br />
<br />
If you want to use another computer to control mpd over a network, the <code>bind_to_address</code> option in mpd.conf will need to be set to either your IP address, or <code>any</code> if your IP address changes frequently. Remember to add mpd to the /etc/hosts.allow file to enable external access.<br />
<br />
==Client Install Procedure==<br />
<br />
Install a client program for mpd. Popular options are:<br />
<br />
* '''mpc''' - Command Line Client (you'll probably want this one no matter what)<br />
* '''ncmpc''' - NCurses Client (this one is very handy for running in a console) [http://hem.bredband.net/kaw/ncmpc/ Official Website of ncmpc]<br />
* '''sonata''' - Python GTK+ Client [http://sonata.berlios.de/ Official Website of Sonata]<br />
* '''gmpc''' - Gnome Client [http://gmpcwiki.sarine.nl/index.php?title=GMPC Official Website of gmpc]<br />
<br />
<br />
Install with:<br />
# pacman -Sy mpc<br />
# pacman -Sy ncmpc<br />
# pacman -Sy sonata<br />
# pacman -Sy gmpc<br />
<br />
==Extra stuff==<br />
<br />
===Last.fm scrobbling===<br />
<br />
To scrobble your songs to [http://www.last.fm Last.fm] using MPD there are several alternatives. The easiest way, if you don't care about having to have a program window open all the time, is using Sonata which is a graphical frontend to MPD. It has built-in support for Last.fm scrobbling in its preferences.<br />
<br />
If you're not too keen on using Sonata (and having it open at all times) there is the very popular mpdscribble which acts as a background process which continuously fetches information about the status of MPD and quietly submits the information to Last.fm. It's fairly easy to configure and also easy to monitor using <code>/var/log/mpdscribble.log</code>.<br />
<br />
=== Never play on start ===<br />
If you don't want mpd to always play on your system start, but yet you want to preserve the other state information, add the following lines to your <code>/etc/rc.d/mpd</code> file:<br />
'' ...''<br />
'' stat_busy "Starting Music Player Daemon"''<br />
<br />
# always start in paused state<br />
awk '/^state_file[ \t]+"[^"]+"$/ {<br />
match($0, "\".+\"")<br />
sfile = substr($0, RSTART + 1, RLENGTH - 2)<br />
} /^user[ \t]+"[^"]+"$/ {<br />
match($0, "\".+\"")<br />
user = substr($0, RSTART + 1, RLENGTH - 2)<br />
} END {<br />
if (sfile == "")<br />
exit;<br />
if (user != "")<br />
sub(/^~/, "/home/" user, sfile)<br />
system("sed -i \x27s|^\\(state:[ \\t]\\{1,\\}\\)play$|\\1pause|\x27 \x27" sfile "\x27")<br />
}' /etc/mpd.conf<br />
<br />
'' /usr/bin/mpd /etc/mpd.conf &> /dev/null''<br />
'' ...''<br />
<br />
This will change the player status to "paused", if it was stopped while playing. Next, you want this file to be preserved, so mpd updates won't erase this edit. Add (or edit) this line to your <code>/etc/pacman.conf</code>:<br />
NoUpgrade = etc/rc.d/mpd<br />
<br />
=== MPD & Alsa ===<br />
<br />
Sometimes, when you use other audio output, e.g: some web pages containing Flash applets, mpd cannot reproduce anything anymore (until you restart). The error looks something like: (if you search the file /var/log/mpd/mpd.error)<br />
<br />
Error opening alsa device "hw:0,0": Device or resource busy<br />
<br />
And here is the solution (dmix saving our life again). Apply these lines in your /etc/mpd.conf:<br />
<br />
<pre><br />
audio_output {<br />
type "alsa"<br />
name "Sound Card"<br />
options "dev=dmixer"<br />
device "plug:dmix"<br />
}<br />
</pre><br />
<br />
And then restart with /etc/rc.d/mpd restart<br />
<br />
Searching on Internet I found the reason for why that happens in Gentoo's wiki:<br />
* The sound card does not support hardware mixing (uses '''dmix''' plugin)<br />
* An application does not work with ALSA with it's default settings<br />
<br />
==External links==<br />
<br />
* [http://www.musicpd.org/ Official Web Site]<br />
* [http://mpd.wikia.com/wiki/Main_Page Official Wiki]<br />
* [http://mpd.wikia.com/wiki/Clients Sorted List of MPD Clients]<br />
* [http://www.musicpd.org/forum/ MPD forum]</div>
Listdata
https://wiki.archlinux.org/index.php?title=CUPS&diff=59269
CUPS
2009-01-25T23:35:14Z
<p>Listdata: /* Packages */ another minor grammar edit</p>
<hr />
<div>[[Category:Printers (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|CUPS}}<br />
{{i18n_entry|Рolski|CUPS (Polski)}}<br />
{{i18n_entry|Русский|CUPS (Русский)}}<br />
{{i18n_entry|Türkçe|CUPS (Türkçe)}}<br />
{{i18n_links_end}}<br />
=Introduction=<br />
<br />
==What is CUPS?==<br />
<br />
Straight from the CUPS website: "The Common UNIX Printing System ("CUPS") is a cross-platform printing solution for all UNIX environments. It is based on the "Internet Printing Protocol" and provides complete printing services to most Postscript and raster printers. CUPS is provided under the GNU GPL..." Although there are other printing packages such as LPRNG, CUPS is quite popular and relatively easy to use. It is the default printing system on Arch Linux as well as many other Linux distributions.<br />
<br />
==Troubleshooting CUPS & components==<br />
<br />
The best way to get printing working is to set 'LogLevel' in '/etc/cups/cupsd.conf' to:<br />
<pre><br />
LogLevel debug<br />
</pre><br />
And then viewing the output from '/var/log/cups/error_log' like this:<br />
<pre><br />
# tail -n 100 -f /var/log/cups/error_log<br />
</pre><br />
The characters at the left of the output stands for:<br />
<pre><br />
D = Debug<br />
E = Error<br />
I = Information<br />
etc...<br />
</pre><br />
These files may also prove useful.<br />
<pre><br />
/var/log/cups/page_log 'spits out a new entry each time a print is successful.'<br />
/var/log/cups/access_log 'lists all cupsd http1.1 server activity'<br />
</pre><br />
<br />
Of course it's important to know how CUPS work if you want to solve your problems, this is somewhat correct:<br />
<br />
# An application sends a .ps file (PostScript, a script language that details how the page will look) to CUPS when you select 'print' (99% of apps do).<br />
# CUPS then looks at your printers PPD file (printer description file) and figures out what filters it needs to use to convert the .ps file to a language that the printer understands (like PJL,PCL). Usually it needs ghostscript.<br />
# GhostScript takes the input and figures out which filters it should use, then applies them and converts the .ps file to a format understood by the printer.<br />
# Then it is sent to the backend. For example, if you have your printer connected to a USB port, it uses the USB backend.<br />
<br />
Print a document and watch 'error_log' to get a more detailed and correct image of the printing process.<br />
<br />
=Installing CUPS=<br />
<br />
==Packages==<br />
<br />
You will need CUPS and Ghostscript for sure:<br />
# pacman -S cups ghostscript gsfonts<br />
<br />
* <b>cups</b> - The actual CUPS software<br />
* <b>dbus-core</b> - The dbus library is needed for cups<br />
* <b>ghostscript</b> - An interpreter for the Postscript language<br />
* <b>gsfonts</b> - Ghostscript standard Type1 fonts<br />
<br />
<br />
Here are some of the following driver packages; choosing the right driver depends on the printer you own. If unsure, install gutenprint.<br />
<br />
* <b>gutenprint</b> - A collection of high quality drivers for Canon, Epson, Lexmark, Sony, Olympus, and PCL printers for use with Ghostscript, CUPS, Foomatic, and the Gimp.<br />
* <b>foomatic-db</b>, <b>foomatic-db-engine</b>, <b>foomatic-db-ppd</b> and <b>foomatic-filters</b> - Foomatic is a database-driven system for integrating free software printer drivers with common spoolers under Unix<br />
* Installing <b>foomatic-filters</b> should solve your problems if the cups error_log is reporting "stopped with status 22!"<br />
* <b>hplip</b> - HP Linux inkjet driver. Provides support for DeskJet, OfficeJet, Photosmart, Business Inkjet and some LaserJet printer models.<br />
* <b>ufr2</b> - Canon UFR2 driver with support for LBP, iR and MF series printers. Package is available in AUR.<br />
* <b>cups-pdf</b> - A nice package that allows one to setup a virtual PDF Printer that generates a PDF out of anything sent to it.<br />
<br />
<br />
If your system is connected to a networked printer using the samba protocol or if the system is to be a print server for Windows clients:<br />
# pacman -S samba<br />
<br />
==Download Printer PPD==<br />
<br />
Depending on your printer, this step is optional and may not be needed, as the standard CUPS installation already comes with quite a few PPD (Postscript Printer Description) files. Moreover, the <i>foomatic-filters</i>, <i>gimp-print</i> and <i>hplip</i> packages already include quite a few PPD files which will automatically be detected by CUPS.<br />
<br />
<br />
Here's an explanation of what a PPD file is from the Linux Printing website: "For every PostScript printer the manufacturers provide a PPD file which contains all printer-specific information about the particular printer model: Basic printer capabilities as whether the printer is a color printer, fonts, PostScript level, etc., and especially the user-adjustable options, as paper size, resolution, etc."<br />
<br />
<br />
*To get the PPD file for your printer, go to http://www.linuxprinting.org/printer_list.cgi and select the manufacturer and model of your printer.<br />
<br />
<br />
*Now, you will need to copy the file to the cups folder so it can detect the file. If you are in the folder where you downloaded the PPD file, you can use the following command:<br />
<br />
<pre><br />
# cp your_printer.ppd /usr/share/cups/model/<br />
</pre><br />
<br />
<br />
If you cannot find your printer on the website, you may want to try similar models or using generic printer drivers. Just do some googling or ask your manufacturer (good luck with that).<br />
<br />
=Configuring Cups=<br />
<br />
==Options==<br />
<br />
Now that you have cups installed, you have a variety of options on how to setup CUPS. You can always use the tried and true command line. Likewise, various desktop environments such as GNOME and KDE have useful programs that can help you manage your printers. However, in order to make this process easy for the largest amount of users, we will use the web interface provided by CUPS.<br />
<br />
Please note that if you are planning on connecting to a network printer, rather than one that is directly connected to your computer, you may wish to jump to the Printer Sharing section first. Linux to Linux printer sharing is quite easy and involves very little configuration. Windows to Linux and vice-versa requires a little bit more effort, but is relatively easy as well.<br />
<br />
==Kernel Modules==<br />
<br />
Before we can use the CUPS web interface, we must install the appropriate kernel modules. The following are steps that I got from the Gentoo Printing Guide. <br />
===USB printers===<br />
If you want to use a USB printer with a 2.6.x kernel, use the following command:<br />
<br />
<pre><br />
# modprobe usblp<br />
</pre><br />
<br />
If you are using a USB printer and a 2.4.x kernel, use the following command:<br />
<br />
<pre><br />
# modprobe printer<br />
</pre><br />
<br />
Note, this assumes that you are using the stock kernels from Arch Linux. If you custom-rolled your own, you may need to run this first:<br />
<br />
<pre><br />
# modprobe usbcore<br />
</pre><br />
<br />
Once you have the modules installed, you should plug in your printer and check if the kernel detected it by running the following:<br />
<br />
<pre><br />
# tail /var/log/messages.log<br />
</pre><br />
<br />
or<br />
<br />
<pre><br />
# dmesg<br />
</pre><br />
<br />
<br />
You should see something like this:<br />
<br />
<pre><br />
Feb 19 20:17:11 kernel: printer.c: usblp0: USB Bidirectional<br />
printer dev 2 if 0 alt 0 proto 2 vid 0x04E8 pid 0x300E<br />
Feb 19 20:17:11 kernel: usb.c: usblp driver claimed interface cfef3920<br />
Feb 19 20:17:11 kernel: printer.c: v0.13: USB Printer Device Class driver<br />
</pre><br />
<br />
===Parallel port printers===<br />
If you plan on using a parallel port printer, the configuration is pretty much the same. Kernel 2.6.x users have to first type in:<br />
<br />
<pre><br />
# modprobe lp<br />
</pre><br />
<br />
And then both 2.4.x and 2.6.x kernel users can enter in:<br />
<br />
<pre><br />
# modprobe parport<br />
# modprobe parport_pc<br />
</pre><br />
<br />
Once again, you can check your setup by running:<br />
# tail /var/log/messages.log<br />
You should see something like this:<br />
<br />
<pre><br />
lp0: using parport0 (polling).<br />
</pre><br />
<br />
<br />
Note: Installing my Brother HL 1250 I found that permissions for the device won't let CUPS write on the device, so it doesn't print. To fix it:<br />
<br />
<pre><br />
[root@mihal ~]# ls /dev/usb/<br />
lp0<br />
[root@mihal ~]# chgrp lp /dev/usb/lp0<br />
<br />
</pre><br />
<br />
===Auto-loading===<br />
You may also want to have the system automatically load the kernel module every time the computer starts up. To do this use your favorite text editor to open up <code>/etc/rc.conf</code> and add the appropriate module to the <i>MODULES=()</i> line. Here's a portion of the text from my <code>rc.conf</code> file:<br />
<br />
<pre><br />
MODULES=(!usbserial scsi_mod sd_mod snd-ymfpci snd-pcm-oss lp parport parport_pc ide-scsi)<br />
</pre><br />
<br />
==CUPS Daemon==<br />
<br />
With the kernel modules installed, you are now ready to start the actual CUPS daemon. To do this, simply run this command as root:<br />
<br />
<pre><br />
# /etc/rc.d/cups start<br />
</pre><br />
<br />
If you want to have cups start up automatically every time you start your computer, then you need to add it to your DAEMONS=() line in the <code>/etc/rc.conf</code> file. For example:<br />
<br />
<pre><br />
DAEMONS=(pcmcia syslogd klogd !fam esd mono network autofs cups crond gdm)<br />
</pre><br />
<br />
==Web Interface and tool kit.==<br />
<br />
Once the daemon is running, if a web interface is available. Open up your browser and go to:<br />
<br />
<i>http://localhost:631</i><br />
<br />
(You may need to replace ''localhost'' with your hostname found in <code>/etc/hosts</code>)<br />
<br />
'''or''' install "GNOME CUPS Manager" GUI frontend (see Appendix: A.1 [http://wiki.archlinux.org/index.php/CUPS_Setup#Alternative_CUPS_Interfaces Alternative CUPS Interfaces])<br />
<br />
From here, all you have to do is follow the various wizards to add your printer. To setup my Samsung ML-1250 printer, I started out by clicking on <i>Manage Printers</i>, and then <i>Add Printer</i>. I was then prompted for a username and password. I just logged in as root. I entered in ml1250 for my printer name, My Room for location and then Peter's Samsung ML-1250 Laster Printer for description. Next you will select the device. Since my printer is a USB device, I just selected <i>USB Printer #1</i>. The name of my printer also showed up next to the label <i>USB Printer #1</i>, so look for that. Next, I simply chose the appropriate drivers and the installation was complete.<br />
<br />
Once the installation is complete, you can test your configuration by pressing the Print Test Page button.<br />
<br />
===Remote Access to Web Interface===<br />
By default the CUPS web interface can only be accessed by the ''localhost''; i.e. the computer that it is installed on. To remotely access the interface make the following changes to the /etc/cups/cupsd.conf file. Replace the line<br />
Listen localhost:631<br />
with<br />
port 631<br />
so that CUPS will listen to incoming requests. There are three levels of access that can be granted:<br />
<Location /> #access to the server<br />
<Location /admin> #access to the admin pages<br />
<Location /admin/conf> #access to configuration files<br />
To give remote hosts access to one of these levels add an '''Allow''' statement to that level’s section. An '''Allow''' statement can take one or more of the forms listed below:<br />
Allow all<br />
Allow host.domain.com<br />
Allow *.domain.com<br />
Allow ip-address<br />
Allow ip-address/netmask<br />
Deny statements can also be used. For example if I wanted to give all hosts on the 192.168.1.0/255.255.255.0 subnet full access, my /etc/cups/cupsd.conf file would include this:<br />
<br />
# Restrict access to the server...<br />
# By default only localhost connections are possible<br />
<Location /><br />
Order allow,deny<br />
Allow From localhost<br />
'''Allow From 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
# Restrict access to the admin pages...<br />
<Location /admin><br />
# Encryption disabled by default<br />
#Encryption Required<br />
Order allow,deny<br />
Allow From localhost<br />
'''Allow From 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
# Restrict access to configuration files...<br />
<Location /admin/conf><br />
AuthType Basic<br />
Require user @SYSTEM<br />
Order allow,deny<br />
Allow From localhost<br />
'''Allow From 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
=Printer Sharing=<br />
<br />
==Linux to Linux==<br />
<br />
Once you have CUPS setup on your Linux print server, sharing the printer with another Linux box is relatively easy. There are several ways to configure such a scenario -- here we will describe the manual setup. On the server computer (the one managing and connecting to the printer) simply open up <code>/etc/cups/cupsd.conf</code> and allow access to the server by modifying the location lines. For instance:<br />
<br />
<pre><br />
<Location /><br />
Order Deny,Allow<br />
Deny From All<br />
Allow From 127.0.0.1<br />
Allow From 10.0.0.*<br />
</Location><br />
</pre><br />
<br />
You will also need to make sure the server is listening on the IP address your client will be addressing. Add the following line after "Listen localhost:631":<br />
<br />
<pre><br />
Listen 10.0.0.1:631<br />
</pre><br />
<br />
using your server's IP address instead of 10.0.0.1.<br />
<br />
Add the IP address of the client computer by doing Allow From client_ip_address. After you make your modifications, you will want to restart CUPS by doing:<br />
<br />
<pre><br />
# /etc/rc.d/cups restart<br />
</pre><br />
<br />
On the client side, open up <code>/etc/cups/client.conf</code> and edit the ServerName option to match the IP address or the name of your server. For instance, I named my server beast and have an entry in my hosts file to point to it. So in my <code>client.conf</code> file, I just edited this line:<br />
<br />
<pre><br />
ServerName beast<br />
</pre><br />
<br />
Next, run the following command to update the client computer:<br />
<br />
<pre><br />
# lpq<br />
</pre><br />
<br />
You should see something like this:<br />
<br />
<pre><br />
ml1250 is ready<br />
no entries<br />
</pre><br />
<br />
There are more configuration possibilities including an automatic configuration which are described in detail on http://localhost:631/sam.html#CLIENT_SETUP (this link works on your printer server).<br />
<br />
When prompted for username and password, use root to access.<br />
Then follow the instructions from here<br />
http://www.digitalhermit.com/linux/printing/<br />
if it's a TCP/IP printer, use JetDirect.<br />
<br />
That's it for Linux to Linux printer sharing.<br />
<br />
==Linux to Windows==<br />
<br />
If you are connected to a Windows print server (or any other Samba capable print server), you can skip the section about kernel modules and such. All you have to do is start the CUPS daemon and complete the web interface as specified in section 3.3 and 3.4. Before this, you need to activate the Samba CUPS backend. You can do this by entering the following command:<br />
<br />
<pre><br />
# ln -s `which smbspool` /usr/lib/cups/backend/smb<br />
</pre><br />
<br />
Note that the symbol before is ` (underneath the ~ on a standard US keyboard) and not '. After this, you will have to restart CUPS using the command specified in the previous section. Next, simply log in on the CUPS web interface and choose to add a new printer. For device, there should be an option that says something to the effect of "Windows Printer Via Samba" near the button of the device list. For the device location, enter:<br />
<br />
<pre><br />
smb://username:password@hostname/printer_name<br />
</pre><br />
<br />
Or without a password:<br />
<br />
<pre><br />
smb://username@hostname/printer_name<br />
</pre><br />
<br />
Make sure that the user actually has access to the printer on the Windows computer. Select the appropriate drivers and that's about it. If the computer is located on a domain, make sure the username includes the domain: <br />
<pre><br />
smb://username:password@domain/hostname/printer_name<br />
</pre><br />
<br />
Note: If your network contains many printers, use "lpoptions -d your_desired_default_printer_name" to set your preferred printer<br />
<br />
Note: I, thepizzaking, was having 'NT_STATUS_ACCESS_DENIED' errors and to fix them I needed to use a slightly different syntax:<br />
<pre><br />
smb://workgroup/username:password@hostname/printer_name<br />
</pre><br />
<br />
==Windows to Linux==<br />
<br />
Sometimes you might want to allow a Windows computer to connect to your Linux server. There are a few ways to do this, and the one I am most familiar with is using Samba. In order to do this, you will have to edit your <code>/etc/samba/smb.conf</code> file to allow access to your printers. Your <code>smb.conf</code> can look something like this:<br />
<br />
<pre><br />
[global]<br />
workgroup = Heroes<br />
server string = Arch Linux Print Server<br />
security = user<br />
<br />
[printers]<br />
comment = All Printers<br />
path = /var/spool/samba<br />
browseable = yes<br />
# to allow user 'guest account' to print.<br />
guest ok = no<br />
writable = no<br />
printable = yes<br />
create mode = 0700<br />
write list = @adm root neocephas<br />
</pre><br />
<br />
That should be enough to share your printer, but you just might want to add an individual printer entry:<br />
<br />
<pre><br />
[ML1250]<br />
comment = Samsung ML-1250 Laser Printer<br />
printer=ml1250<br />
path = /var/spool/samba<br />
printing = cups<br />
printable = yes<br />
printer admin = @admin root neocephas<br />
user client driver = yes<br />
# to allow user 'guest account' to print.<br />
guest ok = no<br />
writable = no<br />
write list = @adm root neocephas<br />
valid users = @adm root neocephas<br />
</pre><br />
<br />
Please note that in my configuration I made it so that users must have a valid account to access the printer. To have a public printer, set ''guest ok'' to ''yes'', and remove the ''valid users'' line. To add accounts, you must set up a regular Linux account and then set up a Samba password on the server. For instance:<br />
<br />
<pre><br />
# useradd neocephas<br />
# smbpasswd -a neocephas<br />
</pre><br />
<br />
After setting up any user accounts that you need, you will also need to set up the samba spool directory:<br />
<br />
<pre><br />
# mkdir /var/spool/samba<br />
# chmod 777 /var/spool/samba<br />
</pre><br />
<br />
The next items that need changing are <code>/etc/cups/mime.convs</code> and <code>/etc/cups/mime.types</code>:<br />
<br />
<code>mime.convs</code>:<br />
<pre><br />
# The following line is found at near the end of the file. Uncomment it.<br />
application/octet-stream application/vnd.cups-raw 0 -<br />
</pre><br />
<br />
<code>mime.types</code>:<br />
<pre><br />
# Again near the end of the file.<br />
application/octet-stream<br />
</pre><br />
<br />
The changes to <code>mime.convs</code> and <code>mime.types</code> are needed to make CUPS print Microsoft Office document files. Many people seem to need that.<br />
<br />
After this, restart your Samba daemon:<br />
<br />
<pre><br />
# /etc/rc.d/samba restart<br />
</pre><br />
<br />
Obviously there are a lot of tweaks and customizations that can be done with setting up a Samba print server, so I advise you to look at the Samba and CUPS documentation for more help. The <code>smb.conf.example</code> file also has some good samples to that you might want to look at.<br />
<br />
==Windows 2000 and Windows XP to Linux==<br />
<br />
For the most modern flavors of Windows, an alternative way of connecting to your Linux printer server is to use the CUPS protocol directly. The Windows client will need to be using Windows 2000 or Windows XP. Make sure you allow the clients to access the print server by editing the location settings as specified in section 4.1.<br />
<br />
On the Windows computer, go to the printer control panel and choose to Add a New Printer. Next, choose to give a URL. For the URL, type in the location of your printer:<br />
<br />
<i>http://host_ip_address:631/printers/printer_name</i><br />
<br />
where host_ip_address is the Linux server's IP address and printer_name is the name of the printer you are connecting to. After this, install the printer drivers for the Windows computer. If you setup the CUPS server to use its own printer drivers, then you can just select a generic postscript printer for the Windows client. You can then test your print setup by printing a test page.<br />
<br />
==Others to Linux, Linux to others==<br />
<br />
More information on interfacing CUPS with other printing systems can be found in the CUPS manual, e.g. on http://localhost:631/sam.html#PRINTING_OTHER<br />
<br />
=Appendix=<br />
<br />
==Alternative CUPS Interfaces==<br />
<br />
If you are a GNOME user, you can manage and configure your printer by using the gnome-cups-manager.<br />
<br />
Update: this package is now available through pacman if you have the "community" repository uncommented in <code>/etc/pacman.conf</code><br />
<br />
<pre><br />
# pacman -S gnome-cups-manager<br />
</pre><br />
<br />
The package is also still available from the [http://aur.archlinux.org/packages.php?do_Details=1&ID=66&O=0&L=0&C=0&K=cups&SB=&SO=&PP=25&do_MyPackages=0&do_Orphans=0&SeB=nd AUR].<br />
<br />
KDE users can modify their printers from the Control Center. Both should refer to those desktop environments' documentation for more information on how to use the interfaces.<br />
<br />
There is also gtklp. It is in the "extra" repository.<br />
<br />
<pre><br />
# pacman -S gtklp<br />
</pre><br />
<br />
You may also install system-config-printer from the "community" repository;<br />
<br />
<pre><br />
# pacman -S system-config-printer<br />
</pre><br />
For system-config-printer to work as it should you may run as root or with sudo/gksudo, or alternatively set up a "normal" user to administer cups (if so '''follow steps 1-3''')<br />
<br />
* 1. Create group, and add a user<br />
<pre><br />
# groupadd lpadmin<br />
# usermod -aG lpadmin <username><br />
</pre><br />
<br />
* 2. Add "lpadmin" (without the quotes) to this line in /etc/cups/cupsd.conf<br />
<pre><br />
SystemGroup sys root <insert here><br />
</pre><br />
<br />
* 3. Restart cups, log out and in again (or restart your computer)<br />
<pre><br />
# /etc/rc.d/cups restart<br />
</pre><br />
<br />
==PDF Virtual Printer==<br />
<br />
A nice is CUPS-PDF. This package allows one to setup a virtual printer that will generate a PDF from anything sent to it. For example, I wrote this document in AbiWord and then printed it to the Virtual Printer which generated a PDF in my <code>/var/spool/cups-pdf/neocephas</code> directory. Obviously this package is not necessary, but it can be quite useful.<br />
This package can be installed by the following command:<br />
<pre><br />
# pacman -S cups-pdf<br />
</pre><br />
After installing the package, you can set it up as you would for any other printer in the web interface. For the Device, select '''CUPS-PDF (Virtual PDF Printer)'''; Make/Manufacturer, choose '''Generic'''; Model/Driver, select '''Generic postscript color printer'''. Alternatively, provide the PPD file from this link: [http://www.physik.uni-wuerzburg.de/~vrbehr/cups-pdf/cups-pdf-CURRENT/extra/CUPS-PDF.ppd].<br />
<br />
==Online Resources==<br />
<br />
Here is a listing of web sites that may be of use to you:<br />
<br />
* <b>Official CUPS documentation on your computer</b> http://localhost:631/documentation.html<br />
* <b>Official CUPS Website</b> - http://www.cups.org/<br />
* <b>Linux Printing</b> - http://www.linuxprinting.org/<br />
* <b>Tips and Suggestions on common CUPS problems</b> - http://home.nyc.rr.com/computertaijutsu/cups.html<br />
* <b>Gentoo's Printing Guide</b> - http://www.gentoo.org/doc/en/printing-howto.xml<br />
* <b>Arch Linux User Forums</b> - http://bbs.archlinux.org/<br />
<br />
==Specialized Cases==<br />
<br />
This section is dedicated to specific problems and their solutions. If you managed to get some unusual printer working, please put the solution here.<br />
<br />
===Getting FX C1110 (not model B) to work ===<br />
<br />
'''Assumes:''' <br />
<br />
# The printer is connected and listening on the network.<br />
# The printer driver is in rpm package.<br />
<br />
* Install cpio and rpmunpack to later unpack rpm package<br />
<br />
pacman -S cpio rpmunpack cups ghostscript gsfonts<br />
<br />
* Get the FX Linux Driver [http://www.fujixeroxprinters.com/downloads/uploaded/Drivers/DocuPrint%20C1110%20C1110B/linux/fxlinuxprint-1.0.1-1.i386.zip here]<br />
<br />
* In /var/tmp unzip fxlinuxprint-1.0.1-1.i386.zip<br />
<br />
unzip fxlinuxprint-1.0.1-1.i386.zip -d /var/tmp<br />
<br />
* In /var/tmp<br />
<br />
cd /var/tmp<br />
rpmunpack fxlinuxprint-1.0.1-1.i386.rpm<br />
gunzip fxlinuxprint-1.0.1-1.cpio.gz<br />
mkdir /var/tmp/DST<br />
mv fxlinuxprint-1.0.1-1.cpio /var/tmp/DST<br />
cd /var/tmp/DST<br />
cpio -id < fxlinuxprint-1.0.1-1.cpio<br />
rm fxlinuxprint-1.0.1-1.cpio<br />
cd /var/tmp<br />
find /var/tmp/DST -type f |cat -n<br />
1 /var/tmp/DST/etc/cups/mimefx.convs<br />
2 /var/tmp/DST/etc/cups/mimefx.types<br />
3 /var/tmp/DST/usr/lib/cups/filter/pdftopjlfx<br />
4 /var/tmp/DST/usr/lib/cups/filter/pstopdffx<br />
5 /var/tmp/DST/usr/lib/cups/filter/pdftopdffx<br />
6 /var/tmp/DST/usr/share/cups/model/FujiXerox/en/fxlinuxprint.ppd<br />
<br />
* Copy /var/tmp/DST files to /<br />
<br />
'''Note:''' for the PPD use /usr/share/cups/model/fxlinuxprint.ppd<br />
<br />
* Point web browser at http://localhost:631/ and point and click to add printer<br />
<br />
'''Note:''' in the final step authenticate using the root password<br />
<br />
* Manage Printer and Set Printer Options<br />
<br />
* Print a test page, and if printer name is color103, use at a shell prompt<br />
<br />
lpq -Pcolor103<br />
color103 is ready<br />
no entries<br />
<br />
* The End<br />
<br />
===Printing does not work/aborts with the HP Deskjet 700 Series Printers.===<br />
<br />
*The solution is to install <b>pnm2ppa</b> printer filter for the HP Deskjet 700 series. Without this the print jobs will be aborted by the system. A [[ABS - The Arch Build System | PKGBUILD]] for pnm2ppa can be found in [http://aur.archlinux.org/packages.php?do_Details=1&ID=696&O=0&L=0&C=0&K=pnm&SB=n&SO=a&PP=25&do_MyPackages=0&do_Orphans=0 AUR].<br />
<br />
===Getting HP LaserJet 1010 to work===<br />
I had to compile ghostscript myself because ESP gs in rep was 7.07 and had not fixed some bugs like ESP 8.15.1 had. I never downloaded 'foomatic' in rep. I think that is an old package. <br />
<pre><br />
$ pacman -Qs cups a2ps psutils foo ghost<br />
local/cups 1.1.23-3<br />
The CUPS Printing System<br />
local/a2ps 4.13b-3<br />
a2ps is an Any to PostScript filter<br />
local/psutils p17-3<br />
A set of postscript utilities.<br />
local/foomatic-db 3.0.2-1<br />
Foomatic is a system for using free software printer drivers with common<br />
spoolers on Unix<br />
local/foomatic-db-engine 3.0.2-1<br />
Foomatic is a system for using free software printer drivers with common<br />
spoolers on Unix<br />
local/foomatic-db-ppd 3.0.2-1<br />
Foomatic is a system for using free software printer drivers with common<br />
spoolers on Unix<br />
local/foomatic-filters 3.0.2-1<br />
Foomatic is a system for using free software printer drivers with common<br />
spoolers on Unix<br />
local/espgs 8.15.1-1<br />
ESP Ghostscript<br />
</pre><br />
I also had to set LogLevel in <code>/etc/cups/cupsd.conf</code> to debug2 before i saw that I missed some "Nimbus" fonts. Then I had to rename and put them where the log told me to. Some fancy google searching had to be applied, e.g., http://www.google.com/search?q=n019003l+filetype%3Apfb since the fonts turned out to be proprietary (I'm sure Windows comes with these by default). Nevertheless, after downloading them (about 7 fonts) and putting them in the correct directory, printing started working.<br />
<br />
Before, I was getting all the errors said here: http://linuxprinting.org/show_printer.cgi?recnum=HP-LaserJet_1010 'Unsupport PCL' etc...<br />
<br />
I'm sure it could have worked with ESP gs 7.07 too (in rep) if I were smart enough to turn on DebugLevel2 sooner :/ UPDATE: yeah it did... maybe this info is useful for someone else though... sorry for the inconvenience.<br />
<br />
===Getting HP LaserJet 1020 to work===<br />
<br />
====Manual installation====<br />
After a lot of tries with hplib and gutenprint, I finally found the solution to get my printer HP LaserJet 1020 printing. <br />
<br />
First of all, you only need to install cups and ghostscript. Then follow the link on http://www.linuxprinting.org/show_printer.cgi?recnum=HP-LaserJet_1020 to the http://foo2zjs.rkkda.com/ printer driver page and follow the install instructions. Log in as root. After you've downloaded the package and extracted the archive, change into the foo2zjs directory. Now you can follow the original installation instructions with a minor modification to change the userid for printing:<br />
<br />
$ make<br />
$ ./getweb 1020<br />
<br />
Open the ''Makefile''<br />
$ nano Makefile<br />
and search for the line<br />
# LPuid=-olp<br />
and modify it to<br />
# LPuid=-oroot<br />
then continue with the script<br />
$ make install<br />
$ make install-hotplug<br />
$ make cups<br />
<br />
====Installation from AUR====<br />
You can also use the package foo2zjs from AUR and modify the PKGBUILD. Change the line:<br />
<br />
./getweb all<br />
<br />
to<br />
<br />
./getweb 1020<br />
<br />
(or if you're setting another printer, change this line to what you need).<br />
<br />
If you get errors with incorrect md5sums, you should also change the md5sum of foo2zjs.tar.gz in PKGBUILD to match the downloaded driver.<br />
<br />
As a last step, add and configure the printer in the CUPS manager. The printer should be recognized automatically. It works fine for root and all users. When booting the operating system, the printer is initialized and indicates it's working.<br />
<br />
=== Printer connected to an Airport Express Station ===<br />
The first thing to do is to scan the airport express station. It<br />
seems that there are different addresses depending on the model.<br />
<pre><br />
[root@somostation somos]# nmap 192.168.0.4<br />
<br />
Starting Nmap 4.20 ( http://insecure.org ) at 2007-06-26 00:50 CEST<br />
Interesting ports on 192.168.0.4:<br />
Not shown: 1694 closed ports<br />
PORT STATE SERVICE<br />
5000/tcp open UPnP<br />
9100/tcp open jetdirect<br />
10000/tcp open snet-sensor-mgmt<br />
MAC Address: 00:14:51:70:D5:66 (Apple Computer)<br />
<br />
Nmap finished: 1 IP address (1 host up) scanned in 25.815 seconds<br />
</pre><br />
With my station, the port is 9100. The airport station is accessed like<br />
an HP JetDirect printer.<br />
Afterwards, you can edit your <code>printer.conf</code> file in this way:<br />
<pre><br />
# Printer configuration file for CUPS v1.2.11<br />
# Written by cupsd on 2007-06-26 00:44<br />
<Printer LaserSim><br />
Info SAMSUNG ML-1510 gdi<br />
Location SomoStation<br />
DeviceURI socket://192.168.0.4:9100<br />
State Idle<br />
StateTime 1182811465<br />
Accepting Yes<br />
Shared Yes<br />
JobSheets none none<br />
QuotaPeriod 0<br />
PageLimit 0<br />
KLimit 0<br />
OpPolicy default<br />
ErrorPolicy stop-printer<br />
</Printer><br />
</pre><br />
It should work. I had a few problems. They were resolved by removing foomatic and installing foomatic-db, foomatic-db-engine, foomatic-db-ppd instead.<br />
<br />
===Performing Utility Functions on Epson Printers===<br />
<br />
====Escputil====<br />
<br />
Here we explain how to perform some of the utility functions such as nozzle cleaning and nozzle checks on Epson printers. We will use the escputil utility, which is part of the gutenprint package.<br />
<br />
There is a man page ("man escputil") that provides pretty good information, but it does not include necessary information on how to identify your printer. There are two parameters that can be used. One is --printer; what it expects is the name you used to identify your printer when you configured it. The other is --raw-device. What this option expects is is something beginning with "/dev". If your printer is a serial printer, and the only serial printer, it is "/dev/lp0". If it is a USB printer, it is "/dev/usb/lp0". If you have more than one printer, they will have names ending in "lp1", "lp2", etc. <br />
<br />
* To clean the printer heads:<br />
<br />
escputil -u --clean-head<br />
<br />
* To print the nozzle-check pattern, allowing you to verify that the previous head cleaning worked. (Or to determine that you need to clean the heads)<br />
<br />
escputil -u --nozzle-check<br />
<br />
If you want to perform an operation that requires two-way communication with a printer, you must use the "--raw-device" specification and your user must be root or be a member of the group "lp". <br />
<br />
* The following is an example of getting the printer's internal identification:<br />
<br />
sudo escputil --raw-device=/dev/usb/lp0 --identify<br />
<br />
* To print out the ink levels of the printer:<br />
<br />
sudo escputil --raw-device=/dev/usb/lp0 --ink-level<br />
<br />
====Mtink====<br />
<br />
This is a printer status monitor which enables to get the remaining ink quantity, to print test patterns, to reset printer and to clean nozzle. It use an intuitive graphical user interface. Package can be downloaded from [http://aur.archlinux.org/packages.php?do_Details=1&ID=476&O=0&L=0&C=0&K=mtink&SB=n&SO=a&PP=25&do_MyPackages=0&do_Orphans=0&SeB=nd AUR].<br />
<br />
==Another Source for Printer Drivers==<br />
<br />
On <i>http://www.turboprint.de/english.html</i> is a really good printer driver for many printers not yet supported by Linux (especially Canon i*). The only problem is that high-quality-prints are either marked with a turboprint-logo or you have to pay for it -- it's not open source.<br />
<br />
{{Wikipedia|Common_Unix_Printing_System}}<br />
<br />
=Troubleshooting=<br />
==As a result of upgrade==<br />
<br />
===Error with gnutls===<br />
After updating, if you get something like :<br />
/usr/sbin/cupsd: error while loading shared libraries: libgnutls.so.13: cannot open shared object file: No such file or directory<br />
<br />
You need to update gnutls:<br />
<pre><br />
# pacman -Sy gnutls<br />
</pre><br />
<br />
In addition, in <code>/etc/cups</code>, there will be a file named <code>cupsd.conf.pacnew</code>. Rename it <code>cupsd.conf</code>.<br />
<br />
===All jobs are "stopped"===<br />
After updating CUPS, if all jobs sent to the printer become "stopped", delete the printer and add it again.<br />
Using the CUPS web interface (http://localhost:631), go to Printers > Delete Printer.<br />
<br />
''Note:'' If you don't remember your printer's settings, go to Printers > Modify Printer. Copy down the information displayed, click 'Modify Printer' to proceed to the next page(s), etc.<br />
<br />
===The PPD version (XXXXXX) is not compatible with Gutenprint X===<br />
Run (as root)<br />
<pre><br />
/usr/sbin/cups-genppdupdate<br />
</pre><br />
And restart CUPS (as pointed out in gutenprint's post-install message)<br />
<br />
==Other==<br />
<br />
===A HPLIP printer sends "/usr/lib/cups/backend/hp failed" error===<br />
Make sure dbus is installed and running, e.g. check DAEMONS in /etc/rc.conf or run 'ls /var/run/daemons'.</div>
Listdata
https://wiki.archlinux.org/index.php?title=CUPS&diff=59268
CUPS
2009-01-25T23:34:24Z
<p>Listdata: /* Packages */ grammatical error</p>
<hr />
<div>[[Category:Printers (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|CUPS}}<br />
{{i18n_entry|Рolski|CUPS (Polski)}}<br />
{{i18n_entry|Русский|CUPS (Русский)}}<br />
{{i18n_entry|Türkçe|CUPS (Türkçe)}}<br />
{{i18n_links_end}}<br />
=Introduction=<br />
<br />
==What is CUPS?==<br />
<br />
Straight from the CUPS website: "The Common UNIX Printing System ("CUPS") is a cross-platform printing solution for all UNIX environments. It is based on the "Internet Printing Protocol" and provides complete printing services to most Postscript and raster printers. CUPS is provided under the GNU GPL..." Although there are other printing packages such as LPRNG, CUPS is quite popular and relatively easy to use. It is the default printing system on Arch Linux as well as many other Linux distributions.<br />
<br />
==Troubleshooting CUPS & components==<br />
<br />
The best way to get printing working is to set 'LogLevel' in '/etc/cups/cupsd.conf' to:<br />
<pre><br />
LogLevel debug<br />
</pre><br />
And then viewing the output from '/var/log/cups/error_log' like this:<br />
<pre><br />
# tail -n 100 -f /var/log/cups/error_log<br />
</pre><br />
The characters at the left of the output stands for:<br />
<pre><br />
D = Debug<br />
E = Error<br />
I = Information<br />
etc...<br />
</pre><br />
These files may also prove useful.<br />
<pre><br />
/var/log/cups/page_log 'spits out a new entry each time a print is successful.'<br />
/var/log/cups/access_log 'lists all cupsd http1.1 server activity'<br />
</pre><br />
<br />
Of course it's important to know how CUPS work if you want to solve your problems, this is somewhat correct:<br />
<br />
# An application sends a .ps file (PostScript, a script language that details how the page will look) to CUPS when you select 'print' (99% of apps do).<br />
# CUPS then looks at your printers PPD file (printer description file) and figures out what filters it needs to use to convert the .ps file to a language that the printer understands (like PJL,PCL). Usually it needs ghostscript.<br />
# GhostScript takes the input and figures out which filters it should use, then applies them and converts the .ps file to a format understood by the printer.<br />
# Then it is sent to the backend. For example, if you have your printer connected to a USB port, it uses the USB backend.<br />
<br />
Print a document and watch 'error_log' to get a more detailed and correct image of the printing process.<br />
<br />
=Installing CUPS=<br />
<br />
==Packages==<br />
<br />
You will need CUPS and Ghostscript for sure:<br />
# pacman -S cups ghostscript gsfonts<br />
<br />
* <b>cups</b> - The actual CUPS software<br />
* <b>dbus-core</b> - The dbus library is needed for cups<br />
* <b>ghostscript</b> - An interpreter for the Postscript language<br />
* <b>gsfonts</b> - Ghostscript standard Type1 fonts<br />
<br />
<br />
Here are some of the following driver packages, it depends on the printer you own. If unsure, install gutenprint.<br />
<br />
* <b>gutenprint</b> - A collection of high quality drivers for Canon, Epson, Lexmark, Sony, Olympus, and PCL printers for use with Ghostscript, CUPS, Foomatic, and the Gimp.<br />
* <b>foomatic-db</b>, <b>foomatic-db-engine</b>, <b>foomatic-db-ppd</b> and <b>foomatic-filters</b> - Foomatic is a database-driven system for integrating free software printer drivers with common spoolers under Unix<br />
* Installing <b>foomatic-filters</b> should solve your problems if the cups error_log is reporting "stopped with status 22!"<br />
* <b>hplip</b> - HP Linux inkjet driver. Provides support for DeskJet, OfficeJet, Photosmart, Business Inkjet and some LaserJet printer models.<br />
* <b>ufr2</b> - Canon UFR2 driver with support for LBP, iR and MF series printers. Package is available in AUR.<br />
* <b>cups-pdf</b> - A nice package that allows one to setup a virtual PDF Printer that generates a PDF out of anything sent to it.<br />
<br />
<br />
If your system is connected to a networked printer using the samba protocol or if the system is to be a print server for Windows clients:<br />
# pacman -S samba<br />
<br />
==Download Printer PPD==<br />
<br />
Depending on your printer, this step is optional and may not be needed, as the standard CUPS installation already comes with quite a few PPD (Postscript Printer Description) files. Moreover, the <i>foomatic-filters</i>, <i>gimp-print</i> and <i>hplip</i> packages already include quite a few PPD files which will automatically be detected by CUPS.<br />
<br />
<br />
Here's an explanation of what a PPD file is from the Linux Printing website: "For every PostScript printer the manufacturers provide a PPD file which contains all printer-specific information about the particular printer model: Basic printer capabilities as whether the printer is a color printer, fonts, PostScript level, etc., and especially the user-adjustable options, as paper size, resolution, etc."<br />
<br />
<br />
*To get the PPD file for your printer, go to http://www.linuxprinting.org/printer_list.cgi and select the manufacturer and model of your printer.<br />
<br />
<br />
*Now, you will need to copy the file to the cups folder so it can detect the file. If you are in the folder where you downloaded the PPD file, you can use the following command:<br />
<br />
<pre><br />
# cp your_printer.ppd /usr/share/cups/model/<br />
</pre><br />
<br />
<br />
If you cannot find your printer on the website, you may want to try similar models or using generic printer drivers. Just do some googling or ask your manufacturer (good luck with that).<br />
<br />
=Configuring Cups=<br />
<br />
==Options==<br />
<br />
Now that you have cups installed, you have a variety of options on how to setup CUPS. You can always use the tried and true command line. Likewise, various desktop environments such as GNOME and KDE have useful programs that can help you manage your printers. However, in order to make this process easy for the largest amount of users, we will use the web interface provided by CUPS.<br />
<br />
Please note that if you are planning on connecting to a network printer, rather than one that is directly connected to your computer, you may wish to jump to the Printer Sharing section first. Linux to Linux printer sharing is quite easy and involves very little configuration. Windows to Linux and vice-versa requires a little bit more effort, but is relatively easy as well.<br />
<br />
==Kernel Modules==<br />
<br />
Before we can use the CUPS web interface, we must install the appropriate kernel modules. The following are steps that I got from the Gentoo Printing Guide. <br />
===USB printers===<br />
If you want to use a USB printer with a 2.6.x kernel, use the following command:<br />
<br />
<pre><br />
# modprobe usblp<br />
</pre><br />
<br />
If you are using a USB printer and a 2.4.x kernel, use the following command:<br />
<br />
<pre><br />
# modprobe printer<br />
</pre><br />
<br />
Note, this assumes that you are using the stock kernels from Arch Linux. If you custom-rolled your own, you may need to run this first:<br />
<br />
<pre><br />
# modprobe usbcore<br />
</pre><br />
<br />
Once you have the modules installed, you should plug in your printer and check if the kernel detected it by running the following:<br />
<br />
<pre><br />
# tail /var/log/messages.log<br />
</pre><br />
<br />
or<br />
<br />
<pre><br />
# dmesg<br />
</pre><br />
<br />
<br />
You should see something like this:<br />
<br />
<pre><br />
Feb 19 20:17:11 kernel: printer.c: usblp0: USB Bidirectional<br />
printer dev 2 if 0 alt 0 proto 2 vid 0x04E8 pid 0x300E<br />
Feb 19 20:17:11 kernel: usb.c: usblp driver claimed interface cfef3920<br />
Feb 19 20:17:11 kernel: printer.c: v0.13: USB Printer Device Class driver<br />
</pre><br />
<br />
===Parallel port printers===<br />
If you plan on using a parallel port printer, the configuration is pretty much the same. Kernel 2.6.x users have to first type in:<br />
<br />
<pre><br />
# modprobe lp<br />
</pre><br />
<br />
And then both 2.4.x and 2.6.x kernel users can enter in:<br />
<br />
<pre><br />
# modprobe parport<br />
# modprobe parport_pc<br />
</pre><br />
<br />
Once again, you can check your setup by running:<br />
# tail /var/log/messages.log<br />
You should see something like this:<br />
<br />
<pre><br />
lp0: using parport0 (polling).<br />
</pre><br />
<br />
<br />
Note: Installing my Brother HL 1250 I found that permissions for the device won't let CUPS write on the device, so it doesn't print. To fix it:<br />
<br />
<pre><br />
[root@mihal ~]# ls /dev/usb/<br />
lp0<br />
[root@mihal ~]# chgrp lp /dev/usb/lp0<br />
<br />
</pre><br />
<br />
===Auto-loading===<br />
You may also want to have the system automatically load the kernel module every time the computer starts up. To do this use your favorite text editor to open up <code>/etc/rc.conf</code> and add the appropriate module to the <i>MODULES=()</i> line. Here's a portion of the text from my <code>rc.conf</code> file:<br />
<br />
<pre><br />
MODULES=(!usbserial scsi_mod sd_mod snd-ymfpci snd-pcm-oss lp parport parport_pc ide-scsi)<br />
</pre><br />
<br />
==CUPS Daemon==<br />
<br />
With the kernel modules installed, you are now ready to start the actual CUPS daemon. To do this, simply run this command as root:<br />
<br />
<pre><br />
# /etc/rc.d/cups start<br />
</pre><br />
<br />
If you want to have cups start up automatically every time you start your computer, then you need to add it to your DAEMONS=() line in the <code>/etc/rc.conf</code> file. For example:<br />
<br />
<pre><br />
DAEMONS=(pcmcia syslogd klogd !fam esd mono network autofs cups crond gdm)<br />
</pre><br />
<br />
==Web Interface and tool kit.==<br />
<br />
Once the daemon is running, if a web interface is available. Open up your browser and go to:<br />
<br />
<i>http://localhost:631</i><br />
<br />
(You may need to replace ''localhost'' with your hostname found in <code>/etc/hosts</code>)<br />
<br />
'''or''' install "GNOME CUPS Manager" GUI frontend (see Appendix: A.1 [http://wiki.archlinux.org/index.php/CUPS_Setup#Alternative_CUPS_Interfaces Alternative CUPS Interfaces])<br />
<br />
From here, all you have to do is follow the various wizards to add your printer. To setup my Samsung ML-1250 printer, I started out by clicking on <i>Manage Printers</i>, and then <i>Add Printer</i>. I was then prompted for a username and password. I just logged in as root. I entered in ml1250 for my printer name, My Room for location and then Peter's Samsung ML-1250 Laster Printer for description. Next you will select the device. Since my printer is a USB device, I just selected <i>USB Printer #1</i>. The name of my printer also showed up next to the label <i>USB Printer #1</i>, so look for that. Next, I simply chose the appropriate drivers and the installation was complete.<br />
<br />
Once the installation is complete, you can test your configuration by pressing the Print Test Page button.<br />
<br />
===Remote Access to Web Interface===<br />
By default the CUPS web interface can only be accessed by the ''localhost''; i.e. the computer that it is installed on. To remotely access the interface make the following changes to the /etc/cups/cupsd.conf file. Replace the line<br />
Listen localhost:631<br />
with<br />
port 631<br />
so that CUPS will listen to incoming requests. There are three levels of access that can be granted:<br />
<Location /> #access to the server<br />
<Location /admin> #access to the admin pages<br />
<Location /admin/conf> #access to configuration files<br />
To give remote hosts access to one of these levels add an '''Allow''' statement to that level’s section. An '''Allow''' statement can take one or more of the forms listed below:<br />
Allow all<br />
Allow host.domain.com<br />
Allow *.domain.com<br />
Allow ip-address<br />
Allow ip-address/netmask<br />
Deny statements can also be used. For example if I wanted to give all hosts on the 192.168.1.0/255.255.255.0 subnet full access, my /etc/cups/cupsd.conf file would include this:<br />
<br />
# Restrict access to the server...<br />
# By default only localhost connections are possible<br />
<Location /><br />
Order allow,deny<br />
Allow From localhost<br />
'''Allow From 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
# Restrict access to the admin pages...<br />
<Location /admin><br />
# Encryption disabled by default<br />
#Encryption Required<br />
Order allow,deny<br />
Allow From localhost<br />
'''Allow From 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
# Restrict access to configuration files...<br />
<Location /admin/conf><br />
AuthType Basic<br />
Require user @SYSTEM<br />
Order allow,deny<br />
Allow From localhost<br />
'''Allow From 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
=Printer Sharing=<br />
<br />
==Linux to Linux==<br />
<br />
Once you have CUPS setup on your Linux print server, sharing the printer with another Linux box is relatively easy. There are several ways to configure such a scenario -- here we will describe the manual setup. On the server computer (the one managing and connecting to the printer) simply open up <code>/etc/cups/cupsd.conf</code> and allow access to the server by modifying the location lines. For instance:<br />
<br />
<pre><br />
<Location /><br />
Order Deny,Allow<br />
Deny From All<br />
Allow From 127.0.0.1<br />
Allow From 10.0.0.*<br />
</Location><br />
</pre><br />
<br />
You will also need to make sure the server is listening on the IP address your client will be addressing. Add the following line after "Listen localhost:631":<br />
<br />
<pre><br />
Listen 10.0.0.1:631<br />
</pre><br />
<br />
using your server's IP address instead of 10.0.0.1.<br />
<br />
Add the IP address of the client computer by doing Allow From client_ip_address. After you make your modifications, you will want to restart CUPS by doing:<br />
<br />
<pre><br />
# /etc/rc.d/cups restart<br />
</pre><br />
<br />
On the client side, open up <code>/etc/cups/client.conf</code> and edit the ServerName option to match the IP address or the name of your server. For instance, I named my server beast and have an entry in my hosts file to point to it. So in my <code>client.conf</code> file, I just edited this line:<br />
<br />
<pre><br />
ServerName beast<br />
</pre><br />
<br />
Next, run the following command to update the client computer:<br />
<br />
<pre><br />
# lpq<br />
</pre><br />
<br />
You should see something like this:<br />
<br />
<pre><br />
ml1250 is ready<br />
no entries<br />
</pre><br />
<br />
There are more configuration possibilities including an automatic configuration which are described in detail on http://localhost:631/sam.html#CLIENT_SETUP (this link works on your printer server).<br />
<br />
When prompted for username and password, use root to access.<br />
Then follow the instructions from here<br />
http://www.digitalhermit.com/linux/printing/<br />
if it's a TCP/IP printer, use JetDirect.<br />
<br />
That's it for Linux to Linux printer sharing.<br />
<br />
==Linux to Windows==<br />
<br />
If you are connected to a Windows print server (or any other Samba capable print server), you can skip the section about kernel modules and such. All you have to do is start the CUPS daemon and complete the web interface as specified in section 3.3 and 3.4. Before this, you need to activate the Samba CUPS backend. You can do this by entering the following command:<br />
<br />
<pre><br />
# ln -s `which smbspool` /usr/lib/cups/backend/smb<br />
</pre><br />
<br />
Note that the symbol before is ` (underneath the ~ on a standard US keyboard) and not '. After this, you will have to restart CUPS using the command specified in the previous section. Next, simply log in on the CUPS web interface and choose to add a new printer. For device, there should be an option that says something to the effect of "Windows Printer Via Samba" near the button of the device list. For the device location, enter:<br />
<br />
<pre><br />
smb://username:password@hostname/printer_name<br />
</pre><br />
<br />
Or without a password:<br />
<br />
<pre><br />
smb://username@hostname/printer_name<br />
</pre><br />
<br />
Make sure that the user actually has access to the printer on the Windows computer. Select the appropriate drivers and that's about it. If the computer is located on a domain, make sure the username includes the domain: <br />
<pre><br />
smb://username:password@domain/hostname/printer_name<br />
</pre><br />
<br />
Note: If your network contains many printers, use "lpoptions -d your_desired_default_printer_name" to set your preferred printer<br />
<br />
Note: I, thepizzaking, was having 'NT_STATUS_ACCESS_DENIED' errors and to fix them I needed to use a slightly different syntax:<br />
<pre><br />
smb://workgroup/username:password@hostname/printer_name<br />
</pre><br />
<br />
==Windows to Linux==<br />
<br />
Sometimes you might want to allow a Windows computer to connect to your Linux server. There are a few ways to do this, and the one I am most familiar with is using Samba. In order to do this, you will have to edit your <code>/etc/samba/smb.conf</code> file to allow access to your printers. Your <code>smb.conf</code> can look something like this:<br />
<br />
<pre><br />
[global]<br />
workgroup = Heroes<br />
server string = Arch Linux Print Server<br />
security = user<br />
<br />
[printers]<br />
comment = All Printers<br />
path = /var/spool/samba<br />
browseable = yes<br />
# to allow user 'guest account' to print.<br />
guest ok = no<br />
writable = no<br />
printable = yes<br />
create mode = 0700<br />
write list = @adm root neocephas<br />
</pre><br />
<br />
That should be enough to share your printer, but you just might want to add an individual printer entry:<br />
<br />
<pre><br />
[ML1250]<br />
comment = Samsung ML-1250 Laser Printer<br />
printer=ml1250<br />
path = /var/spool/samba<br />
printing = cups<br />
printable = yes<br />
printer admin = @admin root neocephas<br />
user client driver = yes<br />
# to allow user 'guest account' to print.<br />
guest ok = no<br />
writable = no<br />
write list = @adm root neocephas<br />
valid users = @adm root neocephas<br />
</pre><br />
<br />
Please note that in my configuration I made it so that users must have a valid account to access the printer. To have a public printer, set ''guest ok'' to ''yes'', and remove the ''valid users'' line. To add accounts, you must set up a regular Linux account and then set up a Samba password on the server. For instance:<br />
<br />
<pre><br />
# useradd neocephas<br />
# smbpasswd -a neocephas<br />
</pre><br />
<br />
After setting up any user accounts that you need, you will also need to set up the samba spool directory:<br />
<br />
<pre><br />
# mkdir /var/spool/samba<br />
# chmod 777 /var/spool/samba<br />
</pre><br />
<br />
The next items that need changing are <code>/etc/cups/mime.convs</code> and <code>/etc/cups/mime.types</code>:<br />
<br />
<code>mime.convs</code>:<br />
<pre><br />
# The following line is found at near the end of the file. Uncomment it.<br />
application/octet-stream application/vnd.cups-raw 0 -<br />
</pre><br />
<br />
<code>mime.types</code>:<br />
<pre><br />
# Again near the end of the file.<br />
application/octet-stream<br />
</pre><br />
<br />
The changes to <code>mime.convs</code> and <code>mime.types</code> are needed to make CUPS print Microsoft Office document files. Many people seem to need that.<br />
<br />
After this, restart your Samba daemon:<br />
<br />
<pre><br />
# /etc/rc.d/samba restart<br />
</pre><br />
<br />
Obviously there are a lot of tweaks and customizations that can be done with setting up a Samba print server, so I advise you to look at the Samba and CUPS documentation for more help. The <code>smb.conf.example</code> file also has some good samples to that you might want to look at.<br />
<br />
==Windows 2000 and Windows XP to Linux==<br />
<br />
For the most modern flavors of Windows, an alternative way of connecting to your Linux printer server is to use the CUPS protocol directly. The Windows client will need to be using Windows 2000 or Windows XP. Make sure you allow the clients to access the print server by editing the location settings as specified in section 4.1.<br />
<br />
On the Windows computer, go to the printer control panel and choose to Add a New Printer. Next, choose to give a URL. For the URL, type in the location of your printer:<br />
<br />
<i>http://host_ip_address:631/printers/printer_name</i><br />
<br />
where host_ip_address is the Linux server's IP address and printer_name is the name of the printer you are connecting to. After this, install the printer drivers for the Windows computer. If you setup the CUPS server to use its own printer drivers, then you can just select a generic postscript printer for the Windows client. You can then test your print setup by printing a test page.<br />
<br />
==Others to Linux, Linux to others==<br />
<br />
More information on interfacing CUPS with other printing systems can be found in the CUPS manual, e.g. on http://localhost:631/sam.html#PRINTING_OTHER<br />
<br />
=Appendix=<br />
<br />
==Alternative CUPS Interfaces==<br />
<br />
If you are a GNOME user, you can manage and configure your printer by using the gnome-cups-manager.<br />
<br />
Update: this package is now available through pacman if you have the "community" repository uncommented in <code>/etc/pacman.conf</code><br />
<br />
<pre><br />
# pacman -S gnome-cups-manager<br />
</pre><br />
<br />
The package is also still available from the [http://aur.archlinux.org/packages.php?do_Details=1&ID=66&O=0&L=0&C=0&K=cups&SB=&SO=&PP=25&do_MyPackages=0&do_Orphans=0&SeB=nd AUR].<br />
<br />
KDE users can modify their printers from the Control Center. Both should refer to those desktop environments' documentation for more information on how to use the interfaces.<br />
<br />
There is also gtklp. It is in the "extra" repository.<br />
<br />
<pre><br />
# pacman -S gtklp<br />
</pre><br />
<br />
You may also install system-config-printer from the "community" repository;<br />
<br />
<pre><br />
# pacman -S system-config-printer<br />
</pre><br />
For system-config-printer to work as it should you may run as root or with sudo/gksudo, or alternatively set up a "normal" user to administer cups (if so '''follow steps 1-3''')<br />
<br />
* 1. Create group, and add a user<br />
<pre><br />
# groupadd lpadmin<br />
# usermod -aG lpadmin <username><br />
</pre><br />
<br />
* 2. Add "lpadmin" (without the quotes) to this line in /etc/cups/cupsd.conf<br />
<pre><br />
SystemGroup sys root <insert here><br />
</pre><br />
<br />
* 3. Restart cups, log out and in again (or restart your computer)<br />
<pre><br />
# /etc/rc.d/cups restart<br />
</pre><br />
<br />
==PDF Virtual Printer==<br />
<br />
A nice is CUPS-PDF. This package allows one to setup a virtual printer that will generate a PDF from anything sent to it. For example, I wrote this document in AbiWord and then printed it to the Virtual Printer which generated a PDF in my <code>/var/spool/cups-pdf/neocephas</code> directory. Obviously this package is not necessary, but it can be quite useful.<br />
This package can be installed by the following command:<br />
<pre><br />
# pacman -S cups-pdf<br />
</pre><br />
After installing the package, you can set it up as you would for any other printer in the web interface. For the Device, select '''CUPS-PDF (Virtual PDF Printer)'''; Make/Manufacturer, choose '''Generic'''; Model/Driver, select '''Generic postscript color printer'''. Alternatively, provide the PPD file from this link: [http://www.physik.uni-wuerzburg.de/~vrbehr/cups-pdf/cups-pdf-CURRENT/extra/CUPS-PDF.ppd].<br />
<br />
==Online Resources==<br />
<br />
Here is a listing of web sites that may be of use to you:<br />
<br />
* <b>Official CUPS documentation on your computer</b> http://localhost:631/documentation.html<br />
* <b>Official CUPS Website</b> - http://www.cups.org/<br />
* <b>Linux Printing</b> - http://www.linuxprinting.org/<br />
* <b>Tips and Suggestions on common CUPS problems</b> - http://home.nyc.rr.com/computertaijutsu/cups.html<br />
* <b>Gentoo's Printing Guide</b> - http://www.gentoo.org/doc/en/printing-howto.xml<br />
* <b>Arch Linux User Forums</b> - http://bbs.archlinux.org/<br />
<br />
==Specialized Cases==<br />
<br />
This section is dedicated to specific problems and their solutions. If you managed to get some unusual printer working, please put the solution here.<br />
<br />
===Getting FX C1110 (not model B) to work ===<br />
<br />
'''Assumes:''' <br />
<br />
# The printer is connected and listening on the network.<br />
# The printer driver is in rpm package.<br />
<br />
* Install cpio and rpmunpack to later unpack rpm package<br />
<br />
pacman -S cpio rpmunpack cups ghostscript gsfonts<br />
<br />
* Get the FX Linux Driver [http://www.fujixeroxprinters.com/downloads/uploaded/Drivers/DocuPrint%20C1110%20C1110B/linux/fxlinuxprint-1.0.1-1.i386.zip here]<br />
<br />
* In /var/tmp unzip fxlinuxprint-1.0.1-1.i386.zip<br />
<br />
unzip fxlinuxprint-1.0.1-1.i386.zip -d /var/tmp<br />
<br />
* In /var/tmp<br />
<br />
cd /var/tmp<br />
rpmunpack fxlinuxprint-1.0.1-1.i386.rpm<br />
gunzip fxlinuxprint-1.0.1-1.cpio.gz<br />
mkdir /var/tmp/DST<br />
mv fxlinuxprint-1.0.1-1.cpio /var/tmp/DST<br />
cd /var/tmp/DST<br />
cpio -id < fxlinuxprint-1.0.1-1.cpio<br />
rm fxlinuxprint-1.0.1-1.cpio<br />
cd /var/tmp<br />
find /var/tmp/DST -type f |cat -n<br />
1 /var/tmp/DST/etc/cups/mimefx.convs<br />
2 /var/tmp/DST/etc/cups/mimefx.types<br />
3 /var/tmp/DST/usr/lib/cups/filter/pdftopjlfx<br />
4 /var/tmp/DST/usr/lib/cups/filter/pstopdffx<br />
5 /var/tmp/DST/usr/lib/cups/filter/pdftopdffx<br />
6 /var/tmp/DST/usr/share/cups/model/FujiXerox/en/fxlinuxprint.ppd<br />
<br />
* Copy /var/tmp/DST files to /<br />
<br />
'''Note:''' for the PPD use /usr/share/cups/model/fxlinuxprint.ppd<br />
<br />
* Point web browser at http://localhost:631/ and point and click to add printer<br />
<br />
'''Note:''' in the final step authenticate using the root password<br />
<br />
* Manage Printer and Set Printer Options<br />
<br />
* Print a test page, and if printer name is color103, use at a shell prompt<br />
<br />
lpq -Pcolor103<br />
color103 is ready<br />
no entries<br />
<br />
* The End<br />
<br />
===Printing does not work/aborts with the HP Deskjet 700 Series Printers.===<br />
<br />
*The solution is to install <b>pnm2ppa</b> printer filter for the HP Deskjet 700 series. Without this the print jobs will be aborted by the system. A [[ABS - The Arch Build System | PKGBUILD]] for pnm2ppa can be found in [http://aur.archlinux.org/packages.php?do_Details=1&ID=696&O=0&L=0&C=0&K=pnm&SB=n&SO=a&PP=25&do_MyPackages=0&do_Orphans=0 AUR].<br />
<br />
===Getting HP LaserJet 1010 to work===<br />
I had to compile ghostscript myself because ESP gs in rep was 7.07 and had not fixed some bugs like ESP 8.15.1 had. I never downloaded 'foomatic' in rep. I think that is an old package. <br />
<pre><br />
$ pacman -Qs cups a2ps psutils foo ghost<br />
local/cups 1.1.23-3<br />
The CUPS Printing System<br />
local/a2ps 4.13b-3<br />
a2ps is an Any to PostScript filter<br />
local/psutils p17-3<br />
A set of postscript utilities.<br />
local/foomatic-db 3.0.2-1<br />
Foomatic is a system for using free software printer drivers with common<br />
spoolers on Unix<br />
local/foomatic-db-engine 3.0.2-1<br />
Foomatic is a system for using free software printer drivers with common<br />
spoolers on Unix<br />
local/foomatic-db-ppd 3.0.2-1<br />
Foomatic is a system for using free software printer drivers with common<br />
spoolers on Unix<br />
local/foomatic-filters 3.0.2-1<br />
Foomatic is a system for using free software printer drivers with common<br />
spoolers on Unix<br />
local/espgs 8.15.1-1<br />
ESP Ghostscript<br />
</pre><br />
I also had to set LogLevel in <code>/etc/cups/cupsd.conf</code> to debug2 before i saw that I missed some "Nimbus" fonts. Then I had to rename and put them where the log told me to. Some fancy google searching had to be applied, e.g., http://www.google.com/search?q=n019003l+filetype%3Apfb since the fonts turned out to be proprietary (I'm sure Windows comes with these by default). Nevertheless, after downloading them (about 7 fonts) and putting them in the correct directory, printing started working.<br />
<br />
Before, I was getting all the errors said here: http://linuxprinting.org/show_printer.cgi?recnum=HP-LaserJet_1010 'Unsupport PCL' etc...<br />
<br />
I'm sure it could have worked with ESP gs 7.07 too (in rep) if I were smart enough to turn on DebugLevel2 sooner :/ UPDATE: yeah it did... maybe this info is useful for someone else though... sorry for the inconvenience.<br />
<br />
===Getting HP LaserJet 1020 to work===<br />
<br />
====Manual installation====<br />
After a lot of tries with hplib and gutenprint, I finally found the solution to get my printer HP LaserJet 1020 printing. <br />
<br />
First of all, you only need to install cups and ghostscript. Then follow the link on http://www.linuxprinting.org/show_printer.cgi?recnum=HP-LaserJet_1020 to the http://foo2zjs.rkkda.com/ printer driver page and follow the install instructions. Log in as root. After you've downloaded the package and extracted the archive, change into the foo2zjs directory. Now you can follow the original installation instructions with a minor modification to change the userid for printing:<br />
<br />
$ make<br />
$ ./getweb 1020<br />
<br />
Open the ''Makefile''<br />
$ nano Makefile<br />
and search for the line<br />
# LPuid=-olp<br />
and modify it to<br />
# LPuid=-oroot<br />
then continue with the script<br />
$ make install<br />
$ make install-hotplug<br />
$ make cups<br />
<br />
====Installation from AUR====<br />
You can also use the package foo2zjs from AUR and modify the PKGBUILD. Change the line:<br />
<br />
./getweb all<br />
<br />
to<br />
<br />
./getweb 1020<br />
<br />
(or if you're setting another printer, change this line to what you need).<br />
<br />
If you get errors with incorrect md5sums, you should also change the md5sum of foo2zjs.tar.gz in PKGBUILD to match the downloaded driver.<br />
<br />
As a last step, add and configure the printer in the CUPS manager. The printer should be recognized automatically. It works fine for root and all users. When booting the operating system, the printer is initialized and indicates it's working.<br />
<br />
=== Printer connected to an Airport Express Station ===<br />
The first thing to do is to scan the airport express station. It<br />
seems that there are different addresses depending on the model.<br />
<pre><br />
[root@somostation somos]# nmap 192.168.0.4<br />
<br />
Starting Nmap 4.20 ( http://insecure.org ) at 2007-06-26 00:50 CEST<br />
Interesting ports on 192.168.0.4:<br />
Not shown: 1694 closed ports<br />
PORT STATE SERVICE<br />
5000/tcp open UPnP<br />
9100/tcp open jetdirect<br />
10000/tcp open snet-sensor-mgmt<br />
MAC Address: 00:14:51:70:D5:66 (Apple Computer)<br />
<br />
Nmap finished: 1 IP address (1 host up) scanned in 25.815 seconds<br />
</pre><br />
With my station, the port is 9100. The airport station is accessed like<br />
an HP JetDirect printer.<br />
Afterwards, you can edit your <code>printer.conf</code> file in this way:<br />
<pre><br />
# Printer configuration file for CUPS v1.2.11<br />
# Written by cupsd on 2007-06-26 00:44<br />
<Printer LaserSim><br />
Info SAMSUNG ML-1510 gdi<br />
Location SomoStation<br />
DeviceURI socket://192.168.0.4:9100<br />
State Idle<br />
StateTime 1182811465<br />
Accepting Yes<br />
Shared Yes<br />
JobSheets none none<br />
QuotaPeriod 0<br />
PageLimit 0<br />
KLimit 0<br />
OpPolicy default<br />
ErrorPolicy stop-printer<br />
</Printer><br />
</pre><br />
It should work. I had a few problems. They were resolved by removing foomatic and installing foomatic-db, foomatic-db-engine, foomatic-db-ppd instead.<br />
<br />
===Performing Utility Functions on Epson Printers===<br />
<br />
====Escputil====<br />
<br />
Here we explain how to perform some of the utility functions such as nozzle cleaning and nozzle checks on Epson printers. We will use the escputil utility, which is part of the gutenprint package.<br />
<br />
There is a man page ("man escputil") that provides pretty good information, but it does not include necessary information on how to identify your printer. There are two parameters that can be used. One is --printer; what it expects is the name you used to identify your printer when you configured it. The other is --raw-device. What this option expects is is something beginning with "/dev". If your printer is a serial printer, and the only serial printer, it is "/dev/lp0". If it is a USB printer, it is "/dev/usb/lp0". If you have more than one printer, they will have names ending in "lp1", "lp2", etc. <br />
<br />
* To clean the printer heads:<br />
<br />
escputil -u --clean-head<br />
<br />
* To print the nozzle-check pattern, allowing you to verify that the previous head cleaning worked. (Or to determine that you need to clean the heads)<br />
<br />
escputil -u --nozzle-check<br />
<br />
If you want to perform an operation that requires two-way communication with a printer, you must use the "--raw-device" specification and your user must be root or be a member of the group "lp". <br />
<br />
* The following is an example of getting the printer's internal identification:<br />
<br />
sudo escputil --raw-device=/dev/usb/lp0 --identify<br />
<br />
* To print out the ink levels of the printer:<br />
<br />
sudo escputil --raw-device=/dev/usb/lp0 --ink-level<br />
<br />
====Mtink====<br />
<br />
This is a printer status monitor which enables to get the remaining ink quantity, to print test patterns, to reset printer and to clean nozzle. It use an intuitive graphical user interface. Package can be downloaded from [http://aur.archlinux.org/packages.php?do_Details=1&ID=476&O=0&L=0&C=0&K=mtink&SB=n&SO=a&PP=25&do_MyPackages=0&do_Orphans=0&SeB=nd AUR].<br />
<br />
==Another Source for Printer Drivers==<br />
<br />
On <i>http://www.turboprint.de/english.html</i> is a really good printer driver for many printers not yet supported by Linux (especially Canon i*). The only problem is that high-quality-prints are either marked with a turboprint-logo or you have to pay for it -- it's not open source.<br />
<br />
{{Wikipedia|Common_Unix_Printing_System}}<br />
<br />
=Troubleshooting=<br />
==As a result of upgrade==<br />
<br />
===Error with gnutls===<br />
After updating, if you get something like :<br />
/usr/sbin/cupsd: error while loading shared libraries: libgnutls.so.13: cannot open shared object file: No such file or directory<br />
<br />
You need to update gnutls:<br />
<pre><br />
# pacman -Sy gnutls<br />
</pre><br />
<br />
In addition, in <code>/etc/cups</code>, there will be a file named <code>cupsd.conf.pacnew</code>. Rename it <code>cupsd.conf</code>.<br />
<br />
===All jobs are "stopped"===<br />
After updating CUPS, if all jobs sent to the printer become "stopped", delete the printer and add it again.<br />
Using the CUPS web interface (http://localhost:631), go to Printers > Delete Printer.<br />
<br />
''Note:'' If you don't remember your printer's settings, go to Printers > Modify Printer. Copy down the information displayed, click 'Modify Printer' to proceed to the next page(s), etc.<br />
<br />
===The PPD version (XXXXXX) is not compatible with Gutenprint X===<br />
Run (as root)<br />
<pre><br />
/usr/sbin/cups-genppdupdate<br />
</pre><br />
And restart CUPS (as pointed out in gutenprint's post-install message)<br />
<br />
==Other==<br />
<br />
===A HPLIP printer sends "/usr/lib/cups/backend/hp failed" error===<br />
Make sure dbus is installed and running, e.g. check DAEMONS in /etc/rc.conf or run 'ls /var/run/daemons'.</div>
Listdata
https://wiki.archlinux.org/index.php?title=Yaourt&diff=59071
Yaourt
2009-01-24T06:52:58Z
<p>Listdata: /* Easy Install */ Changed the ordering to be consistent with general wiki pages</p>
<hr />
<div>{{i18n_links_start}}<br />
<br />
{{i18n_entry|English|Yaourt}}<br />
{{i18n_entry|Italiano|Yaourt (Italiano)}}<br />
{{i18n_entry|简体中文|Yaourt(简体中文)}}<br />
{{i18n_entry|Español|Yaourt_(Español)}}<br />
<br />
{{i18n_links_end}}<br />
<br />
'''Y'''et '''A'''n'''O'''ther '''U'''ser '''R'''epository '''T'''ool. Yaourt is a community-contributed wrapper for pacman which adds seamless access to the [[AUR]], allowing and automating package compilation and installation from your choice of the 11,000+ PKGBUILDs in the [[AUR]], in addition to the many thousands of available Arch binary packages. Yaourt uses the same exact syntax as pacman, which saves you from relearning an entirely new method of system maintenance, but also adds new options. Yaourt expands the power and simplicity of pacman by adding even more useful features and provides pleasing, colorized output, interactive search mode, and much more. You will almost certainly want this. <br />
<br />
===PKGBUILD Install===<br />
<br />
The traditional way to install Yaourt is through the actual AUR. In learning how to install yaourt this way, you will have the opportunity to learn how the AUR (and PKGBUILD)works.<br />
<br />
Open a web browser and head to the [http://aur.archlinux.org/packages.php?ID=5863 yaourt AUR page]<br />
<br />
Under package details download the [http://aur.archlinux.org/packages/yaourt/yaourt.tar.gz tarball]<br />
<br />
Unpack the tarball<br />
<br />
tar zxvf yaourt.tar.gz<br />
<br />
Navigate into the new directory<br />
<br />
cd yaourt<br />
<br />
At this point; '''Make sure that you check the contents of the PKGBUILD and the yaourt.install files!''' This cannot be stressed enough, don't worry, they aren't too complicated. Just take a look, if you see anything suspicious, get on irc or the forum and ask about it.<br />
<br />
more yaourt.install<br />
more PKGBUILD<br />
<br />
If everything looks good. We are ready to build the packages. <br />
<br />
makepkg PKGBUILD<br />
<br />
After this process is complete, you will see several new files and directories. You should be interested in the file that ends with *.pkg.tar.gz (in this case mine is named; yaourt-0.9.2-i686.pkg.tar.gz)<br />
<br />
Now it's time to use pacman to install yaourt. ''Be sure to change the package name to the actual name of your package, don't just copy and paste this line''<br />
<br />
pacman -U yaourt-0.9.2-i686.pkg.tar.gz<br />
<br />
Congratulations! You're done! Remember, this is the SAME process for almost all AUR PKGBUILDs.<br />
<br />
See the [http://archlinux.fr/yaourt-en# yaourt] man page for more.<br />
<br />
===Easy Install===<br />
<br />
The easiest way to install Yaourt is to add the yaourt repository to your /etc/pacman.conf:<br />
<br />
For i686:<br />
[archlinuxfr]<br />
Server = http://repo.archlinux.fr/i686<br />
For x86-64:<br />
[archlinuxfr]<br />
Server = http://repo.archlinux.fr/x86_64<br />
<br />
Sync and install:<br />
pacman -Sy yaourt<br />
<br />
If you wish, you may then create your own command aliases in ~/.bashrc to save typing: <br />
nano ~/.bashrc<br />
<br />
alias p='pacman'<br />
alias y='yaourt' <br />
Save and then source:<br />
source ~/.bashrc</div>
Listdata
https://wiki.archlinux.org/index.php?title=Alpine&diff=56605
Alpine
2008-12-31T07:21:12Z
<p>Listdata: /* Setting Up A Proper Return Address */</p>
<hr />
<div>=Alpine: A Console Based E-mail and News Client=<br />
<br />
==Introduction==<br />
<br />
Alpine is based on pine, a text-based E-mail and newsclient that was originally released by the university of Washington in 1991. Right now, this wiki page is just a quick and dirty guide to configuring Alpine to use with a remote mailserver using IMAP.<br />
<br />
==Installation==<br />
<br />
Alpine is a package in Extra with some light dependencies, libldap, heimdal>=1.2, and gettext but you can grab them all with:<br />
<br />
pacman -S alpine<br />
<br />
You might also want to grab something to check your spelling, like:<br />
<br />
pacman -S aspell<br />
<br />
==Configuration for use with IMAP==<br />
<br />
Alpine can be configured directly from the config file in your home folder called ".pinerc", but it's usually easier to use the in program configuration tools (which are pretty comprehensive anyway). You can also create a system wide pinerc file if you want to, but that's beyond the scope of this page.<br />
<br />
To start alpine call up a console or a terminal emulator and type, you guessed it:<br />
<br />
alpine<br />
<br />
You will see the main menu for alpine, you can select various sub-menus by moving your cursor with the arrow keys. You should also note that a<br />
list of handy commands is given at the bottom of the screen including "?" for built in help (see below).<br />
<br />
To get to the configuration options we want to type "S" for "setup" and then "C" for "config"(or you can select these by using the arrow keys and return) At the top of your screen you will see various lines you can edit by pressing "C", for "change value" (I've pasted an example in below), you'll probably want<br />
to fill in you name, the name of your mailserver in "User Domain" (although you might have to override this later, more on<br />
that later), your SMTP server for sending mail and, if you want to, the location of things like your saved message folder<br />
and postponed message folder. <br />
<br />
Some notes on setting up your SMTP server, as you can see below I've specified my mailserver and which port to connect to,<br />
you also need to specify your username on that server (probably your e-mail address) and if you are using some method of encryption ssl or tls note the format:<br />
<br />
mailserver.org:portnumber/user=username/ssl (or tls)<br />
<br />
Also note the format for where I've told Alpine to keep my saved and postponed messages, since I want them stored on the mailserver, and not locally, I've added an entry with form:<br />
<br />
{mailserver.org:portnumber/user=username/ssl}/path/to/folder<br />
<br />
You need to put the full entry you've specified for you SMTP Server into "{}" before the path name to the folder on the mailserver.<br />
<br />
Personal Name = Jim Bob<br />
User Domain = mailserver.org<br />
SMTP Server (for sending) = mailserver.org:465/user=jimbob123/ssl<br />
NNTP Server (for news) = <No Value Set><br />
Inbox Path = <No Value Set: using "inbox"><br />
Incoming Archive Folders = <No Value Set><br />
Pruned Folders = <No Value Set><br />
Default Fcc (File carbon copy) = {mailserver.org:465/user=jimbob123/ssl}~/mail/sent-mail<br />
Default Saved Message Folder = <No Value Set: using "saved-messages"><br />
Postponed Folder = {mailserver.org:465/user=jimbob123/ssl}~/mail/drafts<br />
Read Message Folder = <No Value Set><br />
Form Letter Folder = <No Value Set><br />
Trash Folder = <No Value Set: using "Trash"><br />
Literal Signature = <No Value Set><br />
Signature File = <No Value Set: using ".signature"><br />
Feature List =<br />
<br />
In this day and age, you probably want to set alpine up receive e-mails from another server using imap or pop, to do this we need to enable some things, in particular, check the boxes in the section "Folder Preferences" for "Enable Incoming Folders Collection" and "Enable Incoming Folders Checking". There's a bunch of other fun stuff to configure, but you can come back to that later.<br />
<br />
Now from the main menu type "L" to open "Folder List", then select "Incoming Folders". Now you'll probably see your default inbox, which I'm assuming you'll want to leave alone in case you receive local mail. To add another folder to receive mail from a remote server type "A" to add a folder.<br />
<br />
Alpine prompts you for "name of server to contain folder", enter your mailserver with the format:<br />
<br />
"mailserver.org:993/user=jimbob123/ssl"<br />
<br />
where mailserver.org is the name of your mailserver, 993 should be replaced by the proper port to connect to, jimbob123 should be replaced by your username (probably your e-mail address) and ssl should be replaced by tls if you are using tls instead of ssl.<br />
<br />
Now it will prompt you for the name of the folder on you mailserver to use, it's probably "INBOX" and if it isn't hopefully<br />
you can find out from your mail provider what it is.<br />
<br />
Then it will ask you for a nickname, type whatever you want to call the folder. At this point you might get prompted for<br />
your password on the mailserver, enter it and you should be able to read e-mail!<br />
<br />
==Setting up Other Imap folders==<br />
<br />
Great, now you can read your INBOX, but what about the REST of your Imap folders? We'll fix that know:<br />
<br />
Type "E" to exit setup and make sure that you save the changes. This should put you back at the main menu type "S" again to bring up the setup menu, but this time pick "L" for collectionLists.<br />
<br />
Enter your mailserver info below using the format you should be getting used to by now:<br />
<br />
<br />
Nickname : My Mailserver<br />
Server : mailserver.org:993/user=jimbob123/ssl<br />
Path : ~/mail/<br />
View :<br />
<br />
<br />
Fill in the fields above to add a Folder Collection to your<br />
COLLECTION LIST screen.<br />
Use the "^G" command to get help specific to each item, and<br />
use "^X" when finished.<br />
<br />
Note that "Path" is the path on the remote server and you DON'T have to write:<br />
<br />
{mailserver.org:993/user=jimbob123/ssl}~/mail/<br />
<br />
You only need to give the local path on the mailserver (in this case ~/mail/)<br />
<br />
==Setting Up A Proper Return Address==<br />
<br />
If you've followed the steps above you can read and write e-mails, but you're probably not specifying your return address correctly, in fact, you will specify you return address properly if and only if the user name on the host computer which is run alpine is the same as your e-mail address on the mail server. In order to fix this we edit the configuration again (type "M" for main menu, type "S" for setup, and "C" for configuration). Then find "Customized Headers" (either use the "Whereis" command to search, or page down a few pages to find this) and change the value to<br />
<br />
From: Jim Bob <jimbob123@mailserver.org><br />
<br />
Of course, replace Jim Bob with your name and put your proper e-mail address in the <>. While this works, the behavior of alpine with respect to this field is somewhat complex if you want now more use:<br />
<br />
==Built in Help==<br />
<br />
To see built-in help files on just about anything you can type "?", if you have an item highlighted, this will give you help on that item.<br />
<br />
==What else can you configure?==<br />
<br />
Almost anything, in particular you can specify which colors to use, (from the main menu "S" for set up "K" for colors ... should be natural for KDE users), a browser to open external links (this is in the "Config" setup that we've previously been modifying"), an alternate text editor to use, different folder views, etc.<br />
<br />
==External Links==<br />
<br />
[http://www.washington.edu/alpine/ Official Alpine Page] this page includes links to un-official Alpine pages that have some handy tutorials (argue better than the one I've provided here), hit "C" to open the config menu.<br />
<br />
==Printing from Alpine==<br />
Printing from Alpine directly to <tt>lpr</tt> does not work with special characters like German Umlauts in the Mail to be printed. The <tt>a2ps</tt> program does help:<br />
pacman -S a2ps<br />
You can then edit <tt>~/.pinerc</tt>:<br />
# Your default printer selection<br />
printer=<VOURPRINTER> [] a2ps -q --center-title --footer -P<YOURPRINTER><br />
<br />
# List of special print commands<br />
personal-print-command=<YOURPRINTER> [] a2ps -q --center-title --footer -P<YOURPRINTER><br />
<br />
# Which category default print command is in<br />
personal-print-category=3<br />
Replace <tt><YOURPRINTER></tt> with the name of your printer. Note that these settings can also be applied in the setup UI of Alpine. See the manpage of <tt>a2ps</tt> for more configuration options.</div>
Listdata
https://wiki.archlinux.org/index.php?title=Network_Time_Protocol&diff=56157
Network Time Protocol
2008-12-25T01:49:57Z
<p>Listdata: /* Using OpenNTPD instead of ntpd */</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:Daemons and system services (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|:Network Time Protocol}}<br />
{{i18n_entry|简体中文|:Network Time Protocol (简体中文)}}<br />
{{i18n_links_end}}<br />
This article discribes the different possibilities of getting accurate system time and date for your Arch Linux. First openntpd is explained, an easy to use solution. Second, the original ntpd is explained.<br />
<br />
== OpenNTPD ==<br />
<br />
===Using OpenNTPD instead of ntpd===<br />
<br />
OpenNTPD is a FREE, easy to use implementation of the Network Time Protocol. It provides the ability to sync the local clock to remote NTP servers and can act as NTP server itself, redistributing the local clock.<br />
<br />
OpenNTPD is primarily developed by Henning Brauer as part of the OpenBSD Project.<br />
<br />
OpenNTPD is a brand new implementation of the ntp protocol. It is much easier to configure and use than ntpd.<br />
<br />
First, the OpenNTPD package must be installed.<br />
It is available in the Arch Linux community repository.<br />
<br />
# pacman -S openntpd<br />
<br />
Once installed, the /etc/ntpd.conf file must be edited.<br />
This is much easier than with ntpd.<br />
<br />
The default configuration is actually usable if all you want is to sync the local computer.<br />
<pre><br />
# $OpenBSD: ntpd.conf,v 1.7 2004/07/20 17:38:35 henning Exp $<br />
# sample ntpd configuration file, see ntpd.conf(5)<br />
<br />
# Addresses to listen on (ntpd does not listen by default)<br />
#listen on *<br />
#listen on 127.0.0.1<br />
#listen on ::1<br />
<br />
# sync to a single server<br />
#server ntp.example.org<br />
<br />
# use a random selection of 8 public stratum 2 servers<br />
# see http://twiki.ntp.org/bin/view/Servers/NTPPoolServers<br />
servers pool.ntp.org<br />
</pre><br />
<br />
To sync to a particular server, uncomment and edit the "server" directive.<br />
server ntp.example.org<br />
<br />
The "servers" directive works the same as the "server" directive, however, if the dns name resolves to multiple IP address, ALL of them will be synced to. The default, "pool.ntp.org" is working and should be acceptable in most cases.<br />
pool.ntp.org<br />
<br />
Any number of "server" or "servers" directives may be used.<br />
<br />
If you want the computer you run OpenNTPD on to also be a time server, simply uncomment and edit the "listen" directive.<br />
<br />
For example:<br />
listen on *<br />
will listen on all interfaces, and<br />
listen on 127.0.0.1<br />
will only listen on the loopback interface.<br />
<br />
If you would like to run OpenNTPD at boot, add openntpd the DAEMONS variable in your /etc/rc.conf. If you are using openntpd just to set your local system time, you could add @openntpd instead of openntpd to decrease the boot time; adding the @ makes arch run the other daemons following @openntpd without waiting for openntpd to finish.<br />
<br />
If you want to see the status of of your syncing, look at /var/log/daemon.log<br />
<br />
=== Trouble Shooting ===<br />
If you find your time set incorrectly and in log you see<br />
openntpd adjtime failed: Invalid argument<br />
try "<code>ntpd -s -d</code>" in console .<br />
<br />
== ntp ==<br />
===Installation===<br />
# pacman -S ntp<br />
<br />
===/etc/ntp.conf Configuration===<br />
The very first line of your ntp.conf file should contain a line such as the following:<br />
restrict default noquery notrust nomodify<br />
<br />
This essentially restricts everyone from modifying anything. Following this, you need to let ntpd know what you want to let through into your NTP server. Here is where you would specify any other ip addresses you would like to synchronize on your NTP server. For example:<br />
restrict 1.2.3.4<br />
restrict 192.168.0.0 mask 255.255.255.0 nomodify<br />
<br />
This tells ntpd that 1.2.3.4 and all ip addresses from the 192.168.0.0 range will be allowed to synchronize on this server, but they will not be allowed to modify anything. All other IP addresses in the world will still obey the default restrictions (the first line in the ntp.conf).<br />
<br />
Now, is where the stratum 2 servers that our server will synchronize with come into play. The lines in ntp.conf will be used to tell ntpd what servers we would like to use for synchronizing (these are just examples; use ntp servers that are closest to your location). Please see http://ntp.isc.org/bin/view/Servers/NTPPoolServers for a list a closer servers.<br />
server ntp1.cs.wisc.edu<br />
server ntp3.cs.wisc.edu<br />
server ntp3.sf-bay.org<br />
<br />
Unless you have a good reason not to, it is advisable to use the pool.ntp.org servers: http://www.pool.ntp.org/.<br />
Alternatively, a list of ntp servers is available at http://www.eecis.udel.edu/~mills/ntp/clock2a.html. Please pay attention to the Access Policies. <br />
<br />
If we left it alone right now, we would never connect to a server because the response from any of the three servers listed above would never be allowed back into our server due to the fact that our default restrict statement would be in use (since we did not add the servers to our lesser restrictions (like we did with 127.0.0.1 and the subnet of 192.168.0.0).<br />
<br />
To correct this, enter the following lines in ntp.conf:<br />
restrict ntp1.cs.wisc.edu noquery nomodify<br />
restrict ntp3.cs.wisc.edu noquery nomodify<br />
restrict ntp3.sf-bay.org noquery nomodify<br />
<br />
This will allow the response from the above servers into our system so our local clock can be synchronized. The noquery restriction will not allow any of the above three servers to query for information from our server. The nomodify restriction will not allow the three servers to modify anything (synchronization will still take place).<br />
<br />
The only thing left to do is add the drift file (which keeps track of yours clocks time deviation). and the log file location:<br />
driftfile /etc/ntp.drift<br />
logfile /var/log/ntp.log<br />
<br />
The complete file will look like this:<br />
<br />
<pre><br />
# default restrictions<br />
restrict default noquery notrust nomodify<br />
<br />
# override the default restrictions here<br />
restrict 10.1.1.0 mask 255.255.255.0 nomodify<br />
<br />
# public NTP servers to sync with (all stratum 2)<br />
server ntp1.cs.wisc.edu<br />
server ntp3.cs.wisc.edu<br />
server ntp3.sf-bay.org<br />
<br />
restrict ntp1.cs.wisc.edu noquery nomodify<br />
restrict ntp3.cs.wisc.edu noquery nomodify<br />
restrict ntp3.sf-bay.org noquery nomodify<br />
<br />
# NTP drift file - used to keep track of your system clocks<br />
# time deviation<br />
driftfile /etc/ntp.drift<br />
<br />
# NTP log file<br />
logfile /var/log/ntp.log<br />
</pre><br />
<br />
Take note that this is for a client and a server ntp.conf configuration. If you just want to synchronize with a stratum server and are not concerned with other PCs synchronizing with your ntp server, then you can do something like the following (note that only 127.0.0.1 is allowed to be synchronized):<br />
<br />
<pre><br />
# default restrictions<br />
restrict default noquery notrust nomodify<br />
<br />
# Permit all access over the loopback interface<br />
restrict 127.0.0.1<br />
<br />
# public NTP servers to sync with (all stratum 2)<br />
server ntp1.cs.wisc.edu<br />
server ntp3.cs.wisc.edu<br />
server ntp3.sf-bay.org<br />
<br />
restrict ntp1.cs.wisc.edu noquery nomodify<br />
restrict ntp3.cs.wisc.edu noquery nomodify<br />
restrict ntp3.sf-bay.org noquery nomodify<br />
<br />
# NTP drift file - used to keep track of your system clocks<br />
# time deviation<br />
driftfile /etc/ntp.drift<br />
<br />
# NTP log file<br />
logfile /var/log/ntp.log<br />
</pre><br />
<br />
... or if you don't care about restrictions at all, something like this (note there are no restrictions, thus no need to reduce restrictions for 127.0.0.1 to allow your local clock to synchronize):<br />
<br />
<pre><br />
# public NTP servers to sync with (all stratum 2)<br />
server ntp1.cs.wisc.edu<br />
server ntp3.cs.wisc.edu<br />
server ntp3.sf-bay.org<br />
<br />
# NTP drift file - used to keep track of your system clocks<br />
# time deviation<br />
driftfile /etc/ntp.drift<br />
<br />
# NTP log file<br />
logfile /var/log/ntp.log<br />
</pre><br />
<br />
===A Note about Security===<br />
You may wonder about all of the restrict lines. The reason for them is security. If you don't want a secure NTP server, don't add any restrict lines to your ntp.conf file. If you want a secure NTP server, start out by adding a default restrict that doesn't allow anything to contact your server, then add more (less restrictive) restrict lines - allowing certain addresses various access privileges.<br />
<br />
===/etc/rc.d/network file modification===<br />
One more thing that you may want to do. In some cases, your /etc/ntp.conf file may be overwritten by dhcp. To avoid this, edit the /etc/conf.d/dhcpcd file and add <code>-N</code> to the line that starts with '<code>dhcpcd -t 10</code>'.<br />
<br />
'''Note:''' This was my experience/solution with setting the time:<br />
<br />
On my system my /etc/conf.d/dhcpcd contains a single line:<br />
DHCPCD_ARGS="-t 30 -h $HOSTNAME"<br />
<br />
I assume it needs to be changed to:<br />
DHCPCD_ARGS="-N -t 30 -h $HOSTNAME"<br />
<br />
Some have suggested adding <code>-R</code> to preserve /etc/resolv.conf as well.<br />
<br />
===To fix Time use /etc/rc.local===<br />
To set the correct time; Set time and start ntpd at boot via /etc/rc.local<br />
<br />
Relevant sections of /etc/rc.conf<br />
HARDWARECLOCK="UTC"<br />
TIMEZONE="US/Mountain"<br />
<br />
''Network/DHCP section:''<br />
lo="lo 127.0.0.1"<br />
eth0="dhcp"<br />
INTERFACES=(lo eth0)<br />
''Daemons subsection:''<br />
DAEMONS=(syslog-ng hotplug !pcmcia network netfs !ntpd crond dbus hal alsa gdm)<br />
<br />
This is my /etc/rc.local<br />
#!/bin/bash<br />
#<br />
# /etc/rc.local: Local multi-user startup script.<br />
#<br />
<br />
# Re-copy ntp.conf (was over written by dhcp)<br />
cp /root/CONFIG.BAK/ntp.conf.bac /etc/ntp.conf<br />
# I advise you keep your desired /etc/ntp.conf<br />
# OUTSIDE of /etc<br />
<br />
# Set time<br />
/usr/bin/ntpdate ntp.nasa.gov #Use any time server you like here<br />
<br />
# Start ntpd<br />
/etc/rc.d/ntpd start<br />
<br />
And here is my /root/CONFIG.BAK/ntp.conf.bac (this is just a copy of the desired /etc/ntp.conf)<br />
# default restrictions<br />
restrict default noquery notrust nomodify<br />
<br />
# override the default restrictions here<br />
restrict 127.0.0.1 nomodify<br />
restrict 192.168.2.0 mask 255.255.255.0 nomodify<br />
<br />
# public NTP servers to sync with (all stratum 2)<br />
server ntp.nasa.gov #Use any time server you like here<br />
<br />
restrict ntp.nasa.gov noquery nomodify<br />
<br />
# NTP drift file - used to keep track of your system clocks<br />
driftfile /etc/ntp.drift<br />
<br />
# NTP log file<br />
logfile /var/log/ntp.log<br />
<br />
Leave /etc/conf.d/dhcpcd at default. Mine is a single line and reads<br />
DHCPCD_ARGS="-t 30 -h $HOSTNAME"<br />
<br />
With this configuration I get the correct time and ntpd running at boot.<br />
There may be a better way, but this worked for me.<br />
I hope it helps.<br />
<br />
===Updating your system immediately using ntpdate===<br />
It is recommended to add a line like the following to your /etc/rc.local file so when you boot your system, your time will be correct (use an NTP server close to your location).<br />
/usr/bin/ntpdate ntp1.cs.wisc.edu<br />
<br />
Running ''ntpdate'' when you boot up is a good idea because ntpd may take a long time to synchronize your local clock depending on how far off the time is. If your clock is synchronized when ntpd starts, then it's sole purpose is to keep it synchronized. To run ntpd at startup, add ''ntpd'' to the daemons section of the /etc/rc.conf file.<br />
<br />
ntpd will work well if you have a connection to the internet all the time. If you are using dialup, you may just want to stick with using ntpdate via the command line.<br />
<br />
===Querying your NTP server using ntpq===<br />
There is a default restrict statement for the localhost that includes an ignore flag. Without overriding it (adding the line ''restrict'' ''127.0.0.1'') you will not be able to query your NTP server. If that's not a concern to you, then leave out the restrict line for your localhost. You will still be able to synchronize with your stratum 2 servers.<br />
<br />
== External Resources ==<br />
* http://www.ntp.org/<br />
* http://twiki.ntp.org/bin/view/Main/WebHome<br />
* http://www.eecis.udel.edu/~mills/ntp/html/index.html<br />
* http://www.openntpd.org</div>
Listdata
https://wiki.archlinux.org/index.php?title=Newcomers_Guide&diff=56004
Newcomers Guide
2008-12-23T09:46:02Z
<p>Listdata: /* ~/.xinitrc */</p>
<hr />
<div>[[Category:Getting and installing Arch (English)]]<br />
[[Category:About Arch (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
{{Article summary start}}<br />
{{Article summary text|Provides a highly detailed, explanatory guide to installing, configuring and using a full-featured Arch Linux system.}}<br />
{{Article summary heading|Available Languages}}<br />
{{i18n_entry|Česky|Průvodce začátečníka (Česky)}}<br />
{{i18n_entry|Dansk|Dansk_Begynderguide}}<br />
{{i18n_entry|简体中文|Beginners Guide 新手指南}}<br />
{{i18n_entry|正體中文|Beginner's Guide 新手指南}}<br />
{{i18n_entry|Deutsch|Beginners Guide (Deutsch)}}<br />
{{i18n_entry|English|Beginners Guide}}<br />
{{i18n_entry|Español|Guía para Principiantes (Español)}}<br />
{{i18n_entry|Français|Manuel_du_Débutant_(Français)}}<br />
{{i18n_entry|Italiano|Beginners Guide (Italiano)}}<br />
{{i18n_entry|Lietuviškai|Pradedančiųjų gidas (Lietuviškai)}}<br />
{{i18n_entry|Português Brasil|Guia do Iniciante(Português do Brasil)}}<br />
{{i18n_entry|Português|Guia para Principiantes(Português)}}<br />
{{i18n_entry|Русский|Руководство_для_новичков}}<br />
{{i18n_entry|Türkçe|Başlangıç Rehberi (Türkçe)}}<br />
{{Article summary heading|Related articles}}<br />
{{Article summary wiki|Official Arch Linux Install Guide}} (provides a more general approach)<br />
{{Article summary end}}<br />
==Preface==<br />
<br />
=====Everything you ever wanted to know about Arch, but were afraid to ask=====<br />
Welcome. This self-contained document will guide you through the process of installing, configuring and using [[Arch Linux]]; a simple, agile and lightweight GNU/Linux distribution, <code>UNIX</code>-like operating system. Arch Linux requires a certain level of intimate knowledge of its configuration and of <code>UNIX</code>-like system methodology and for this reason, extra explanatory information is included. This guide is aimed at new Arch users, but strives to serve as a strong reference and informative base for all. After reading it entirely, the reader will be well equipped to begin using Arch.<br />
<br />
'''Arch Linux distribution highlights:'''<br />
* '''[[The Arch Way | Simple]]''' design and philosophy<br />
* Community distro targeted at competent GNU/Linux users<br />
* All packages compiled for '''i686/x86-64'''<br />
* Highly customizable system assembled by the user from the ground up<br />
* '''[[The Arch boot process | BSD-style init]]''' scripts, featuring one centralized configuration file<br />
* '''Rolling Release''' model<br />
* '''[[Pacman]]''' package manager is fast, written in '''C''', lightweight and agile, with a very modest memory footprint<br />
* '''[[ABS]]''': The '''A'''rch '''B'''uild '''S'''ystem, a ports-like package building system makes it simple to create your own easily installable Arch packages from source, to use and/or share with the community on the [[AUR]]<br />
* '''[[AUR]]''': The Arch User Repository, offering many thousands of build scripts for Arch user-provided software packages<br />
<br />
Since GNU/Linux Distributions are fundamentally 'modular' by design, the guide is logically divided into 3 main components of a desktop <code>UNIX</code>-like operating system:<br />
<br />
'''[[#Part I: Install the Base System|Part I: Installing the Base system]]'''<br />
<br />
'''[[#Part II: Install X and configure ALSA|Part II: Installing X and configuring ALSA]]'''<br />
<br />
'''[[#Part III: Installing and configuring a Desktop Environment|Part III: Installing a Desktop Environment]]'''<br />
<br />
=====DON'T PANIC!=====<br />
The Arch Linux system is assembled by the ''user'', from the shell, using basic command line tools. This is '''[[The Arch Way]].''' Unlike the more rigid structures of other distributions and installers, there are no default environments nor configurations chosen for you. From the command line, ''you'' will add packages from the Arch repositories using the [[pacman]] tool via your internet connection and manually configure your installation until your system is customized to your requirements. This method allows for maximum flexibility, choice, and system resource control ''from the base up''.<br />
<br />
Arch Linux is aimed at competent GNU/Linux users who desire minimal 'code separation' from their machine.<br />
<br />
=====License=====<br />
<br />
Arch Linux, pacman, documentation, and scripts are copyright<br />
©2002-2007 by Judd Vinet, ©2007-2008 by Aaron Griffin and are licensed under the GNU General Public License Version 2.<br />
=====[[The Arch Way]]=====<br />
<br />
'''''The design principles behind Arch are aimed at keeping it [[The Arch Way|simple]].'' '''<br />
<br />
'Simple', in this context, shall mean 'without unnecessary additions, modifications, or complications'. In short; an elegant, minimalist approach.<br />
<br />
'''Some thoughts to keep in mind:'''<br />
<br />
*''" 'Simple' is defined from a technical standpoint, not a usability standpoint. It is better to be technically elegant with a higher learning curve, than to be easy to use and technically [inferior]." -Aaron Griffin''<br />
<br />
*''Entia non sunt multiplicanda praeter necessitatem'' or "Entities should not be multiplied unnecessarily." -Occam's razor. The term ''razor'' refers to the act of shaving away unnecessary complications to arrive at the simplest explanation, method or theory.<br />
<br />
*''"The extraordinary part of [my method] lies in its simplicity..I always believe that the simple way is the right way."'' - Bruce Lee<br />
<br />
{{Box Note |'''Following this guide closely is essential in order to successfully install a properly configured Arch Linux system, so ''please'' read it thoroughly. It is strongly recommended you read each section completely before carrying out the tasks contained.'''}}<br />
* You may wish to make a print out of this guide which will serve as a useful Arch Linux user reference. Simply click on the 'Printable Version' tab in the toolbox on the top-left.<br />
*''If you would like to add to this wiki, please include the "Why" as well as the "How", where appropriate. The best documentation teaches us how, as well as why!''<br />
* The Arch wiki is an excellent resource and should be consulted for issues [http://wiki.archlinux.org/index.php/Main_Page first]; IRC (freenode #archlinux), and the [http://bbs.archlinux.org/ forums] are also available if the answer cannot be found.<br />
<br />
<br />
Welcome to Arch! Enjoy the installation; take your time and have fun!<br />
<br />
Now, let's get started.<br />
<br />
==Part I: Install the Base System==<br />
<br />
===Obtain the latest Installation media ===<br />
<br />
You can obtain Arch's official archiso media from [http://archlinux.org/download/ here]. The latest version is 2008.06<br />
<br />
You can obtain Tobias Powalowski's 2008.12 archboot media from [http://downloads.archlinux.de/iso/archboot/2008.12/ here]. <br />
<br />
*Both the Core installer and the FTP/HTTP-downloads provide only the necessary packages to create an '''Arch Linux base system'''. ''Note that the Base System does not include a GUI. It is mainly comprised of the GNU toolchain, (compiler, assembler, linker, libraries, shell, and a few useful utilities) the Linux kernel, and a few extra libraries and modules.'' <br />
*Expanding your Arch Linux system beyond the base system, to include extra software, a Graphical User Interface, etc., is achieved from the command line, ''by the user'', via the pacman package manager to grab i686/x86-64 binary packages. The process is covered in detail below.<br />
====CD installer====<br />
Burn the .iso to a CD with your preferred burner, and continue with [[#Boot Arch Linux Installer | Boot Arch Linux Installer]]<br />
{{Box Note| Optical drives as well as CD media quality vary greatly, but generally, using a slow burn speed is recommended for reliable burns; Some users recommend speeds '''''as low as 4x or 2x.''''' If you are experiencing unexpected behavior from the CD, try burning at the minimum speed supported by your system. }}<br />
<br />
====USB stick====<br />
<font color="red">'''WARNING''': This will destroy all data on your USB stick.</font><br />
<br />
Insert an empty or expendable USB stick, determine its path, and dump the .img to the USB stick with the <code>/bin/dd</code> program:<br />
dd if=archlinux-2008.06-[core_or_ftp]-i686.img of=/dev/sd''x''<br />
where ''if='' is the path to the img file and ''of='' is your USB device. Make sure to use /dev/sd''x'' and not /dev/sd''x1''.<br />
<br />
'''Check md5sum (optional):'''<br />
<br />
Make a note of the number of records (blocks) read in and written out, then perform the following check:<br />
dd if=/dev/sd''x'' count=''number_of_records'' status=noxfer | md5sum<br />
The md5sum returned should match the md5sum of the downloaded archlinux image file; they both should match the md5sum of the image as listed in the md5sums file in the mirror distribution site.<br />
<br />
Continue with [[#Boot Arch Linux Installer | Boot Arch Linux Installer]]<br />
<br />
===Boot Arch Linux Installer===<br />
Insert the CD or USB stick and boot from it. You may have to <br />
change the boot order in your computer BIOS or press a key (usually DEL, F1, F2, F11 or F12) during the BIOS POST phase.<br />
<br />
Memory requirements:<br />
<br />
* CORE : 160 MB RAM x86_64/i686 (all packages selected, with swap partition)<br />
* FTP : 160 MB RAM x86_64/i686 (all packages selected, with swap partition)<br />
<br />
Choose Boot Archlive or Boot Archlive [legacy IDE] if you have trouble with libata/PATA. <br />
<br />
To change boot options press '''e''' for editing the boot lines. Many users may wish to change the resolution of the framebuffer, for more readable console output. Append:<br />
vga=773<br />
to the kernel line, followed by <ENTER>, for a 1024x768 framebuffer. Hit '''b''' to boot.<br />
<br />
The system will now boot and present a login prompt.<br />
<br />
===Login and Changing the keymap===<br />
Login as 'root'.<br />
<br />
If you have a non-US keyboard layout do:<br />
# km<br />
at the prompt, and choose your keymap/console font.<br />
<br />
===Documentation===<br />
The guide you are now reading is available on the live system. Change to vc/2 with <ALT>+F2 and invoke <code>/usr/bin/less</code>:<br />
# less /arch/beginnersguide.txt<br />
<code>less</code> will allow you to page through the document. Change back to vc/1 with <ALT>+F1. <br />
<br />
Change back to vc/2 if you need to reference the Beginners' Guide at any time.<br />
<br />
===Start the Installation===<br />
As root, run the installer script from vc/1:<br />
# /arch/setup <br />
<br />
====Select an installation source====<br />
After a welcome screen, you will be prompted for an installation source. Choose the appropriate source for the installer you are using. <br />
* If you chose the CORE installer, continue below with [[#Prepare Hard Drive|Prepare Hard Drive]].<br />
* FTP/HTTP only: You shall be prompted to load ethernet drivers manually, if desired. Udev is quite effective at loading the required modules, so you may assume it has already done so. You may verify this by invoking ifconfig -a from vc/3. (Select OK to continue.)<br />
<br />
===Configure Network (FTP/HTTP)===<br />
Available Interfaces will be presented. If an interface and HWaddr ('''H'''ard'''W'''are '''addr'''ess) is listed, then your module has already been loaded. If your interface is not listed, you may probe it from the installer, or manually do so from another virtual console.<br />
<br />
The following screen will prompt you to ''Select the interface, Probe,'' or ''Cancel''. Choose the appropriate interface and continue.<br />
<br />
The installer will then ask if you wish to use DHCP. Choosing Yes will run '''dhcpcd''' to discover an available gateway and request an IP address; Choosing No will prompt you for your static IP, netmask, broadcast, gateway DNS IP, HTTP proxy, and FTP proxy. Lastly, you will be presented with an overview to ensure your entries are correct.<br />
<br />
====Wireless Quickstart (If you need wireless connectivity during the installation process)====<br />
<br />
The wireless drivers and utilities are now available to you in the live environment of the installation media. <br />
<br />
If you need wireless functionality from the initial installation (live installer environment) onwards, the basic procedure will be:<br />
* Switch to a free virtual console, e.g.: <ALT>+F3<br />
* Identify your wireless card and appropriate module with the <code>/sbin/hwdetect</code> utility. The --show-net switch will list your network lan and wireless chipsets as well as the corresponding driver(s). (Note that <code>hwdetect</code> does not load drivers for you.):<br />
# hwdetect --show-net<br />
* Ensure udev has loaded the module (listed in the output of hwdetect) with <code>/bin/lsmod</code>:<br />
# lsmod | grep <name_of_module><br />
* If not, probe it using <code>/sbin/modprobe</code>:<br />
# modprobe <name_of_module><br />
{{Box Note | '''''In addition to the wireless module, some wireless chipsets also require corresponding firmware installation. The firmware packages are pre-installed in the live environment, but must be explicitly installed to your actual system to provide wireless functionality after you reboot into your installed system. Package selection and installation is covered below. Ensure installation of both your wireless module and firmware during the package selection step! See [[Wireless Setup]] if you are unsure about the requirement of corresponding firmware installation for your particular chipset. This is a very common error.'''''}}<br />
<br />
* Ensure the driver has created a usable wireless kernel interface with <code>/usr/sbin/iwconfig</code>:<br />
# iwconfig<br />
(Output should show an available wireless interface)<br />
* Bring the interface up with <code>/sbin/ifconfig <interface> up</code>. <br />
<br />
An example, using an atheros card and madwifi driver:<br />
# ifconfig ath0 up<br />
(Remember, your interface may be named something else, depending on your module (driver) and chipset: wlan0, eth1, etc.)<br />
* Specify the id of the wireless network with iwconfig <interface> essid "<youressid>" key <yourwepkey> (give the essid (the 'network name') of the network in quotes), e.g.:<br />
# iwconfig ath0 essid "linksys" key 0241baf34c<br />
* Acquire an IP address with <code>/sbin/dhcpcd <interface> </code>. e.g.:<br />
# dhcpcd ath0<br />
* Ensure you can route using <code>/bin/ping</code>:<br />
# ping -c 3 www.google.com<br />
Done.<br />
<br />
After the initial Arch installation is complete, you may wish to refer to [[Wireless Setup]] to ensure a permanent configuration solution for your system.<br />
<br />
<br />
Return to vc/1 with <ALT>+F1. Continue with [[#Prepare Hard Drive|Prepare Hard Drive]]<br />
<br />
===Prepare Hard Drive===<br />
<br />
<font color="red"> '''WARNING:''' '''''Partitioning hard drives can destroy data. You are strongly cautioned and advised to backup your critical data if applicable.'''''</font><br />
<br />
Verify your current disk identities and layout by invoking <code>/sbin/fdisk</code> with the -l switch.<br />
<br />
Open another virtual console (<ALT>+F3) and enter:<br />
# fdisk -l<br />
Take note of the disk(s)/partition(s) you wish to utilize for your Arch installation.<br />
<br />
Switch back to the installation script with <ALT>+F1<br />
<br />
Select the first menu entry "Prepare Hard Drive". <br />
* Option 1: Auto Prepare<br />
Auto-Prepare divides your disk into the following configuration:<br />
<br />
* ext2 /boot partition, default size 32MB. ''You will be prompted to modify the size to you requirement.''<br />
* swap partition, default size 256MB. ''You will be prompted to modify the size to you requirement.'' <br />
* A Separate / and /home partition, (sizes can also be specified). You may choose from ext2, ext3, reiserfs, xfs and jfs, but note that ''both / and /home shall share the same fs type'' if choosing the Auto Prepare option.<br />
<br />
Be warned that Auto-prepare will completely erase the chosen hard drive. Read the <font color="red">warning</font> presented by the installer very carefully, and make sure the correct device is about to be partitioned.<br />
<br />
* Option 2: '''(Recommended)''' Partition Hard Drives (with cfdisk)<br />
<br />
This option will allow for the most robust and customized partitioning solution for your personal needs. <br />
<br />
''At this point, more advanced GNU/Linux users who are familiar and comfortable with manually partitioning may wish to skip down to '''[[#Select Packages|Select Packages]]''' below.''<br />
<br />
====Partition Hard Drives====<br />
<br />
=====Partition Info=====<br />
<br />
Partitioning a hard disk drive defines specific areas (the partitions) within the disk, that will each appear and behave as a separate disk and upon which a filesystem may be created (formatted). <br />
*There exist 3 types of disk partitions: <br />
#Primary<br />
#Extended<br />
#Logical<br />
'''Primary''' partitions can be bootable, and are limited to 4. If a partitioning scheme requires more than 4 partitions, we are forced to use an '''extended''' partition which will contain '''logical''' partitions.<br />
<br />
Extended partitions are not usable by themselves; they are merely a "container" for logical partitions. If required, a hard disk shall contain only one extended partition; which shall then be sub-divided into logical partitions. <br />
<br />
When partitioning a disk, one can observe this numbering scheme by creating primary partitions sda1-3 followed by creating an extended partition, sda4, and subsequently creating logical partition(s) within the extended partition; sda5, sda6, and so on.<br />
<br />
=====Swap Partition=====<br />
A swap partition is a place on your hard drive where virtual ram resides, allowing the kernel to easily use disk storage for data that does not fit into physical RAM. <br />
<br />
Historically, the general rule for swap partition size was 2x the amount of physical RAM. Over time, as computers have gained ever larger memory capacities, this rule has become increasingly deprecated. Generally, on machines with up to 512MB RAM, the 2x rule is usually quite sufficient. On machines with 1GB RAM, generally a 1x rule is adequate. If you have gratuitous amounts of RAM (more than 1024 MB) it may be possible to completely forgo a swap partition altogether, though this is not recommended. We will create a 1 GB swap partition in this example.<br />
{{Box Note|If you plan on using suspend-to-disk, (hibernate) you must have a swap partition at least '''equal''' in size to the amount of physical RAM, and some Arch users even recommend oversizing it beyond the amount of physical RAM by 10-15%, to allow for possible bad sectors.}}<br />
<br />
=====Partition Scheme=====<br />
A disk partitioning scheme is a very personalized preference. Each user's choices will be unique to their own computing habits and requirements. <br />
<br />
Filesystem candidates for separate partitions include:<br />
<br />
'''/''' (root) ''The root filesystem is the primary filesystem from which all other filesystems stem; the top of the hierarchy. All files and directories appear under the root directory "/", even if they are stored on different physical devices. The contents of the root filesystem must be adequate to boot, restore, recover, and/or repair the system.'' <br />
<br />
'''/boot''' ''This directory contains the kernel and ramdisk images as well as the bootloader configuration file, and bootloader stages. /boot also stores data that is used before the kernel begins executing userspace programs. This may include saved master boot sectors and sector map files.''<br />
<br />
'''/home''' ''User data and user specific configuration files for applications are stored in each user's home directory in a file that starts with the '.' character (a "dot file").''<br />
<br />
'''/usr''' ''While root is the primary filesystem, /usr is the secondary hierarchy, for user data, containing the majority of (multi-)user utilities and applications. /usr is shareable, read-only data. This means that /usr shall be shareable between various hosts and must not be written to, except in the case of system update/upgrade. Any information that is host-specific or varies with time is stored elsewhere.''<br />
<br />
'''/tmp''' ''directory for programs that require temporary files''<br />
<br />
'''/var''' ''contains variable data; spool directories and files, administrative and logging data, pacman's cache, the ABS tree, etc.''<br />
{{Box Note | Besides /boot, directories essential for booting are: '/bin', '/dev', '/etc', '/lib', '/proc' and '/sbin'. Therefore, they must not reside on a separate partition from /.}}<br />
'''''There are several advantages for using discrete filesystems, rather than combining all into one partition''''':<br />
<br />
* Security: Each filesystem may be configured in /etc/fstab as 'nosuid', 'nodev', 'noexec', 'readonly', etc.<br />
* Stability: A user, or malfunctioning program can completely fill a filesystem with garbage if they have write permissions for it. Critical programs, which reside on a different filesystem remain unaffected.<br />
* Speed: A filesystem which gets written to frequently may become somewhat fragmented. (An effective method of avoiding fragmentation is to ensure that each filesystem is never in danger of filling up completely.) Separate filesystems remain unaffected, and each can be defragmented separately as well.<br />
* Integrity: If one filesystem becomes corrupted, separate filesystems remain unaffected.<br />
* Versatility: Sharing data across several systems becomes more expedient when independent filesystems are used. Separate filesystem types may also be chosen based upon the nature of data and usage. <br />
In this example, we shall use separate partitions for /, /var, /home, and a swap partition. <br />
<br />
{{Box Note | /var contains many small files. You may wish to take this into consideration when choosing a filesystem type for it, (if you choose to create its own separate partition).}}<br />
<br />
=====How big should my partitions be?=====<br />
This question is best answered based upon individual needs. If you have little or no experience with partitioning, you may wish to simply create one partition for root, and one partition for swap. Or, follow the example closely, and consider these guidelines to provide a frame of reference:<br />
* The root filesystem (/) in the example will contain the /usr directory, which can become moderately large, depending upon how much software is installed.<br />
<br />
* The /var filesystem will contain, among other data, the [[ABS]] tree and the pacman cache. Keeping cached packages is useful and versatile; it provides the ability to downgrade packages if needed. /var tends to grow in size; the pacman cache can grow large over long periods of time, but can be safely cleared if needed. 6-8 Gigs on a desktop system should therefore be sufficient for /var. Servers tend to have extremely large /var filesystems.<br />
* The /home filesystem is typically where user data, downloads, and multimedia reside. On a desktop system, /home is typically the largest filesystem on the drive by a large margin. <br />
* An extra 25% of space added to each filesystem will provide a cushion for unforeseen occurrence, expansion, and serve as a preventive against fragmentation.<br />
'''''From the guidelines above, the example system shall contain a ~15GB root (/) partition, ~6GB /var, 1GB swap, and a /home containing the remaining disk space.'''''<br />
<br />
=====cfdisk=====<br />
Start by creating the primary partition that will contain the '''root''', (/) filesystem. <br />
<br />
Choose '''N'''ew -> Primary and enter the desired size for root (/). Put the partition at the beginning of the disk. <br />
<br />
Also choose the '''T'''ype by designating it as '83 Linux'. The created / partition shall appear as sda1 in our example.<br />
<br />
Now create a primary partition for /var, designating it as '''T'''ype 83 Linux. The created /var partition shall appear as sda2 <br />
<br />
Next, create a partition for swap. Select an appropriate size and specify the '''T'''ype as 82 (Linux swap / Solaris). The created swap partition shall appear as sda3.<br />
<br />
Lastly, create a partition for your /home directory. Choose another primary partition and set the desired size.<br />
<br />
Likewise, select the '''T'''ype as 83 Linux. The created /home partition shall appear as sda4.<br />
<br />
Example:<br />
<br />
Name Flags Part Type FS Type [Label] Size (MB)<br />
-------------------------------------------------------------------------<br />
sda1 Primary Linux 15440 #root<br />
sda2 Primary Linux 6256 #/var<br />
sda3 Primary Linux swap / Solaris 1024 #swap<br />
sda4 Primary Linux 140480 #/home<br />
<br />
Choose '''W'''rite and type ''''yes''''. Beware that this operation may destroy data on your disk. Choose '''Q'''uit to leave the partitioner. <br />
Choose Done to leave this menu and continue with "Set Filesystem Mountpoints".<br />
<br />
{{Box Note | Since the latest developments of the Linux kernel which include the libata and PATA modules, all IDE, SATA and SCSI drives have adopted the sd''x'' naming scheme. This is perfectly normal and should not be a concern.}}<br />
<br />
====Set Filesystem Mountpoints====<br />
First you will be asked for your swap partition. Choose the appropriate partition (sda3 in this example). You will be asked if you want to create a swap filesystem; select yes. Next, choose where to mount the / (root) directory (sda1 in the example). At this time, you will be asked to specify the filesystem type.<br />
<br />
=====Filesystem Types=====<br />
<br />
Again, a filesystem type is a very subjective matter which comes down to personal preference. Each has its own advantages, disadvantages, and unique idiosyncrasies. Here is a very brief overview of supported filesystems:<br />
<br />
1. '''ext2''' ''Second Extended Filesystem''- Old, reliable GNU/Linux filesystem. Very stable, but ''without journaling support''. May be inconvenient for root (/) and /home, due to very long fsck's. ''An ext2 filesystem can easily be converted to ext3.'' Generally regarded as a good choice for /boot/.<br />
<br />
2. '''ext3''' ''Third Extended Filesystem''- Essentially the ext2 system, but with journaling support. ext3 is completely compatible with ext2. ''Extremely'' stable, mature, and by far the most widely used, supported and developed GNU/Linux FS.<br />
<br />
'''High Performance Filesystems:'''<br />
<br />
3. '''ReiserFS''' - Hans Reiser's high-performance journaling FS uses a very interesting method of data throughput based on an unconventional and creative algorithm. ReiserFS is touted as very fast, especially when dealing with many small files. ReiserFS is fast at formatting, yet comparatively slow at mounting. Quite mature and stable. ReiserFS is not actively developed at this time (Reiser4 is the new Reiser filesystem). Generally regarded as a good choice for /var/.<br />
<br />
4. '''JFS''' - IBM's '''J'''ournaled '''F'''ile'''S'''ystem- The first filesystem to offer journaling. JFS had many years of use in the IBM AIX® OS before being ported to Linux. JFS currently uses the least CPU resources of any GNU/Linux filesystem. Very fast at formatting, mounting and fsck's, and very good all-around performance, especially in conjunction with the deadline I/O scheduler. (See [[JFS]].) Not as widely supported as ext or ReiserFS, but very mature and stable.<br />
<br />
5. '''XFS''' - Another early journaling filesystem originally developed by Silicon Graphics for the IRIX OS and ported to Linux. XFS offers very fast throughput on large files and large filesystems. Very fast at formatting and mounting. Generally benchmarked as slower with many small files, in comparison to other filesystems. XFS is very mature and is currently the only available stable Linux FS with online defragmentation ability.<br />
<br />
===== A note on Journaling=====<br />
All above filesystems, except ext2, use [http://en.wikipedia.org/wiki/Journaling_file_system journaling]. Journaling file systems are fault-resilient file systems that use a journal to log changes before they're committed to the file system to avoid metadata corruption in the event of a crash. Note that not all journaling techniques are alike; specifically, only ext3 offers ''data-mode journaling'', (though, not by default), which journals ''both'' data ''and'' meta-data (but with significant speed penalty). The others only offer ''ordered-mode journaling'', which journals meta-data only. While all will return your filesystem to a valid state after recovering from a crash, ''data-mode journaling'' offers the greatest protection against file system corruption and data loss but can suffer from performance degradation, as all data is written twice (first to the journal, then to the disk). Depending upon how important your data is, this may be a consideration in choosing your filesystem type.<br />
<br />
'''''Moving on...'''''<br />
<br />
Choose and create the filesystem (format the partition) for / by selecting '''yes'''. You will now be prompted to add any additional partitions. In our example, sda2 and sda4 remain. For sda2, choose a filesystem type and mount it as /var. Finally, choose the filesystem type for sda4, and mount it as /home. Return to main menu.<br />
<br />
===Select Packages===<br />
<br />
Now we shall select packages to install in our system.<br />
*Core ISO: Choose CD as source and select the appropriate CD drive if you have more than one. <br />
*FTP ISO: Select an FTP/HTTP mirror. ''Note that archlinux.org is throttled to 50KB/s''.<br />
* 2008.06 installation media: Package category BASE is now installed by default. <br />
<br />
Package selection is split into two stages. First, you will select the base package category, then you will be presented will the full lists of packages, allowing you to fine-tune your selections. Use the space bar to select and unselect.<br />
Choose OK to continue and then choose 'yes' for 'Select all packages by default', for now.<br />
<br />
The next screen will present you with the selected packages within your selected categories.<br />
<br />
{{Box Note | If you are going to require connection to a wireless network with WPA encryption, consider installing netcfg2 (as well as wireless_tools), which will enable you to do so.}}<br />
<br />
Once you're done selecting the packages you need, leave the selection<br />
screen and continue to the next step, Install Packages.<br />
<br />
===Install Packages===<br />
Next, choose 'Install Packages'. You will be asked if you wish to keep the packages in the pacman cache. If you choose 'yes', you will have the flexibility to [[Downgrade packages|downgrade]] to previous package versions in the future, so this is recommended (you can always clear the cache in the future). The installer script will now install the selected packages, as well as the default Arch 2.6 kernel, to your system. <br />
*FTP ISO: The [[Pacman]] package manager will now download and install your selected packages. (See vc/5 for output, vc/1 to return to the installer)<br />
*CORE ISO: The packages will be installed from the CD.<br />
<br />
Note: For Arch 2007.08 FTP installation: after 'Install Packages' you have to upgrade pacman (<ALT>+F3, pacman -Sy pacman) and again 'Install Packages'.<br />
<br />
===Configure the System===<br />
''Closely following and understanding these steps is of key importance to ensure a properly configured system.'' <br />
<br />
At this stage of the installation, you will configure the primary configuration files of your Arch Linux base system.<br />
<br />
The installer will ask if you want to choose [[Hwdetect|hwdetect]] to gather information for your configuration. Beginners should choose 'yes'. <br />
<br />
Advanced users who are thoroughly familiar with their hardware, required modules, and who are able and willing to manually configure /etc/rc.conf, /etc/mkinitcpio, /etc/fstab, and other system-critical configuration files from scratch may wish to choose 'no'. (Needless to say, this option is very involved, beyond the scope of this guide, and therefore is not covered.)<br />
<br />
Next, you will be asked if you need support for booting from USB devices, FireWire devices, PCMCIA devices, NFS shares, software RAID arrays, LVM2 volumes, encrypted volumes, and DSDT support. Choose yes if you need it; in our example nothing is needed. <br />
<br />
Now you will be asked which text editor you want to use; choose [http://en.wikipedia.org/wiki/Nano_%28text_editor%29 nano] or, if you are familiar with it, [http://en.wikipedia.org/wiki/Vim_%28text_editor%29 vim]. You will be presented with a menu including the main configuration files for your system. <br />
<br />
{{Box Note | ''It is very important at this point to edit, or at the very least, to verify by opening, every configuration file.'' The installer script relies on your input to create these files on your installation. A common error is to skip over these critical steps of configuration.}}<br />
<br />
=====Can the installer handle this more automatically?=====<br />
Hiding the process of system configuration is in direct opposition to [[The Arch Way]]. While it is true that recent versions of the kernel and hardware probing tools offer excellent hardware support and auto-configuration, Arch presents the user all pertinent configuration files during installation for the purposes of ''transparency and system resource control''. By the time you have finished modifying these files to your specifications, you will have learned the simple method of manual Arch Linux system configuration and become more familiar with the base structure, leaving you better prepared to use and maintain your new installation productively.<br />
<br />
====='''/etc/rc.conf'''=====<br />
Arch Linux follows in the '''*BSD''' tradition of utilizing '''/etc/rc.conf''' as the principal location for system configuration. This one file contains a wide range of configuration information, principally used at system startup. As its name directly implies, it also contains settings for and invokes the /etc/rc* files, and is, of course, sourced ''by'' these files. /etc/rc.conf offers a simple, elegant method of streamlining system resource configuration by encompassing a wide range of control, readily accessible for the Arch user. <br />
* '''LOCALIZATION''' section<br />
** '''LOCALE'''=: This sets your system locale, which will be used by all i18n-aware applications and utilities. You can get a list of the available locales by running 'locale -a' from the command line. This setting's default is fine for US English users. <br />
** '''HARDWARECLOCK'''=: Specifies whether the hardware clock, which is synchronized on boot and on shutdown, stores '''UTC''' time, or the '''localtime'''. UTC makes sense because it greatly simplifies changing timezones and daylight savings time. localtime is necessary if you dual boot with an operating system such as Windows, that only stores localtime to the hardware clock.<br />
** '''USEDIRECTISA''': Use direct I/O request instead of /dev/rtc for hwclock<br />
** '''TIMEZONE'''=: Specify your TIMEZONE. (All available zones are under /usr/share/zoneinfo/).<br />
** '''KEYMAP'''=: The available keymaps are in /usr/share/kbd/keymaps. Please note that this setting is only valid for your TTYs, not any graphical window managers or '''X'''.<br />
** '''CONSOLEFONT'''=: Available console fonts reside under /usr/share/kbd/consolefonts/ if you must change. The default (blank) is safe.<br />
** '''CONSOLEMAP'''=: Defines the console map to load with the setfont program at boot. Possible maps are found in /usr/share/kbd/consoletrans, if needed. The default (blank) is safe. <br />
** '''USECOLOR'''=: Select "yes" if you have a color monitor and wish to have colors in your consoles.<br />
<br />
LOCALE="en_US.utf8"<br />
HARDWARECLOCK="localtime"<br />
USEDIRECTISA="no"<br />
TIMEZONE="US/Eastern"<br />
KEYMAP="us"<br />
CONSOLEFONT=<br />
CONSOLEMAP=<br />
USECOLOR="yes"<br />
<br />
* '''HARDWARE''' section<br />
** '''MOD_AUTOLOAD'''=: Setting this to "yes" will use '''udev''' to automatically probe hardware and load the appropriate modules during boot-up, (convenient with the default modular kernel). Setting this to "no" will rely on the user's ability to specify this information manually, or compile their own custom kernel and modules, etc.<br />
** '''MOD_BLACKLIST'''=: This has become deprecated in favor of adding blacklisted modules directly to the '''MODULES=''' line below. <br />
** '''MODULES'''=: Specify additional MODULES if you know that an important module is missing, ('''hwdetect''' should have filled in the most important modules). Also specify any blacklisted modules by prefixing them with a bang (!). Udev will be forced NOT to load blacklisted modules. In the example, the IPv6 module as well as the annoying pcspeaker are blacklisted. <br />
# Scan hardware and load required modules at boot<br />
MOD_AUTOLOAD="yes"<br />
# Module Blacklist - Deprecated<br />
MOD_BLACKLIST=()<br />
#<br />
MODULES=(e100 eepro100 mii slhc snd-ac97-codec snd-intel8x0 soundcore !net-pf-10 !pcspkr)<br />
<br />
* '''NETWORKING''' section<br />
** '''HOSTNAME'''=:Set your HOSTNAME to your liking.<br />
** '''eth0'''=: 'Ethernet, card 0'. Adjust the interface IP address, netmask and broadcast address ''if'' you are using '''static IP'''. Set eth0="dhcp" if you want to use '''DHCP'''<br />
** '''INTERFACES'''=: Specify any/all interfaces here. If you do not use DHCP to configure a device, just keep in mind that the value of the variable (whose name must be equal to the name of the device which is supposed to be configured) equals the line which would be appended to the ifconfig command if you were to configure the device manually in the shell.<br />
** '''gateway'''=: If you are using '''static IP''', set the gateway address. If using '''DHCP''', you can usually ignore this variable, though some users have reported the need to define it.<br />
** '''ROUTES'''=: If you are using static '''IP''', remove the '''!''' in front of 'gateway'. If using '''DHCP''', you can usually leave this variable commented out with the bang (!), but again, some users require the gateway and ROUTES defined. If you experience networking issues with pacman, for instance, you may want to return to these variables. <br />
<br />
Example, using '''DHCP''':<br />
HOSTNAME="arch"<br />
#eth0="eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255" <br />
eth0="dhcp"<br />
INTERFACES=(eth0)<br />
gateway="default gw 192.168.0.1"<br />
ROUTES=(!gateway)<br />
{{Box Note | Arch uses the '''dhcpcd''' DHCP client. Alternatively, '''dhclient''' is available from the [extra] repository via pacman.}}<br />
<br />
* '''DAEMONS''' section<br />
<br />
This array simply lists the names of those scripts contained in /etc/rc.d/ which are to be started during the boot process, and the order in which they start. <br />
DAEMONS=(@network syslog-ng netfs crond)<br />
*If a script name is prefixed with a bang (!), it is not executed. <br />
*If a script is prefixed with an "at" symbol (@), then it will be executed in the background; the startup sequence will not wait for successful completion of each daemon before continuing to the next. (Useful for speeding up system boot).<br />
*Edit this array whenever new system services are installed, if starting them automatically during boot is desired. <br />
<br />
This 'BSD-style' init, is the Arch way of handling what others handle with various symlinks to an /etc/init.d directory.<br />
<br />
=====About DAEMONS=====<br />
You do not have to change the [[daemons]] line at this time, but it is useful to explain what daemons are, because we need them later in this guide. <br />
A ''daemon'' is a program that runs in the background, waiting for events to occur and offering services. A good example is a webserver that waits for a request to deliver a page or an SSH server waiting for someone trying to log in. While these are full-featured applications, there are daemons whose work is not that visible. Examples are a daemon which writes messages into a log file (e.g. syslog, metalog), a daemon which lowers your CPU's frequency if your system has nothing to do (e.g.:cpufreq), and a daemon which offers you a graphical login (e.g.: gdm, kdm). All these programs can be added to the daemons line and will be started when the system boots. Useful daemons will be presented during this guide.<br />
<br />
Historically, the term ''daemon'' was coined by the programmers of MIT's Project MAC. They took the name from ''Maxwell's demon'', an imaginary being from a famous thought experiment that constantly works in the background, sorting molecules. <code>UNIX</code> systems inherited this terminology and created the backronym '''d'''isk '''a'''nd '''e'''xecution '''mon'''itor. <br />
<br />
*<font color="blue">'''Tip:</font> All Arch daemons reside under /etc/rc.d/'''<br />
<br />
=====/etc/fstab=====<br />
The '''fstab''' (for '''f'''ile '''s'''ystems '''tab'''le) is part of the system configuration listing all available disks and disk partitions, and indicating how they are to be initialized or otherwise integrated into the overall system's filesystem. The '''/etc/fstab''' file is most commonly used by the '''mount''' command. The mount command takes a filesystem on a device, and adds it to the main system heirarchy that you see when you use your system. '''mount -a''' is called from /etc/rc.sysinit, about 3/4 of the way through the boot process, and reads /etc/fstab to determine which options should be used when mounting the specified devices therein. If '''noauto''' is appended to a filesystem in /etc/fstab, '''mount -a''' will not mount it at boot.<br />
<br />
An example '''/etc/fstab''':<br />
# <file system> <dir> <type> <options> <dump> <pass><br />
none /dev/pts devpts defaults 0 0<br />
none /dev/shm tmpfs defaults 0 0<br />
#/dev/cdrom /media/cdrom auto ro,user,noauto,unhide 0 0<br />
#/dev/dvd /media/dvd auto ro,user,noauto,unhide 0 0<br />
#/dev/fd0 /media/fl auto user,noauto 0 0<br />
/dev/disk/by-uuid/0ec-933.. / jfs defaults,noatime 0 1<br />
/dev/disk/by-uuid/7ef-223.. /home jfs defaults,noatime 0 2<br />
/dev/disk/by-uuid/530-1e-.. swap swap defaults 0 0<br />
/dev/disk/by-uuid/4fe-110.. /var reiserfs defaults,noatime,notail 0 2 <br />
{{Box Note | '''''The 'noatime' option disables writing read access times to the metadata of files and may safely be appended to / and /home regardless of your specified filesystem type for increased speed, performance, and power efficiency. 'notail' disables the ReiserFS tailpacking feature, for added performance at the cost of slightly less efficient disk usage.'''''}}<br />
<br />
* The first field, '''<file system>''', describes the block device or remote filesystem to be mounted. For regular mounts, this field will contain a link to a block device node (as created by mknod which is called by udev at boot) for the device to be mounted; for instance, '/dev/cdrom' or '/dev/sda1'. Instead of giving the device explicitly, the Arch installer indicates the filesystem that is to be mounted by its UUID by default.<br />
{{Box Note | As of 2008-04rc, Arch is now utilizing the UUID, or Universally Unique Identifier naming convention, for consistent device mapping. This is due to active developments in the kernel and also udev, which may randomly change the ordering in which drivers for storage controllers are loaded, yielding an unbootable system/kernel panic. Nearly every motherboard has several controllers (onboard SATA, onboard IDE), and due to the aforementioned development updates, /dev/sda may become /dev/sdb on the next reboot- hence the persistent device naming convention of UUID has been adopted for reliability. ''If you do not need nor wish to use UUID, simply change your fstab to use whatever naming convention desired.'' (See [[Persistent block device naming| this wiki article]] for more information on persistent block device naming. )}}<br />
ls -lF /dev/disk/by-uuid/<br />
Will list all partitions by uuid.<br />
<br />
* The second field, '''<dir>''', describes the mount point for the filesystem. For swap partitions, this field should be specified as 'swap'; (Swap partitions are not actually mounted.)<br />
<br />
* The third field, '''<type>''', describes the type of the filesystem. The Linux kernel supports many filesystem types. (For the filesystems currently supported by the running kernel, see /proc/filesystems). An entry 'swap' denotes a file or partition to be used for swapping. An entry 'ignore' causes the line to be ignored. This is useful to show disk partitions which are currently unused. <br />
<br />
* The fourth field, '''<options>''', describes the mount options associated with the filesystem. It is formatted as a comma separated list of options. It contains at least the type of mount plus any additional options appropriate to the filesystem type. For documentation on the available options for non-nfs file systems, see mount(8).<br />
<br />
* The fifth field, '''<dump>''', is used for these filesystems by the dump(8) command to determine which filesystems need to be dumped. dump is a backup utility. If the fifth field is not present, a value of zero is returned and dump will assume that the filesystem does not need to be backed up. ''Note that dump is not installed by default.''<br />
<br />
* The sixth field, '''<pass>''', is used by the fsck(8) program to determine the order in which filesystem checks are done at boot time. The root filesystem should be specified with a <pass> of 1, and other filesystems should have a <pass> of 2 or 0. Filesystems within a drive will be checked sequentially, but filesystems on different drives will be checked at the same time to use parallelism available in the hardware. If the sixth field is not present or zero, a value of zero is returned and fsck will assume that the filesystem does not need to be checked. <br />
<br />
*If you plan on using '''hal''' to automount media such as DVDs, you may wish to comment out the cdrom and dvd entries in preparation for '''hal''', which will be installed later in this guide.<br />
<br />
<br />
<br />
Expanded information available in the [[Fstab]] wiki entry.<br />
<br />
====='''[[Configuring mkinitcpio | /etc/mkinitcpio]].conf'''=====<br />
Editing this configuration is unnecessary at this point; this information is provided for explanation. <br />
<br />
This file allows you to fine-tune the initial ram filesystem (also commonly referred to as the initial ramdisk or "initrd") for your system. The initrd is a gzipped image that is read by the kernel during boot. The purpose of the initrd is to bootstrap the system to the point where it can access the root filesystem. This means it has to load any modules that are required for devices like IDE, SCSI, or SATA drives (or USB/FW, if you are booting off a USB/FW drive). Once the initrd loads the proper modules, either manually or through udev, it passes control to the Arch system and your boot continues. For this reason, the initrd only needs to contain the modules necessary to access the root filesystem. It does not need to contain every module you would ever want to use. The majority of your everyday modules will be loaded later on by udev, during the init process.<br />
<br />
'''mkinitcpio''' is the next generation of '''initramfs creation'''. It has many advantages over the old '''mkinitrd''' and '''mkinitramfs''' scripts.<br />
<br />
* It uses '''klibc''' and '''kinit''' which are developed by Linux kernel devs to provide a small and lightweight base for early userspace.<br />
* It can use '''udev''' for hardware autodetection at runtime, thus prevents you from having tons of unnecessary modules loaded.<br />
* Its hook-based init script is easily extendable with custom hooks, which can easily be included in pacman packages without having to modifiy mkinitcpio itself.<br />
* It already supports '''lvm2''', '''dm-crypt''' for both legacy and luks volumes, '''raid''', '''swsusp''' and '''suspend2''' resuming and booting from '''usb mass storage''' devices.<br />
* Many features can be configured from the kernel command line without having to rebuild the image.<br />
* The '''mkinitcpio''' script makes it possible to include the image in a kernel, thus making a self-contained kernel image is possible.<br />
* Its flexibility makes recompiling a kernel unnecessary in many cases. <br />
'''mkinitcpio''' was developed by Aaron Griffin and Tobias Powalowski with some help from the community.<br />
<br />
===== /etc/modprobe.conf=====<br />
It is unnecessary to configure this file at this time.<br />
<br />
* '''modprobe.conf''' can be used to set special configuration options for the kernel modules<br />
<br />
=====/etc/resolv.conf (for Static IP)=====<br />
The ''resolver'' is a set of routines in the C library that provide access to the Internet Domain Name System (DNS). One of the main functions of DNS is to translate domain names into IP addresses, to make the Web a friendlier place. The resolver configuration file, or /etc/resolv.conf, contains information that is read by the resolver routines the first time they are invoked by a process.<br />
<br />
*''If you are using DHCP, you may safely ignore this file, as by default, it will be dynamically created and destroyed by the dhcpcd daemon. You may change this default behavior if you wish. (See [http://wiki.archlinux.org/index.php/Network#For_DHCP_IP Network]]).''<br />
<br />
If you use a static IP, set your DNS servers in /etc/resolv.conf (nameserver <ip-address>). You may have as many as you wish.<br />
An example, using OpenDNS:<br />
nameserver 208.67.222.222<br />
nameserver 208.67.220.220<br />
<br />
If you are using a router, you will probably want to specify your DNS servers in the router itself, and merely point to it from your '''/etc/resolv.conf''', using your router's IP (which is also your gateway from '''/etc/rc.conf'''), e.g.:<br />
nameserver 192.168.1.1<br />
<br />
If using '''DHCP''', you may also specify your DNS servers in the router, or allow automatic assignment from your ISP, if your ISP is so equipped.<br />
<br />
=====/etc/hosts=====<br />
<br />
This file associates IP addresses with hostnames and aliases, one line per IP address. For each host a single line should be present with the following information:<br />
<IP-address> <hostname> [aliases...]<br />
Add your ''hostname'', coinciding with the one specified in /etc/rc.conf, as an alias, so that it looks like this:<br />
127.0.0.1 localhost.localdomain localhost '''''yourhostname'''''<br />
{{Box Note |''This format, '''including the 'localhost' and your actual host name''', is required for program compatibility! Errors in this entry may cause poor network performance and/or certain programs to open very slowly, or not work at all. This is a very common error for beginners.''}}<br />
<br />
If you use a static IP, add another line using the syntax: <static-IP> <hostname.domainname.org> <hostname> e.g.:<br />
192.168.1.100 '''''yourhostname'''''.domain.org '''''yourhostname'''''<br />
<br />
*<font color="blue">'''TIP''':</font> For convenience, you may also use /etc/hosts aliases for hosts on your network, and/or on the Web, e.g.:<br />
64.233.169.103 www.google.com g<br />
192.168.1.90 media<br />
192.168.1.88 data<br />
The above example would allow you to access google simply by typing 'g' into your browser, and access to a media and data server on your network by name and without the need for typing out their respective IP addresses.<br />
<br />
=====/etc/hosts.deny and /etc/hosts.allow=====<br />
Modify these configurations according to your needs if you plan on using the [[SSH|ssh]] daemon. The default configuration will reject all incoming connections, not only ssh connections. Edit your '''/etc/hosts.allow '''file and add the appropriate parameters: <br />
<br />
* let everyone connect to you<br />
sshd: ALL<br />
<br />
* restrict it to a certain ip<br />
sshd: 192.168.0.1<br />
<br />
* OR restrict for an IP range<br />
sshd: 10.0.0.0/255.255.255.0<br />
<br />
If you do not plan on using the [[SSH|ssh]] daemon, leave this file at the default, (empty), for added security.<br />
<br />
=====/etc/locale.gen=====<br />
<br />
The '''/usr/sbin/locale-gen''' command reads from '''/etc/locale.gen''' to generate specific locales. They can then be used by '''glibc''' and any other locale-aware program or library for rendering "peculiar" text, correctly displaying regional monetary values, time and date formats, alphabetic idiosyncrasies, and other locale-specific standards. The ability to setup a default locale is a great built-in privilege of using a <code>UNIX</code>-like operating system.<br />
<br />
By default /etc/locale.gen is an empty file with commented documentation. Once edited, the file remains untouched. '''locale-gen''' runs on every '''glibc''' upgrade, generating all the locales specified in /etc/locale.gen.<br />
<br />
Choose the locale(s) you need (remove the # in front of the lines you want), e.g.:<br />
en_US ISO-8859-1<br />
en_US.UTF-8 <br />
<br />
The installer will now run the locale-gen script, which will generate the locales you specified. You may change your locale in the future by editing /etc/locale.gen and subsequently running 'locale-gen' as root.<br />
<br />
{{Box Note |'''''If you fail to choose your locale, this will lead to a "The current locale is invalid..." error. This is perhaps the most common mistake by new Arch users, and also leads to the most commonly asked questions on the forum.'''''}}<br />
<br />
=====Root password=====<br />
Finally, set a root password and make sure that you remember it later. Return to the main menu and continue with installing bootloader.<br />
<br />
=====Pacman-Mirror=====<br />
Choose a mirror repository for '''pacman'''. <br />
*''archlinux.org is throttled, limiting downloads to 50KB/s'' <br />
<br />
Return to the main menu.<br />
<br />
===Install Bootloader===<br />
Because we have no secondary operating system in our example, we will need a bootloader. [http://www.gnu.org/software/grub/ GNU GRUB] is the recommended bootloader. Alternatively, you may choose [http://lilo.go.dyndns.org/ LILO]. <br />
====GRUB====<br />
The provided '''GRUB''' configuration ('''/boot/grub/menu.lst''') should be sufficient, but verify its contents to ensure accuracy. You may want to alter the resolution of the console by adding a vga=<number> kernel argument corresponding to your desired virtual console resolution. (A table of resolutions and the corresponding numbers is printed in the menu.lst.)<br />
<br />
Example: <br />
title Arch Linux (Main)<br />
root (hd0,0) <br />
kernel /boot/vmlinuz26 root=/dev/disk/by-uuid/0ec1-9339.. ro vga=773<br />
initrd /boot/kernel26.img<br />
{{Box Note | ''The linux kernel, 'vmlinuz', is so named because it incorporated '''v'''irtual '''m'''emory capability early in its development. The '''z''' denotes a zipped (compressed) image.''}}<br />
<br />
Explanation:<br />
<br />
Line 1: '''title''': A printed menu selection. "Arch Linux (Main)" will be printed on the screen as a menu selection.<br />
<br />
Line 2: '''root''': '''GRUB''''s root; the drive and partition where the kernel (/boot) resides, according to system BIOS. (More accurately, where GRUB's stage2 file resides). '''NOT necessarily the root''' (/) file system, as they can reside on separate partitions. GRUB's numbering scheme starts at 0, and uses an hd''x,x'' format regardless of IDE or SATA, and enclosed within parentheses. <br />
<br />
The example indicates that /boot is on the first partition of the first drive, according to BIOS, or, (hd0,0).<br />
<br />
Line 3: '''kernel''': This line specifies:<br />
<br />
* The path and filename of the kernel '''''relative to GRUB's root'''''.<br />
In the example, /boot is merely a directory residing on the same partition as / and '''vmlinuz26''' is the kernel filename; '''/boot/vmlinuz26'''. ''If /boot were on a separate partition, the path and filename would be simply '''/vmlinuz26''', being relative to '''GRUB''''s root.'' <br />
<br />
* The root= argument to the kernel statement specifies the partition containing the root (/) directory in the booted system, (more accurately, the partition containing '''/sbin/init'''), ''according to the UUID numbering scheme'' as of 2008-04rc, which uses the /dev/disk/by-uuid/xxxx-xxxx-xxxx format. <br />
<br />
*An easy way to distinguish the 2 appearances of 'root' in /boot/grub/menu.lst is to remember that the first root statement ''informs GRUB where the kernel resides'', whereas the second root= kernel argument ''tells the kernel where the root filesystem (/) resides''.<br />
<br />
* Kernel options. <br />
<br />
In our example, '''ro''' mounts the filesystem as read only during startup, and the '''"vga=773"''' argument will give a 1024x768 framebuffer with 256 color depth.<br />
<br />
Line 4: '''initrd''': (For Initial RAM disk) The path and filename of the initial RAM filesystem '''relative to GRUB''''s root. Again, in the example, /boot is merely a directory residing on the same partition as / and '''kernel26.img''' is the initrd filename; '''/boot/kernel26.img'''. ''If /boot were on a separate partition, the path and filename would be simply '''/kernel26.img''', being relative to '''GRUB''''s root.'' <br />
<br />
Install the '''GRUB''' bootloader to the master boot record, (sda in our example).<br />
<br />
===Reboot===<br />
<br />
That's it; You have configured and installed your Arch Linux base system. Exit the install, and reboot:<br />
<br />
# reboot<br />
(Be sure to remove the installer CD)<br />
<br />
Your new Arch Linux system will boot up and finish with a login prompt (you may want to change the boot order in your '''BIOS''' back to booting from hard disk).<br />
<br />
'''Congratulations, and welcome to your shiny, new Arch Linux base system!'''<br />
<br />
Your new Arch Linux base system is now a functional GNU/Linux environment ready for customization. From here, you may build this elegant set of tools into whatever you wish or require for your purposes. <br />
<br />
Login with the root account. We will configure pacman and update the system as root, then add a normal user. <br />
{{Box Note |Virtual consoles 1-6 are available.}}<br />
<br />
===Configuring the network (if necessary)===<br />
*''This section will assist you in configuring most types of networks, if your network configuration is not working for you.''<br />
<br />
If you properly configured your system, you should have a working network. Try to ping www.google.com to verify this.<br />
# ping -c 3 www.google.com<br />
<br />
''If you have successfully established a network connection, continue with '''[[#Update, Sync and Upgrade the system with pacman|Update, Sync and Upgrade the system with pacman]]'''.''<br />
<br />
If, after trying to ping www.google.com, you get an "unknown host" error, you may conclude that your network is not properly configured. You may choose to double-check the following files for integrity and proper settings:<br />
<br />
'''/etc/rc.conf''' # Specifically, check your HOSTNAME= and NETWORKING section for typos and errors.<br />
<br />
'''/etc/hosts''' # Double-check your format. (See above.)<br />
<br />
'''/etc/resolv.conf''' # If you are using a static IP. If you are using DHCP, this file will be dynamically created and destroyed by default, but can be changed to your preference. (See [[Network]].)<br />
<br />
Advanced instructions for configuring the network can be found in the [[Network]] article.<br />
<br />
====Wired LAN====<br />
<br />
Check your Ethernet with<br />
# ifconfig -a<br />
All interfaces will be listed. You should see an entry for eth0, or perhaps eth1. <br />
*'''Static IP'''<br />
<br />
If required, you can set a new static IP with:<br />
# ifconfig eth0 <ip address> netmask <netmask> up <br />
and the default gateway with<br />
# route add default gw <ip address of the gateway><br />
Verify that /etc/resolv.conf contains your DNS server and add it if it is missing. <br />
Check your network again with ping www.google.com. If everything is working now, adjust /etc/rc.conf as described above for static IP. <br />
*'''DHCP'''<br />
If you have a DHCP server/router in your network try:<br />
# dhcpcd eth0<br />
If this is working, adjust /etc/rc.conf as described above, for dynamic IP.<br />
<br />
====Wireless LAN====<br />
* Ensure the driver has created a usable interface:<br />
# iwconfig<br />
* Bring the interface up with <code>ifconfig <interface> up</code>. e.g.:<br />
# ifconfig ath0 up<br />
* (Optional) Scan for available access points:<br />
# iwlist ath0 scan | less<br />
* Specify the id of the wireless network with <code>iwconfig <interface> essid <youressid></code>. Or, if using WEP; <code>iwconfig <interface> essid <youressid> key <yourwepkey></code>, e.g.:<br />
# iwconfig ath0 essid linksys key 0241baf34c<br />
* Request an IP address with <code>dhcpcd <interface></code>. e.g.:<br />
# dhcpcd ath0<br />
* Ensure you can route:<br />
$ ping -c 3 www.google.com<br />
Done.<br />
<br />
Detailed setup guide: [[Wireless Setup]]<br />
<br />
====Analog Modem====<br />
To be able to use a Hayes-compatible, external, analog modem, you need to at least have the ppp package installed. Modify the file /etc/ppp/options to suit your needs and according to man pppd. You will need to define a chat script to supply your username and password to the ISP after the initial connection has been established. The manpages for pppd and chat have examples in them that should suffice to get a connection up and running if you're either experienced or stubborn enough. With udev, your serial ports usually are /dev/tts/0 and /dev/tts/1.<br />
Tip: Read [[Dialup without a dialer HOWTO]].<br />
<br />
Instead of fighting a glorious battle with the plain pppd, you may opt to install wvdial or a similar tool to ease the setup process considerably. In case you're using a so-called WinModem, which is basically a PCI plugin card working as an internal analog modem, you should indulge in the vast information found on the [http://www.linmodems.org/ LinModem] homepage.<br />
<br />
====ISDN====<br />
<br />
Setting up ISDN is done in three steps:<br />
# Install and configure hardware<br />
# Install and configure the ISDN utilities<br />
# Add settings for your ISP <br />
<br />
The current Arch stock kernels include the necessary ISDN modules, meaning that you will not need to recompile your kernel unless you're about to use rather odd ISDN hardware. After physically installing your ISDN card in your machine or plugging in your USB ISDN-Box, you can try loading the modules with modprobe. Nearly all passive ISDN PCI cards are handled by the hisax module, which needs two parameters: type and protocol. You must set protocol to '1' if your country uses the 1TR6 standard, '2' if it uses EuroISDN (EDSS1), '3' if you're hooked to a so-called leased-line without D-channel, and '4' for US NI1.<br />
<br />
Details on all those settings and how to set them is included in the kernel documentation, more specifically in the isdn subdirectory, and available online. The type parameter depends on your card; a list of all possible types can be found in the README.HiSax kernel documentation. Choose your card and load the module with the appropriate options like this:<br />
<br />
# modprobe hisax type=18 protocol=2<br />
<br />
This will load the hisax module for my ELSA Quickstep 1000PCI, being used in Germany with the EDSS1 protocol. You should find helpful debugging output in your /var/log/everything.log file, in which you should see your card being prepared for action. Please note that you will probably need to load some USB modules before you can work with an external USB ISDN Adapter.<br />
<br />
Once you have confirmed that your card works with certain settings, you can add the module options to your /etc/modprobe.conf:<br />
<br />
alias ippp0 hisax<br />
options hisax type=18 protocol=2<br />
<br />
Alternatively, you can add only the options line here, and add hisax to your MODULES array in the rc.conf. It's your choice, really, but this example has the advantage that the module will not be loaded until it's really needed.<br />
<br />
That being done, you should have working, supported hardware. Now you need the basic utilities to actually use it!<br />
<br />
Install the isdn4k-utils package, and read the manpage to isdnctrl; it'll get you started. Further down in the manpage you will find explanations on how to create a configuration file that can be parsed by isdnctrl, as well as some helpful setup examples. Please note that you have to add your SPID to your MSN setting separated by a colon if you use US NI1.<br />
<br />
After you have configured your ISDN card with the isdnctrl utility, you should be able to dial into the machine you specified with the PHONE_OUT parameter, but fail the username and password authentication. To make this work add your username and password to /etc/ppp/pap-secrets or /etc/ppp/chap-secrets as if you were configuring a normal analogous PPP link, depending on which protocol your ISP uses for authentication. If in doubt, put your data into both files.<br />
<br />
If you set up everything correctly, you should now be able to establish a dial-up connection with<br />
# isdnctrl dial ippp0<br />
as root. If you have any problems, remember to check the logfiles!<br />
<br />
====DSL (PPPoE)====<br />
<br />
These instructions are relevant to you only if your PC itself is supposed to manage the connection to your ISP. You do not need to do anything but define a correct default gateway if you are using a separate router of some sort to do the grunt work.<br />
<br />
Before you can use your DSL online connection, you will have to physically install the network card that is supposed to be connected to the DSL-Modem into your computer. After adding your newly installed network card to the modules.conf/modprobe.conf or the MODULES array, you should install the rp-pppoe package and run the pppoe-setup script to configure your connection. After you have entered all the data, you can connect and disconnect your line with<br />
<br />
# /etc/rc.d/adsl start<br />
<br />
and<br />
<br />
# /etc/rc.d/adsl stop<br />
<br />
respectively. The setup usually is rather easy and straightforward, but feel free to read the manpages for hints. If you want to automatically 'dial in' on boot-up, add adsl to your DAEMONS array.<br />
<br />
===Update, Sync and Upgrade the system with [[pacman]]===<br />
Now we will update the system using [[pacman]]. <br />
<br />
====What is pacman ?====<br />
[[Pacman]] is the '''pac'''kage '''man'''ager of Arch Linux. Pacman is written in ''C'' and is designed from the ground up to be lightweight with a very modest memory footprint, fast, simple, and versatile. It manages your entire package system and handles installation, removal, package downgrade (through cache), custom compiled package handling, automatic dependency resolution, remote and local searches and much more. Arch uses the .tar.gz package format, which further enhances pacman's speed; Gzipped tarballs, though slightly larger, are decompressed many times faster than their Bzipped counterparts, and are therefore installed much more expediently. <br />
<br />
We will use pacman to download software packages from remote repositories and install them onto your system.<br />
<br />
Pacman is the most important tool in your Arch Linux toolbox for building the base system into whatsoever you please.<br />
<br />
====Configuring pacman====<br />
<br />
=====Package Repositories and /etc/pacman.conf=====<br />
Arch currently offers the following 4 repositories readily accessible through pacman:<br />
<br />
'''[core]'''<br />
<br />
The simple principle behind [core] is to provide only one of each necessary tool for a base Arch Linux system; The GNU toolchain, the Linux kernel, one editor, one command line browser, etc. (There are a few exceptions to this. For instance, both vi and nano are provided, allowing the user to choose one or both.) It contains all the packages that MUST be in perfect working order to make sure your system continues to run. These are the absolute system-critical packages. Developer maintained.<br />
<br />
*''The Core installation media simply contains an installer script, and a snapshot of the core repository at the time of release.''<br />
<br />
'''[extra]'''<br />
<br />
The [extra] repository contains all Arch packages that are not themselves necessary for a base Arch system, but contribute to a more full-featured environment. '''X''', KDE, and Apache, for instance, can be found here. Developer maintained.<br />
<br />
'''[testing]'''<br />
<br />
The [testing] repository contains packages that are candidates for the [core] or [extra] repositories. New packages go into [testing] if:<br />
* they are expected to break something on update and need to be tested first<br />
* they require other packages to be rebuilt. In this case, all packages that need to be rebuilt are put into [testing] first and when all rebuilds are done, they are moved back to the other repositories. Developer maintained.<br />
<br />
[testing] is the only repository that can have name collisions with any of the other official repositories. <br />
<br />
<font color="blue">*If enabled, [testing] must be the first repo listed in your ''pacman.conf'' file.</font><br />
<br />
<font color="red">'''WARNING''': '''''Your system may break after you update with [testing] enabled. Only experienced users should use it.'''''</font><br />
<br />
'''[community]'''<br />
<br />
The [community] repository is maintained by the ''Trusted Users (TUs)'' and is part of the ''Arch User Repository ([[AUR]])''. It contains binary packages from the ''AUR'' that have enough votes and were adopted by a ''TU''. Like all repos listed above, [community] may be readily accessed by pacman.<br />
<br />
The '''[[AUR]]''' also contains the '''unsupported''' branch, which cannot be accessed directly by pacman*. [unsupported] contains more than eight thousand PKGBUILD scripts for building packages from source, that may be unavailable through the other repos. <br />
<br />
<nowiki>*</nowiki> '''''[[AUR Helpers]]''''' can help you seamlessly access AUR.<br />
<br />
'''/etc/pacman.conf'''<br />
<br />
pacman will attempt to read /etc/pacman.conf each time it is invoked. This configuration file is divided into sections, or repositories. Each section defines a package [[Official Repositories|repository]] that pacman can use when searching for packages. The exception to this is the options section, which defines global options.<br />
# nano /etc/pacman.conf<br />
Example:<br />
#<br />
# /etc/pacman.conf<br />
#<br />
# See the pacman.conf(5) manpage for option and repository directives<br />
<br />
#<br />
# GENERAL OPTIONS<br />
#<br />
[options]<br />
# The following paths are commented out with their default values listed.<br />
# If you wish to use different paths, uncomment and update the paths.<br />
#RootDir = /<br />
#DBPath = /var/lib/pacman/<br />
#CacheDir = /var/cache/pacman/pkg/<br />
#LogFile = /var/log/pacman.log<br />
HoldPkg = pacman glibc<br />
# If upgrades are available for these packages they will be asked for first<br />
SyncFirst = pacman<br />
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u<br />
#XferCommand = /usr/bin/curl %u > %o<br />
<br />
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup<br />
#IgnorePkg =<br />
#IgnoreGroup =<br />
<br />
#NoUpgrade =<br />
#NoExtract =<br />
<br />
# Misc options (all disabled by default)<br />
#NoPassiveFtp<br />
#UseSyslog<br />
#ShowSize<br />
#UseDelta<br />
#TotalDownload<br />
ILoveCandy<br />
#<br />
# REPOSITORIES<br />
# - can be defined here or included from another file<br />
# - pacman will search repositories in the order defined here<br />
# - local/custom mirrors can be added here or in separate files<br />
# - repositories listed first will take precedence when packages<br />
# have identical names, regardless of version number<br />
# - URLs will have $repo replaced by the name of the current repo<br />
#<br />
# Repository entries are of the format:<br />
# [repo-name]<br />
# Server = ServerName<br />
# Include = IncludePath<br />
#<br />
# The header [repo-name] is crucial - it must be present and<br />
# uncommented to enable the repo.<br />
# <br />
<br />
# Testing is disabled by default. To enable, uncomment the following<br />
# two lines. You can add preferred servers immediately after the header,<br />
# and they will be used before the default mirrors.<br />
#[testing]<br />
#Include = /etc/pacman.d/mirrorlist<br />
<br />
[core]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
[extra]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist <br />
<br />
[community]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
# An example of a custom package repository. See the pacman manpage for<br />
# tips on creating your own repositories.<br />
#[custom]<br />
#Server = file:///home/custompkgs<br />
<br />
Enable all desired repositories (remove the # in front of the 'Include =' and '[repository]' lines).<br />
<br />
<br />
*'''''When choosing repos, be sure to uncomment both the repository header lines in [brackets] as well as the 'Include =' lines. Failure to do so will result in the selected repository being omitted! This is a very common error.'' '''<br />
<br />
=====/etc/pacman.d/mirrorlist=====<br />
Faster mirrors will dramatically improve pacman performance, and your overall Arch Linux experience.<br />
<br />
Edit /etc/pacman.d/mirrorlist:<br />
# nano /etc/pacman.d/mirrorlist<br />
Remove all mirrors which are not on your continent, or are extremely distant. (Using nano, you may use CTRL-K to cut each unneeded line.) <br />
<br />
Edit /etc/pacman.d/mirrorlist by placing the best mirror at the top of the list. (Recall that archlinux.org is throttled to 50KB/s). If using nano, you can cut a line with CTRL-K and paste with CTRL-U. <br />
<br />
After changing mirrors, issue the following command:<br />
# pacman -Syy<br />
Passing two --refresh or -y flags forces a refresh of all package lists even if they are considered by pacman to be up to date. Issuing pacman -Syy ''whenever a mirror is changed'', is good practice and will avoid possible headaches.<br />
<br />
=====Ignoring packages=====<br />
When you execute the command "pacman -Syu", your entire system will be updated. It is possible that you want to prevent a package from being upgraded. An example could be the kernel (kernel26) or a package for which an upgrade may prove problematic for your system. In this case, you have two options; indicate the packages you want to skip in the pacman command line using the --ignore switch (do pacman -S --help for details) or permanently indicate the packages you want to skip in your /etc/pacman.conf file:<br />
<br />
IgnorePkg = kernel26<br />
The typical way to use Arch is to use pacman to install all packages unless there is no package available, in which case you can build your own package using [[ABS]]. Many user-contributed package build scripts are also available in the [[AUR]]. <br />
<br />
You are expected to keep your system up to date with pacman -Syu, rather than selectively upgrading packages. You may diverge from this typical usage as you wish; just be warned that there is a greater chance that things will not work as intended and that it could break your system. The majority of complaints happen when selective upgrading, unusual compilation or improper software installation is performed. Use of '''IgnorePkg''' in /etc/pacman.conf is therefore discouraged, and should only be used sparingly, if you know what you are doing.<br />
<br />
=====Ignoring Configuration Files=====<br />
In the same vein, you can also "protect" your configuration/system files from being overwritten during "pacman -Su" using the following option in your /etc/pacman.conf<br />
<br />
NoUpgrade = etc/lilo.conf boot/grub/menu.lst<br />
<br />
===Update System===<br />
You are now ready to upgrade your entire system. Before you do, read through the [http://www.archlinux.org/news/ news] (and optionally the [http://archlinux.org/pipermail/arch-announce/ announce mailing list]). Often the developers will provide important information about fixes for known issues. Consulting these pages before any upgrade is good practice. <br />
<br />
Sync, refresh, and upgrade your entire new system with:<br />
# pacman -Syu<br />
you may also use:<br />
# pacman --sync --refresh --sysupgrade<br />
<br />
pacman will now download a fresh copy of the master package list from the server(s) defined in pacman.conf(5) and perform all available upgrades. (You may be prompted to upgrade pacman itself at this point. If so, say yes, and then reissue the pacman -Syu command when finished.) <br />
<br />
Reboot if a kernel upgrade has occurred. <br />
<br />
{{Box Note|Occasionally, configuration changes may take place requiring user action during an update; read pacman's output for any pertinent information.}}<br />
<br />
If the messages go by too fast to read, you can look at them later at /var/log/pacman.log.<br />
<br />
See [[Package_Management_FAQs|Package Management FAQs]] for answers to frequently asked questions regarding updating and managing your packages.<br />
<br />
====The beauty of the Arch rolling release model====<br />
Keep in mind that Arch is a '''rolling release''' distribution. This means there is never a reason to reinstall or perform elaborate system rebuilds to upgrade to the newest version. Simply issuing '''pacman -Syu''' periodically keeps your entire system up-to-date and on the bleeding edge. At the end of this upgrade, your system is completely current. '''Reboot''' if a kernel upgrade has occurred.<br />
<br />
====Get familiar with pacman====<br />
pacman is the Arch user's best friend. It is highly recommended to study and learn how to use the pacman(8) tool. Try:<br />
man pacman<br />
<br />
Check out the bottom of this article, and look up the [[pacman]] wiki entries at your leisure.<br />
<br />
===Add a user and setup groups===<br />
<code>UNIX</code> is a multi-user environment. You should not do your everyday work using the root account. It is more than poor practice; it is dangerous. Root is for administrative tasks. Instead, add a normal, non-root user account using the <code>/usr/sbin/useradd</code> program:<br />
# useradd -m -G [groups] -s [login_shell] [username] <br />
* '''-m''' Creates user home directory as /home/'''username'''. Within their home directory, a user can write files, delete them, install programs, etc. Users' home directories shall contain their data and personal configuration files, the so-called 'dot files' (their name is preceded by a dot), which are 'hidden'. (To view dotfiles, enable the appropriate option in your file manager or run ls with the -a switch.) If there is a conflict between ''user'' (under /home/username) and ''global'' configuration files, (usually under /etc/) the settings in the ''user'' file will prevail. Dotfiles likely to be altered by the end user include .xinitrc and .bashrc files. The configuration files for xinit and Bash respectively. They allow the user the ability to change the window manager to be started upon login and also aliases, user-specified commands and environment variables respectively. When a user is created, their dotfiles shall be taken from the /etc/skel directory where system sample files reside.<br />
* '''-G''' A list of supplementary groups which the user is also a member of. ''Each group is separated from the next by a comma, with no intervening spaces''. The default is for the user to belong only to the initial group (users). <br />
* '''-s''' The name of the user´s login shell. Leaving this field blank will cause the system to select the default login shell.<br />
Useful groups for your non-root user include:<br />
*'''audio''' - for tasks involving sound card and related software<br />
*'''floppy''' - for access to a floppy if applicable<br />
*'''lp''' - for managing printing tasks<br />
*'''optical''' - for managing tasks pertaining to the optical drive(s)<br />
*'''storage''' - for managing storage devices<br />
*'''video''' - for video tasks and 3d acceleration<br />
*'''wheel''' - for using sudo/su<br />
*'''power''' - used w/ power options (ie. shutdown w/ off button) <br />
A typical example, adding a user named "archie" specifying bash as the login shell:<br />
# useradd -m -G users,audio,lp,optical,storage,video,wheel,power -s /bin/bash archie<br />
Next, add a password for your new user using <code>/usr/bin/passwd</code>.<br />
<br />
An example for our user, 'archie':<br />
# passwd archie<br />
(You will be prompted to provide the new <code>UNIX</code> password.)<br />
<br />
Your new non-root user has now been created, complete with a home directory and a login password.<br />
<br />
'''Alternative method, using <code>/usr/sbin/adduser</code>:'''<br />
<br />
Alternatively, you may use <code>adduser</code>, an interactive user adding program which will prompt you for the above data:<br />
# adduser<br />
<br />
See the [[Groups]] article and check the man pages for <code>usermod(8)</code> and <code>gpasswd(8)</code> for further information.<br />
<br />
In the event of error, or if you wish to delete this user account in favor of a different name or for any other reason, use <code>/usr/sbin/userdel</code>:<br />
# userdel -r [username]<br />
* '''-r ''' Files in the user´s home directory will be removed along with the home directory itself and the user´s mail spool.<br />
<br />
===Install and setup Sudo (Optional)===<br />
To install Sudo:<br />
# pacman -S sudo<br />
To add a user as a sudo user (a "sudoer"), the visudo command must be run as root. If you do not know how to use vi, you may set the EDITOR environment variable to the editor of your choice before running visudo. e.g.:<br />
# EDITOR=nano visudo<br />
If you are comfortable using vi, issue the visudo command without the EDITOR=nano variable:<br />
# visudo<br />
This will open the file /etc/sudoers in a special session of vi. visudo copies the file to be edited to a temporary file, edits it with an editor, (vi by default), and subsequently runs a sanity check. If it passes, the temporary file overwrites the original with the correct permissions. <br />
<br />
<font color="red">'''WARNING: Do not edit /etc/sudoers directly with an editor; Errors in syntax can cause annoyances (like rendering the root account unusable). You must use the ''visudo'' command to edit /etc/sudoers.'''</font><br />
<br />
To give the user full root privileges when he/she precedes a command with "sudo", add the following line:<br />
USER_NAME ALL=(ALL) ALL<br />
where USER_NAME is the username of the individual.<br />
<br />
For more information, such as sudoer <TAB> completion, see [[Sudo]]<br />
<br />
==Part II: Install X and configure ALSA==<br />
<br />
<br />
===Configure the audio card with alsamixer===<br />
The Advanced Linux Sound Architecture (known by the acronym '''ALSA''') is a Linux kernel component intended to replace the original Open Sound System (OSS) for providing device drivers for sound cards. Besides the sound device drivers, '''ALSA''' also bundles a user space library for application developers who want to use driver features with a higher level API than direct interaction with the kernel drivers. <br />
-----<br />
{{Box Note| Alsa is included in the Arch mainline kernel and udev will automatically probe your hardware on boot-up, loading the corresponding kernel module for your audio card. Therefore, your sound should already be working, but is muted by default.}}{{Box Note| OSS4.1 has been released under a free license and is generally considered a significant improvement over older OSS versions. If you have issues with ALSA, or simply wish to explore another option, you may choose OSS4.1 instead. Instructions can be found in [[OSS]]}} <br />
<br />
The alsa-utils package contains the alsamixer userspace tool, which will allow us to configure the sound device from the console. (You may also run alsamixer from an '''X''' environment later.)<br />
<br />
Install the alsa-utils package:<br />
# pacman -S alsa-utils<br />
Did you add your normal user to the audio group? If not, use <code>/usr/bin/gpasswd</code>. As root do:<br />
# gpasswd -a ''yourusername'' audio<br />
As '''''normal, non-root''''' user, invoke <code>/usr/bin/alsamixer</code>:<br />
# su - ''yourusername'' <br />
'''$''' alsamixer<br />
Unmute the Master and PCM channels by scrolling to them with cursor left/right and pressing '''M'''. Increase the volume levels with the cursor-up key. (70-90 Should be a safe range.) Some machines, (like the Thinkpad T61), have a '''Speaker''' channel which must be unmuted and adjusted as well. Leave alsamixer by pressing ESC. <br />
==== Sound Test ====<br />
Ensure your speakers are properly connected, and test your sound configuration as normal user using <code>/usr/bin/aplay</code>:<br />
$ aplay /usr/share/sounds/alsa/Front_Center.wav<br />
You should hear a very eloquent woman say, "Front, center."<br />
<br />
Then run <code>/usr/bin/alsactl</code> as root:<br />
$ su -<br />
# alsactl store<br />
This will create '/etc/asound.state', saving the alsamixer settings. <br />
<br />
Also, add the alsa ''daemon'' to your DAEMONS section in /etc/rc.conf to automatically restore the mixer settings on boot-up.<br />
# nano /etc/rc.conf<br />
DAEMONS=(syslog-ng network crond '''alsa''')<br />
''Note that the alsa daemon merely restores your volume mixer levels on boot up by reading /etc/asound.state. It is separate from the alsa audio library (and kernel level API).''<br />
<br />
Expanded information available in the [[ALSA]] wiki entry.<br />
<br />
===Installing and configuring X===<br />
The '''X''' Window System (commonly '''X11''', or just simply '''X''') is a networking and display protocol which provides windowing on bitmap displays. It provides the standard toolkit and protocol to build graphical user interfaces (GUIs) on <code>UNIX</code>-like operating systems.<br />
<br />
'''X''' provides the basic framework, or primitives, for building GUI environments: drawing and moving windows on the screen and interacting with a mouse and/or keyboard. '''X''' does not mandate the user interface — individual client programs handle this. <br />
<br />
'''X''' is so named because it was preceded by the '''W''' Window System, originally developed at Stanford University. <br />
-----<br />
<br />
{{Box Note| If you plan on using an '''open-source''' video driver, and need 3d acceleration, it is recommended to install the libgl library before installing Xorg:}}<br />
# pacman -S libgl<br />
''(Proprietary video drivers provide their own gl library implementations.)''<br />
----- <br />
Now we will install the base Xorg packages using pacman. This is the first step in building a GUI.<br />
<br />
# pacman -S xorg<br />
With newer versions of xorg, it is suggested (and possibly necessary in most cases) to install the input driver evdev, which should be installed as a dependency for xorg-server, but many seem to be lacking somehow:<br />
# pacman -S xf86-input-evdev<br />
3d utilities such as glxgears are included in the '''mesa''' package:<br />
# pacman -S mesa<br />
<br />
Now we have the base packages we need for running the '''X''' Server. You should add the driver for your graphics card now (e.g. xf86-video-<name>). The easiest way to configure X.org is by installing the correct driver packages first, and then generating /etc/X11/xorg.conf using an autoconfiguration script, like Xorg -configure.<br />
<br />
You will need knowledge of which video chipset your machine has. If you do not know, use the <code>/usr/sbin/lspci</code> program:<br />
# lspci | grep VGA<br />
<br />
If you need a list of all '''open-source''' video drivers, do: <br />
# pacman -Ss xf86-video | less<br />
Here is a list of '''open source''' drivers, and the corresponding video chipsets.<br />
*'''xf86-video-apm''' Alliance ProMotion video driver<br />
*'''xf86-video-ark''' ark video driver<br />
*'''xf86-video-ati''' ATI(AMD) video driver<br />
*'''xf86-video-chips''' Chips and Technologies video driver<br />
*'''xf86-video-cirrus''' Cirrus Logic video driver<br />
*'''xf86-video-dummy''' dummy video driver<br />
*'''xf86-video-fbdev''' framebuffer video driver<br />
*'''xf86-video-glint''' GLINT/Permedia video driver<br />
*'''xf86-video-i128''' Number 0 i128 video driver<br />
*'''xf86-video-i740''' Intel i740 video driver<br />
*'''xf86-video-i810''' Intel i810/i830/i9xx video drivers (deprecated - use -intel)<br />
*'''xf86-video-intel''' Newer Version of Intel i810/i830/i9xx video drivers<br />
*'''xf86-video-imstt''' Integrated Micro Solutions Twin Turbo vidoe driver<br />
*'''xf86-video-mga''' mga video driver (Matrox Graphics Adapter)<br />
*'''xf86-video-neomagic''' neomagic video driver<br />
*'''xf86-video-nv''' Nvidia nv video driver<br />
*'''xf86-video-rendition''' Rendition video driver<br />
*'''xf86-video-s3''' S3 video driver<br />
*'''xf86-video-s3virge''' S3 Virge video driver<br />
*'''xf86-video-savage''' savage video driver<br />
*'''xf86-video-siliconmotion''' siliconmotion video driver<br />
*'''xf86-video-sis''' SiS video driver<br />
*'''xf86-video-sisusb''' SiS USB video driver<br />
*'''xf86-video-tdfx''' tdfx video driver<br />
*'''xf86-video-trident''' Trident video driver<br />
*'''xf86-video-tseng''' tseng video driver<br />
*'''xf86-video-unichrome''' VIA S3 Unichrome video drivers<br />
*'''xf86-video-v4l''' v4l video driver<br />
*'''xf86-video-vesa''' vesa video driver<br />
*'''xf86-video-openchrome (testing)''' via video driver (currently in testing, try openchrome in the meantime)<br />
*'''xf86-video-vga''' VGA 16 color video driver<br />
*'''xf86-video-vmware ''' vmware video driver<br />
*'''xf86-video-voodoo ''' voodoo video driver<br />
<br />
* Note that the '''vesa''' driver is the most generic, and should work with almost any modern video chipset. If you cannot find a suitable driver for your video chipset, vesa '''should''' work.<br />
<br />
*If you have an NVIDIA or ATI video adapter, you may wish to install the proprietary NVIDIA or ATI drivers. '''Installing proprietary video drivers is covered [[#Using proprietary Graphics Driver (NVIDIA, ATI)|below]].'''<br />
<br />
Use pacman to install the appropriate video driver for your video card/onboard video. e.g.:<br />
# pacman -S xf86-video-savage<br />
(for the Savage driver.)<br />
<br />
===Create /etc/X11/xorg.conf===<br />
=====What is /etc/X11/xorg.conf?=====<br />
/etc/X11/xorg.conf is the main configuration file for your '''X''' Window System, the foundation of your '''G'''raphical '''U'''ser '''I'''nterface. It is a plain text file ordered into sections and subsections. Important sections are ''Files, InputDevice, Module, Monitor, Modes, Screen, Device, and ServerLayout''. Sections can appear in any order and there may be more than one section of each kind, for example, if you have more than one monitor, or if your laptop has a trackpoint as well as a mouse. <br />
------<br />
By default, you will not have an Xorg config file, as the newest versions of Xorg feature autodetection. ''If'' the autodetection ''works satisfactorily'' and you do not need to specify special features such as aiglx, compositing and so forth, you may forgo creating an xorg.conf file. <br />
<br />
''Most people will still find that they need to generate a config file, however.''<br />
<br />
Advanced users may wish to manually create their own xorg.conf file. You may also use the <code>/usr/bin/Xorg</code> program with the -configure option to generate a basic config file; As root, do:<br />
# Xorg -configure<br />
This will create a config file at /root/xorg.conf.new <br />
<br />
<br />
:'''Before testing the server '''<br />
<br />
:Input hotplugging is enabled in the 1.5.x series of the xorg-server package, which is now included in the extra repo.<br />
:When input hotplugging is enabled, X will purge any devices setup in xorg.conf that are using the kbd and mouse driver. This may result in X appearing to freeze and result in your not being able to move your mouse or use your keyboard.<br />
<br />
:There are two options to correct this:<br />
::1) Configure input hotplugging by installing the xf86-input-evdev driver and configuring HAL to use the kbd/mouse drivers. Add the hal daemon to the DAEMONS array in /etc/rc.conf before anything related to X.Org is started. See [[Xorg_input_hotplugging]] for full details.<br />
<br />
::2) Disable input hotplugging by adding ''Option "AutoAddDevices" "False"'' to ServerFlags in /etc/X11/xorg.conf. This will skip devices detected by hal and will use your keyboard/mouse configuration from xorg.conf<br />
# nano /root/xorg.conf.new<br />
::and add the following<br />
Section "ServerFlags"<br />
Option "AutoAddDevices" "False"<br />
EndSection<br />
<br />
<br />
<br />
To test the server, run:<br />
# X -config /root/xorg.conf.new<br />
'''X''' should start with the white hollow vector '''X''' in the center of the screen, which should respond to mouse, trackpoint or touchpad movement. Use CTRL-Alt-Backspace to exit '''X'''.<br />
<br />
<br />
Inspect your config file in case of errors:<br />
<br />
# nano /root/xorg.conf.new<br />
<br />
Ensure the Xorg -configure script has correctly specified your video driver. e.g.:<br />
Section "Device"<br />
<br />
...<br />
<br />
Driver "savage"<br />
<br />
...<br />
<br />
EndSection<br />
<br />
Ensure there are horizontal sync and vertical refresh specs under section "Monitor". If not, add them:<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
VendorName "Monitor Vendor"<br />
ModelName "Monitor Model"<br />
HorizSync 30.0 - 130.0 # Safe for LCD's<br />
VertRefresh 50.0 - 100.0 # Safe for LCD's and most CRT's.<br />
EndSection<br />
(If you do not know these specs, consult your monitor's documentation.)<br />
<br />
Specify your default color depth under section "Screen":<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Card0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
(Typically, this will be set to 24 for true color.)<br />
<br />
Also add your desired Modes to your "Display" subsection, at least under the Depth 24 header, e.g.:<br />
SubSection "Display"<br />
Viewport 0 0<br />
Depth 24<br />
Modes "1024x768" "800x600" "640x480"<br />
Add the following section, if you wish to enable eye candy which requires the composite extension: <br />
Section "Extensions"<br />
Option "Composite" "Enable"<br />
EndSection<br />
Try your config again, after modifying:<br />
# X -config /root/xorg.conf.new<br />
Ensure an '''X''' session opens, without errors, and copy or move the generated config file to /etc/X11/:<br />
# cp /root/xorg.conf.new /etc/X11/xorg.conf<br />
Detailed instructions in the [[Xorg]] article.<br />
<br />
====Alternative xorg.conf generation====<br />
* Note that if your machine has a successfully configured xorg.conf under another distribution and with the same Xorg version, you may easily copy it over to your current Arch system.<br />
* If Xorg -configure is not generating a usable xorg.conf, you may alternatively use the <code>/usr/bin/hwd</code> tool. Install with:<br />
# pacman -S hwd<br />
And run with<br />
# hwd -xa<br />
{{Box Note| At the time of this writing, hwd generates a xorg.conf with an invalid line for newer xorg packages. After using it, you need to remove or comment out the RgbPath line under Section "Files" via nano /etc/X11/xorg.conf or your equivalent, as root/sudo.}}<br />
<br />
* You may also try the <code>/usr/bin/xorgcfg</code> script:<br />
# xorgcfg <br />
* Lastly, you may choose <code>/usr/bin/xorgconfig</code>, which will interactively prompt you for hardware information to create a basic xorg.conf:<br />
# xorgconfig<br />
Continue with '''[[#Simple baseline X test|Simple baseline X test]]'''<br />
<br />
===Using proprietary Graphics Driver (NVIDIA, ATI)===<br />
You may choose to use the proprietary video drivers from NVIDIA or ATI. <br />
====NVIDIA Graphic Cards====<br />
The NVIDIA proprietary drivers are generally considered to be of good quality, and offer 3D performance, whereas the open source '''nv''' driver offers only 2d support at this time. <br />
<br />
Before you configure your Graphics Card you will need to know which driver fits. Arch currently has several different driver packages that each match a certain subset of Cards: <br />
<br />
{{Box Note| Nvidia-71xx series proprietary drivers, which are required by extremely old cards like TNT and TNT2, have been removed because they do not work with the new Xorg that Arch makes use of, and nvidia has discontinued support for such. You should use the xf86-video-nv or xf86-video-vesa drivers instead or upgrade your card if you need 71xx.}}<br />
{{Box Note| Many suffer the same failure with 96xx as the above noted 71xx problem with the new xorg.}}<br />
<br />
'''1. nvidia-96xx''' ''slightly newer cards up to the GF 4.''<br />
<br />
'''2. nvidia-173xx''' ''Geforce FX series cards''<br />
<br />
'''3. nvidia''' ''newest GPUs after the GF FX''<br />
<br />
<br />
Consult the NVIDIA-Homepage to see which one is for you. The difference is only for the installation; Configuration works the same with every driver.<br />
<br />
Select and install the appropriate NVIDIA driver ''for your card'', e.g.: <br />
# pacman -S nvidia-96xx<br />
<br />
The NVIDIA package has a utility for updating your existing /etc/X11/xorg.conf for use with the NVIDIA driver:<br />
# nvidia-xconfig<br />
<br />
It also has several options which will further specify the contents and options of the xorg.conf file.<br />
For example,<br />
# nvidia-xconfig --composite --add-argb-glx-visuals<br />
<br />
For more detailed information, see nvidia-xconfig(1).<br />
<br />
Some useful tweaking options in the device section are (beware that these may not work on your system):<br />
Option "RenderAccel" "true"<br />
Option "NoLogo" "true"<br />
# I can't see those 2 following options in recent nvidia driver README.<br />
# what are there for ? What do they do ? Do they still work ? Are they usefull ?<br />
Option "AGPFastWrite" "true"<br />
Option "EnablePageFlip" "true"<br />
Make sure all instances of DRI are commented out:<br />
# Load "dri"<br />
Double check your /etc/X11/xorg.conf to make sure your default depth, horizontal sync, vertical refresh, and resolutions are acceptable.<br />
<br />
Update kernel module dependencies using <code>/sbin/depmod</code>:<br />
# depmod -a<br />
(A reboot may be necessary.)<br />
Advanced instructions for nvidia configuration can be found in the [[NVIDIA]] article.<br />
<br />
Continue with '''[[#Simple baseline X test|Simple baseline X test]]'''<br />
<br />
====ATI Graphic Cards====<br />
ATI owners have two options for drivers. If you are unsure which driver to use, please try the open-source one first. The open-source driver will suit most needs along with being generally less problematic.<br />
<br />
Install the '''proprietary''' ATI Driver with<br />
# pacman -S catalyst<br />
Use the aticonfig tool to modify the xorg.conf.<br />
<br />
Install the '''open-source''' ATI Driver with<br />
# pacman -S xf86-video-ati<br />
Currently, the performance of the open-source driver is not on par with that of the proprietary one. It also lacks TV-out, dual-link DVI support, and possibly other features. On the other hand, it supports Aiglx and has better dual-head support.<br />
{{Box Note| The latest proprietary driver does support [[AIGLX]] now. To use [[Compiz]] or [[Beryl]] add Option "AIGLX" "True" to Section ServerFlags and Option "Composite" "True" to Section Extensions.}}<br />
Advanced instructions for ATI configuration can be found in the [[ATI | ATI wiki]].<br />
<br />
===Simple baseline X test===<br />
<br />
At this point, you should have xorg installed, with a suitable video driver and an /etc/X11/xorg.conf configuration file. If you want to test your configuration quickly, to ensure your ability to successfully start '''X''' from the command line before installing a complete desktop environment, you can do so by invoking '''xterm'''. Xterm is a very simple terminal emulator which runs in the '''X '''Server environment; it is installed as part of the base xorg packages. More advanced users who are comfortable with '''X''' configuration may choose to skip this optional step.<br />
<br />
Prepare for the test by configuring a ~/.xinitrc:<br />
<br />
===== ~/[[.xinitrc]] =====<br />
One of the main functions of this file is to dictate what '''X''' Window client is invoked with the '''/usr/bin/startx''' and/or '''/usr/bin/xinit''' program ''on a per-user basis''. (The '''startx''' script is merely a front end to the more versatile '''xinit''' command.) There are vast amounts of additional configurable specifications and commands that may also be added to ~/[[.xinitrc]] as you further customize your system. <br />
{{Box Note | '''[[.xinitrc]]''' is a so-called 'dot' (.) file. Files in a UNIX filesystem which are preceded with a dot (.) are 'hidden', and will not show up with a regular 'ls' command, usually for the sake of keeping directories tidy. Dot files may be seen by issuing '''ls -a'''. The 'rc' denotes ''Run Commands'' and simply indicates that it is a configuration file. Since it controls how a program runs, it is (although historically incorrect) also said to stand for "Run Control".}}<br />
<br />
'''startx/xinit''' will start the '''X''' server and clients. To determine the client to run, '''startx/xinit''' will first look to parse a [[.xinitrc]] file in the user's home directory. In the absence of file ~/[[.xinitrc]], it defaults to the global xinitrc in the xinit library directory; /etc/X11/xinit/xinitrc, which defaults to using the TWM window manager. (Hence, if you invoke startx without a ~/[[.xinitrc]] file, a TWM session will start.) Further details in the [[.xinitrc]] wiki entry.<br />
<br />
Switch to your '''''normal, non-root''''' user:<br />
# su - ''yourusername''<br />
* /etc/skel/ contains files and directories to provide sane defaults for newly created user accounts. The name '''skel''' is derived from the word '''skeleton''', because the files it contains form the basic structure for users' home directories.<br />
* If you installed from a fresh (Core) install, it does not include the X window manager, so .xinitrc does not exist in /etc/skel. Instead, use the sample provided [[Xinitrc#A_standard_.xinitrc | here]].<br />
Copy the sample xinitrc file from /etc/skel/ to your home directory: <br />
<br />
$ cp /etc/skel/[[.xinitrc]] ~/<br />
Edit the file: <br />
$ nano ~/.xinitrc<br />
and add:<br />
<br />
exec xterm<br />
<br />
So that it looks like this:<br />
<br />
#!/bin/sh<br />
#<br />
# ~/.xinitrc<br />
#<br />
# Executed by startx (run your window manager from here)<br />
#<br />
exec xterm<br />
# exec wmaker<br />
# exec startkde<br />
# exec icewm<br />
# exec blackbox<br />
# exec fluxbox<br />
<br />
{{Box Note | ''Be sure to have only '''one''' uncommented '''exec''' line in your ~/.xinitrc''.}}<br />
Below, we shall edit this file again to specify the appropriate desktop environment/window manager of your choice.<br />
<br />
Finally, test your configurations by starting '''X''' as '''normal, non-root''' user, with:<br />
<br />
$ startx<br />
or<br />
$ xinit<br />
You should have an '''xterm''' session open up. You can test your keyboard and its layout in it. You may need to add option lines in the "InputDevice" section of the /etc/X11/xorg.conf file specifying the keyboard layout and variant:<br />
<br />
<pre><br />
Option "XkbLayout" "be"<br />
Option "XkbVariant" ""<br />
</pre><br />
<br />
You can exit the '''X''' Server with Ctrl+Alt+Backspace, or by typing "exit". If you have problems starting '''X''', you can look for errors in the /var/log/Xorg.0.log file and on the console output of the console you started '''X''' from.<br />
<br />
If you prove a properly configured /etc/X11/xorg.conf by successfully running the test, you can be assured that your DE/WM of choice will work smoothly.<br />
<br />
Advanced instructions for Xorg configuration can be found in the [[Xorg]] article.<br />
<br />
==Part III: Installing and configuring a Desktop Environment ==<br />
While The '''X''' Window System provides the basic framework for building a ''graphical user interface'' (GUI), a '''Desktop Environment''' (DE), works atop and in conjunction with '''X''', to provide a completely functional and dynamic GUI. A DE typically provides a window manager, icons, applets, windows, toolbars, folders, wallpapers, a suite of applications and abilities like drag and drop. The particular functionalities and designs of each DE will uniquely affect your overall environment and experience. Therefore, choosing a DE is a very subjective and personal decision. Choose the best environment for ''your'' needs.<br />
<br />
* If you want something full-featured and similar to Windows and Mac OSX, '''[[#KDE|KDE]]''' is a good choice<br />
* If you want something slightly more minimalist, which follows the K.I.S.S. principle more closely, '''[[#GNOME|GNOME]]''' is a good choice<br />
* '''[[#Xfce|Xfce]]''' is generally perceived as similar to GNOME, but lighter and less demanding on system resources, yet still visually pleasing and providing a very complete environment.<br />
* '''[[#LXDE|LXDE]]''' is a minimal DE based on the Openbox window manager. It provides most things you need for a modern desktop while keeping relatively low system resource usage. LXDE is a good choice for those who want a quick way of setting up a pre-configured Openbox system.<br />
<br />
If you desire a lighter, less demanding GUI to configure manually, you may choose to simply install a '''Window Manager''', or WM. A WM controls the placement and appearance of application windows in conjunction with the X Window System but does NOT include such features as panels, applets, icons, applications, etc., by default.<br />
* Lightweight floating WM's include: [[#Openbox|'''Openbox''']], [[#Fluxbox|'''Fluxbox''']], [[#fvwm2|'''fvwm2''']], '''Windowmaker, Pekwm, and TWM'''.<br />
* If you need something completely different, try '''Awesome, ion, wmii, dwm, or xmonad'''.<br />
<br />
===Install Fonts===<br />
At this point, you may wish to save time by installing visually pleasing, true type fonts, before installing a desktop environment/window manager. Dejavu and bitstream-vera are good, general-purpose font sets. You may also want to have the Microsoft font sets, which are especially popular on websites. <br />
<br />
Install with:<br />
# pacman -S ttf-ms-fonts ttf-dejavu ttf-bitstream-vera<br />
<br />
===~/.xinitrc (again)===<br />
<br />
As '''non-root user''', edit your /home/username/.xinitrc to specify the DE you wish to use. This will allow you to use '''startx/xinit''' from the shell, in the future, to open your DE/WM of choice:<br />
<br />
$ nano ~/.xinitrc<br />
<br />
Uncomment or add the ''''exec''' ..' line of the appropriate desktop environment/window manager. Some examples are below:<br />
<br />
For the Xfce4 desktop environment:<br />
exec startxfce4 <br />
<br />
For the KDE desktop environment:<br />
exec startkde<br />
A '''startkde''' or '''startxfce4''' command starts the KDE or Xfce4 desktop environment. This command does not finish until you logout of the DE. Normally the shell would wait for KDE to finish, then run the next command. The "exec" prefix to this command tells the shell that this is the last command, so the shell does not need to wait to run a subsequent command.<br />
<br />
Remember to have only one uncommented '''exec''' line in your ~/.xinitrc. <br />
<br />
Continue below, installing the DE/WM of your choice.<br />
<br />
* [[#GNOME|'''GNOME''']]<br />
* [[#KDE|'''KDE''']]<br />
* [[#Xfce|'''Xfce''']]<br />
* [[#LXDE|'''LXDE''']]<br />
* [[#Openbox|'''Openbox''']]<br />
* [[#Fluxbox|'''Fluxbox''']]<br />
* [[#fvwm2|'''fvwm2''']]<br />
<br />
===GNOME===<br />
====About GNOME====<br />
The '''G'''NU '''N'''etwork '''O'''bject '''M'''odel '''E'''nvironment. The GNOME project provides two things: The GNOME desktop environment, an intuitive and attractive desktop for end-users, and the GNOME development platform, an extensive framework for building applications that integrate into the rest of the desktop.<br />
<br />
====Installation====<br />
Install the base GNOME environment with:<br />
# pacman -S gnome<br />
<br />
Additionally, you can install the extras:<br />
# pacman -S gnome-extra<br />
<br />
It's safe to choose all packages shown in the extra package. <br />
<br />
====Useful DAEMONS for GNOME====<br />
Recall from above that a daemon is a program that runs in the background, waiting for events to occur and offering services. The '''hal''' daemon, among other things, will automate the mounting of disks, optical drives, and USB drives/thumbdrives for use in the GUI. The '''fam''' daemon will allow real-time representation of file alterations in the GUI, allowing instant access to recently installed programs, or changes in the file system. Both '''hal''' and '''fam''' make life easier for the GNOME user. The hal and fam packages are installed when you install GNOME, but must be invoked to become useful.<br />
<br />
You may want to install a graphical login manager. For GNOME, the '''gdm''' daemon is a good choice. <br />
<br />
As root:<br />
# pacman -S gdm<br />
You will almost certainly want the '''hal''' and '''fam''' daemons.<br />
<br />
Start hal and fam:<br />
# /etc/rc.d/hal start<br />
<br />
# /etc/rc.d/fam start<br />
<br />
Add them to your /etc/rc.conf DAEMONS section, so they will be invoked at boot:<br />
# nano /etc/rc.conf<br />
<br />
DAEMONS=(syslog-ng network crond alsa '''hal fam gdm''')<br />
(If you prefer to log into the console and manually start X, leave out gdm.)<br />
<br />
<br />
As normal user, start X:<br />
$ startx<br />
or<br />
$ xinit<br />
If ~/.xinitrc is not configured for GNOME, you may always start it with '''xinit''', followed by the path to GNOME:<br />
$ xinit /usr/bin/gnome-session<br />
<br />
Advanced instructions for installing and configuring GNOME can be found in the [[Gnome]] article.<br />
<br />
Congratulations! Welcome to your GNOME desktop environment on your new Arch Linux system! You may wish to continue by viewing '''[[#Tweaks/Finishing touches|Tweaks and finishing touches]]''', or the rest of the information below. You may also be interested in the [[Post Installation Tips]] wiki article.<br />
<br />
====Eye Candy====<br />
By default, GNOME does not come with many themes and icons. You may wish to install some more attractive artwork for GNOME:<br />
<br />
A nice gtk (gui widget) theme engine (includes themes) is the murrine engine. Install with:<br />
# pacman -S gtk-engine-murrine<br />
<br />
Once it has been installed, select it with System -> Preferences -> Appearance -> Theme tab.<br />
<br />
The Arch Linux repositories also have a few more nice themes and engines. Install the following to see for yourself:<br />
<br />
# pacman -S gtk-engines gtk2-themes-collection gtk-aurora-engine gtk-candido-engine gtk-rezlooks-engine<br />
<br />
You can find many more themes, icons, and wallpapers at [http://www.gnome-look.org Gnome Look].<br />
<br />
===KDE===<br />
====About KDE====<br />
The '''K''' '''D'''esktop '''E'''nvironment. KDE is a powerful Free Software graphical desktop environment for GNU/Linux and <code>UNIX</code> workstations. It combines ease of use, contemporary functionality, and outstanding graphical design with the technological superiority of <code>UNIX</code>-like operating systems.<br />
<br />
====Installation====<br />
Choose one of the following, and continue below with '''[[#Useful KDE DAEMONS|Useful KDE DAEMONS]]''': <br />
<br />
1. Package '''kde''' is the complete, vanilla KDE 4.1 residing under the Arch [extra] repo.<br />
<br />
Install this before: <br />
# pacman -S zlib shared-mime-info<br />
Install with pacman: <br />
# pacman -S kde<br />
<br />
2. '''KDEmod''' is an Arch Linux exclusive community-driven system designed for modularity and also offers a choice between KDE 3.5.10 or 4.x.x. KDEmod can be installed with pacman, after adding the proper repository to /etc/pacman.conf. The project website, including complete installation instructions, can be found at [http://kdemod.ath.cx/ http://kdemod.ath.cx/].<br />
<br />
{{Box Note|A dependency of the full kdemod3/kdemod-legacy was removed from the Arch official repositories. KDEmod is not part of said repositories, and no standard Arch programs used this package. If you wish to install kdemod3-complete without potentially problematic "force install" workarounds, you should install the package libopensync from AUR manually (See: [http://wiki.archlinux.org/index.php/AUR_User_Guidelines#Installing_Packages_from_the_AUR]) or via the program yaourt (See: [http://wiki.archlinux.org/index.php/Yaourt#Easy_Install] then yaourt -S libopensync) until the package is in the KDEMod3 repositories. If you have trouble, try libopensync-stable (or libopensync-unstable if you're desperate). Alternatively, installing kdemod3-base instead of kdemod3-complete should work around this issue (the kdepim group, which this dependency issue likely belongs to, is not in the base group), and you can work your way UP to the packages you want instead of working down.}}<br />
<br />
====Useful KDE DAEMONS====<br />
<br />
KDE will require the '''hal''' ('''H'''ardware '''A'''bstraction '''L'''ayer) and '''fam''' ('''F'''ile '''A'''lteration '''M'''onitor) daemons. The '''kdm''' daemon is the '''K''' '''D'''isplay '''M'''anager, which provides a '''graphical login''', if desired.<br />
<br />
Recall from above that a daemon is a program that runs in the background, waiting for events to occur and offering services. The hal daemon, among other things, will automate the mounting of disks, optical drives, and USB drives/thumbdrives for use in the GUI. The fam daemon will allow real-time representation of file alterations in the GUI, allowing instant access to recently installed programs, or changes in the file system.. Both '''hal''' and '''fam''' make life easier for the KDE user. The hal, fam and kdm packages are installed when you install KDE, but must be invoked to become useful.<br />
-----<br />
Start hal and fam:<br />
<br />
# /etc/rc.d/hal start<br />
<br />
# /etc/rc.d/fam start<br />
{{Box Note|The hal daemon relies on, and will automatically start, the dbus daemon.}}<br />
Edit your DAEMONS array in /etc/rc.conf:<br />
# nano /etc/rc.conf<br />
Add '''hal''' and '''fam''' to your DAEMONS array, to invoke them on boot. If you prefer a graphical login, add '''kdm''' as well: <br />
DAEMONS=(syslog-ng network crond alsa '''hal fam kdm''')<br />
{{Box Note|If you installed KDEmod3 instead of normal KDE, use kdm3 instead of kdm.}}<br />
<br />
*This method will start the system at runlevel 3, (/etc/inittab default, multiuser mode), and then start KDM as a daemon. <br />
<br />
*Some users prefer an alternative method of starting a display manager like KDM on boot by utilizing the /etc/inittab method and starting the system at runlevel 5. See [[Adding a login manager (KDM, GDM, or XDM) to automatically boot on startup]] for more.<br />
<br />
*If you prefer to log into the '''console''' at runlevel 3, and manually start X, leave out kdm, or comment it out with a bang, ( ! ).<br />
<br />
Now try starting your X Server as normal user:<br />
$ startx<br />
or<br />
$ xinit<br />
Advanced instructions for installing and configuring KDE can be found in the [[KDE]] article.<br />
<br />
Congratulations! Welcome to your KDE desktop environment on your new Arch Linux system! You may wish to continue by viewing '''[[#Tweaks/Finishing touches|Tweaks and finishing touches]]''', or the rest of the information below. You may also be interested in the [[Post Installation Tips]] wiki article.<br />
<br />
===Xfce===<br />
====About Xfce====<br />
The cholesterol-free '''X''' environment. Xfce, like GNOME or KDE, is a desktop environment, but aims to be fast and lightweight while remaining visually appealing and easy to use. It contains a suite of apps like a root window app, window manager, file manager, panel, etc. Xfce is written using the GTK2 toolkit (like GNOME) and contains its own development environment (libraries, daemons, etc) similar to other big DEs. Unlike GNOME or KDE, Xfce is lightweight and designed more around CDE than Windows or Mac. It has a much slower development cycle, but is very stable and fast. Xfce is great for older hardware, and will perform excellently on newer machines as well.<br />
<br />
====Installation====<br />
Install Xfce: <br />
# pacman -S xfce4 <br />
You may also wish to install themes and extras:<br />
# pacman -S xfce4-goodies gtk2-themes-collection<br />
Note: '''xfce4-xfapplet-plugin''' (a plugin that allows the use of GNOME applets in the Xfce4 panel) is part of the '''xfce4-goodies''' group and depends on '''gnome-panel''', which in turn depends on '''gnome-desktop'''. You may wish to take this into consideration before installing, since it represents a significant number of extra dependencies.<br />
<br />
If you wish to admire 'Tips and Tricks' on login, install the '''fortune-mod''' package:<br />
# pacman -S fortune-mod<br />
<br />
====Useful DAEMONS====<br />
Recall from above that a daemon is a program that runs in the background, waiting for events to occur and offering services. The hal daemon, among other things, will automate the mounting of disks, optical drives, and USB drives/thumbdrives for use in the GUI. The fam daemon will allow real-time representation of file alterations in the GUI, allowing instant access to recently installed programs, or changes in the file system. The hal and fam packages are installed when you install Xfce, but must be invoked to become useful.<br />
<br />
Start hal and fam:<br />
<br />
# /etc/rc.d/hal start<br />
<br />
# /etc/rc.d/fam start<br />
{{Box Note|The hal daemon relies on, and will automatically start, the dbus daemon.}}<br />
Edit your DAEMONS array in /etc/rc.conf:<br />
# nano /etc/rc.conf<br />
Add '''hal''' and '''fam''' to your DAEMONS array, to invoke them at boot.<br />
<br />
Advanced instructions for installing and configuring Xfce can be found in the [[Xfce]] article.<br />
<br />
If you wish to install one, see [[Adding a login manager (KDM, GDM, or XDM) to automatically boot on startup]]. Otherwise you can login in via the console and run:<br />
<br />
$ startxfce4<br />
<br />
Congratulations! Welcome to your Xfce desktop environment on your new Arch Linux system! You may wish to continue by viewing '''[[#Tweaks/Finishing touches|Tweaks and finishing touches]]''', or the rest of the information below. You may also be interested in the [[Post Installation Tips]] wiki article.<br />
<br />
===LXDE===<br />
====About LXDE====<br />
LXDE, (for ''L''ightweight ''X''11 ''D''esktop ''E''nvironment), is a new project focused on providing a modern desktop environment which aims to be lightweight, fast, intuitive and functional while keeping system resource usage low. LXDE is quite different from other desktop environments, since each component of LXDE is a discrete and independent application, and each can be easily substituted by other programs. This modular design eliminates all unnecessary dependencies and provides more flexibility. Details and screenshots available at: http://lxde.org/ <br />
<br />
LXDE provides:<br />
# The OpenBox windowmanager<br />
# PCManFM File manager<br />
# LXpanel system panel<br />
# LXSession session manager<br />
# LXAppearance GTK+ theme switcher<br />
# GPicView image viewer<br />
# Leafpad simple text editor<br />
# XArchiver: Lightweight, fast, and desktop-independent gtk+-based file archiver<br />
# LXNM (still under development): Lightweight network manager for LXDE supporting wireless connections<br />
These lightweight and versatile tools combine for quick setup, modularity and simplicity.<br />
<br />
Install LXDE with: <br />
# pacman -S lxde<br />
Add:<br />
exec startlxde<br />
to your ~/.xinitrc and start with ''startx'' or ''xinit''<br />
<br />
Further information available at the [[LXDE]] wiki article.<br />
<br />
===*box===<br />
====Fluxbox====<br />
Fluxbox © is yet another windowmanager for X.<br />
It's based on the Blackbox 0.61.1 code. Fluxbox looks like blackbox and handles styles, colors, window placement and similar things exactly like blackbox (100% theme/style compability).<br />
<br />
Install Fluxbox using <br />
# pacman -S fluxbox fluxconf<br />
<br />
If you use gdm/kdm a new fluxbox session will be automatically added. Otherwise, you should modify your user's .xinitrc and add this to it:<br />
exec startfluxbox <br />
<br />
More information is available in the [[Fluxbox]] article.<br />
<br />
====Openbox====<br />
Openbox is a standards compliant, fast, light-weight, extensible window manager.<br />
<br />
Openbox works with your applications, and makes your desktop easier to manage. This is because the approach to its development was the opposite of what seems to be the general case for window managers. Openbox was written first to comply with standards and to work properly. Only when that was in place did the team turn to the visual interface.<br />
<br />
Openbox is fully functional as a stand-alone working environment, or can be used as a drop-in replacement for the default window manager in the GNOME or KDE desktop environments. <br />
<br />
Install openbox using<br />
# pacman -S openbox<br />
Additional configuration tools are also available, if desired:<br />
# pacman -S obconf obmenu<br />
<br />
Once openbox is installed you will get a message to move menu.xml & rc.xml to ~/.config/openbox/ in your home directory:<br />
# su - ''yourusername''<br />
$ mkdir -p ~/.config/openbox/<br />
$ cp /etc/xdg/openbox/rc.xml ~/.config/openbox/<br />
$ cp /etc/xdg/openbox/menu.xml ~/.config/openbox/<br />
<br />
'''rc.xml''' is the main configuration file for OpenBox. It may be manually edited, (or you can use OBconf). '''menu.xml''' configures the right-click menu.<br />
<br />
You may log into OpenBox via graphical login using KDM/GDM, or from the shell using '''startx''', in which case you will need to edit your ~/.xinitrc (as non-root user) and add the following:<br />
<br />
exec openbox-session<br />
You may also start OpenBox from the shell using '''xinit''':<br />
$ xinit /usr/bin/openbox-session<br />
* Openbox may also be used as the window manager for GNOME, KDE, and Xfce.<br />
For KDM there is nothing left to do; openbox is listed in the sessions menu in KDM.<br />
<br />
Some useful, lightweight programs for OpenBox are:<br />
* PyPanel or LXpanel if you want a panel<br />
* feh if you want to set the background<br />
* ROX if you want a simple file manager (also provides simple icons)<br />
* PcmanFM a lightweight but versatile file manager (also provides desktop icon functionality)<br />
* iDesk (available in [[AUR]]) for providing desktop icons<br />
<br />
More information is available in the [[Openbox]] article.<br />
<br />
===fvwm2===<br />
FVWM is an extremely powerful ICCCM-compliant multiple virtual desktop window manager for the X Window system. Development is active, and support is excellent. <br />
<br />
Install fvwm2 with<br />
# pacman -S fvwm <br />
<br />
fvwm will automatically be listed in kdm/gdm in the sessions menu. Otherwise, add <br />
exec fvwm <br />
<br />
to your user's .xinitrc.<br />
<br />
==Browser, Codecs, Video Player & Useful Applications==<br />
===Web Browser===<br />
The ever-popular Firefox web browser is available through pacman, although it does not have its official branding. Therefore, the program appears as its development codename, ''Gran Paradiso'', when opened.<br />
<br />
Install with:<br />
<br />
pacman -S firefox<br />
Be sure and install 'flashplugin', 'mplayer', 'mplayer-plugin', and the 'codecs' packages for a complete web experience:<br />
pacman -S flashplugin mplayer mplayer-plugin codecs<br />
<br />
''For newbies: if you install the x86_64 version of Arch Linux don`t use the option flashplugin in pacman, like above, or you will get an error. Adobe now offers a 64 bit version of flash plugin. Please see [http://wiki.archlinux.org/index.php/Install_Flash_on_Arch64 Install_Flash_on_Arch64]'' <br />
<br />
* ''Note'' I was only able to get plugins working by soft linking everything in '/usr/lib/mozilla/plugins' to '~/.mozilla/plugins', specifically running 'mkdir ~/.mozilla/plugins && ln -s /usr/lib/mozilla/plugins/* ~/.mozilla/plugins'<br />
<br />
(The codecs package contains most codecs, including those for Win32, Quicktime and Realplayer9 content.)<br />
<br />
===VLC===<br />
VLC Player is a versatile multimedia player which can handle many different formats, from a disc or file. It also provides the ability to stream multimedia over a lan. Install with:<br />
pacman -S vlc<br />
The libdvdcss library provides DVD decoding for encrypted DVDs. Ensure the legality of using libdvdcss in your country before installing!<br />
pacman -S libdvdcss<br />
<br />
===Useful Applications===<br />
For more apps, see [[Useful Applications]].<br />
=APPENDIX=<br />
See [[Beginners' Guide Appendix]]</div>
Listdata