8 September 2010
Setting up my Arch-Linux-based production environment
The Arch Way, the devotion to KISS, a good memory of the BSD-style configuration system, the extensive technical (rather than merely philosophical or evangelistic) documentation, and the rolling release model with bleeding-edge packages are what initially drive me to try the Arch Linux distribution. So far, I like it.
The Beginners' Guide provides a solid ground for setting up a general desktop environment. Nevertheless, the rest of my needs are met only through other sources of information (e.g., the fine ArchWiki) and experimenting.
This page is a memorandum for setting up a production desktop environment on Arch Linux. The choices of packages and configurations are purely based on personal taste and experience.
Arguably, good writers write for no one but themselves; yet, in doing this, they produce pieces of writing that serve others better than if they had started with too many other things in mind. In the same spirit, I write this memorandum for myself. Nevertheless, I hope you will also find it useful.
Here is an index of the topics.
- Post-installation Configuration
- ... and Remember to Update the System
In homage to the comprehensive Beginner's Guide, I only highlight the choices I have made throughout the installation procedure here.
Many modern personal computers are capable of booting from USB drive. This page describes how to make a USB installation media. I took a free 512M USB pen from the UITS and burned the 2010.05 dual-arch netinstall image on it.
Partition and Filesystem
As regard to disk space allocation for filesystem, I allocate 20G for
ext4, 15G for
reiserfs, 1G on top of physical memory size for
swap, and the rest of the space for
ext4. Please see here for an explanation for the rationale behind these choices.
root, update and upgrade the system with
pacman -Syu. This should not be an issue for netinstall.
pacman -S sudoand set up a user account
useradd -m -g users -G audio,lp,optical,storage,video,wheel,games,power -s /bin/bash wei
/etc/sudoers to enable
%wheel ALL=(ALL) ALLand now we should login and work as the regular user
wei, and use
sudofor privileged operations. For the sake of clarity, we omit
sudoin the following command snippet; the context should make it clear if a
Install and configure Advanced Linux Sound Architecture (ALSA) has been detailedly described here. Basically, after
pacman -S alsa-utils, run
wei (rather than
root) and store the setting with
sudo alsactl store. Of course, do not forget to add
alsa to the
DAEMONS array in
If you find the system beeping annoying as I do, you may disable it by adding
!snd_pcsp !pcspkr to the
MODULES array in
# Scan hardware and load required modules at bootand unload it with
# Load the following modules (do not load with the ! prefix)
MODULES=(... !snd_pcsp !pcspkr ...)
lsmod | grep -i spkrif you already have loaded it.
Setup a Desktop Environment
The instructions are here. Basically, we need to do
pacman -S xorg mesa
lspci | grep -i vga
pacman -S xf86-video-<chip>
We do not need to configure Xorg at this point because we are going to install the GNOME desktop environment in a moment.
Install fonts with
pacman -S ttf-ms-fonts ttf-dejavu ttf-bitstream-vera
After this, install GNOME with
pacman -S gnome gnome-extra gnome-system-toolsand enable GDM with
/etc/rc.d/hal startand edit the
/etc/rc.confinto something like
DAEMONS=(syslog-ng dbus hal gdm network crond alsa)Restart the computer, and we will land right into GDM.
I prefer to disable CapsLock key by the desktop menu
Set the mouse focus policy at (somewhat counter-intuitive)
Set the single-click-select mouse behavior at Nautilus's menu
To make the rest of the procedure goes smoothly,
pacman -S bash-completion
echo 'set show-all-if-ambiguous on' >> ~/.inputrc
The following packages are basics for everyday use (for me)
pacman -S openssh putty gksu gvim firefox thunderbird gitUse the Vim's configuration for a quick start. We can set the following keyboard shortcuts (
pacman -S chromium screen irssi
pacman -S emacs racket sbcl
pacman -S graphviz gnuplot xfig octave
pacman -S ntfs-3g gstreamer0.10-plugins gstreamer0.10-pulse
Mod4usually maps to the
Mod4+O -> gnome-terminal --working-directory=$HOME
Mod4+B -> firefox
Mod4+R -> gksu gnome-terminal
Mod4+. -> thunderbird
Mod4+I -> gvim
Mod4+P -> putty
Mod4+L -> nautilus /home/wei/documents
Use Firefox's Add-On manager to add the following extensions:
Vimperator (the reason to stay with Firefox; a recommended try for any Vim user),
A few quickmarks are handy for
M<char> to add a quickmark
<char>; then we can use
gn<char> to quickly access the page)
g -> www.google.comand so on.
s -> scholar.google.com
d -> docs.google.com
c -> www.google.com/calendar/render
m -> www.gmail.com
M -> maps.google.com
u -> umail.iu.edu
o -> onestart.iu.edu
e -> edas.info
f -> www.facebook.com
r -> www.renren.com
h -> www.cs.iupui.edu/~pengw/
k -> slickdeals.net
y -> www.youtube.com
S -> mitpress.mit.edu/sicp/full-text/book/book-Z-H-4.html#%_toc_start
[archlinuxfr]Then, install it by
Server = http://repo.archlinux.fr/$arch
pacman -Syu yaourt
[multilib] ToolsIn our Arch64 setup, since we have enabled
pacman -S mplayer gecko-mediaplayer xine-lib xine-ui \
libdvdread libdvdcss alsa-oss flashplugin jre skype
pacman -S networkmanager network-manager-applet gnome-keyringand edit the
DAEMONS=( ...hal networkmanager... )
Do not forget to allow others to use your SSH service by adding to the file
Enable SSH's X11 forwarding by editing
X11Forwarding yesbut be aware of the hazard of doing so (forewarned is forearmed). Add
/etc/rc.confand start it with
Install optional dependencies for Empathy (
pacman -Qi empathy) to make it work correctly
pacman -S telepathy-butterfly telepathy-farsight telepathy-gabble telepathy-glib \
telepathy-haze telepathy-idle telepathy-salut telepathy-sofiasip
As regard to Skype microphone or voice problem, first check ALSA's configurations
alsamixerIn particular, press
sudo alsactl store
Captureto enable it (press
[F1]for usage). See here for more information.
pacman -Rd cairo libxft freetype2 fontconfigDo not panic if you find the look turns worse, because this is the caterpillar about to transform into butterfly
yaourt -S freetype2-ubuntu fontconfig-ubuntu libxft-ubuntu cairo-ubuntuLogout and login again. Enjoy the new look. :-)
With a dose of restraint and proper configurations, Compiz can greatly enhance your productivity and desktop experience.
Install it with
pacman -S compiz-fusion-gtkBefore activating it, use
ccsmto enable a few basic plug-ins
Move WindowThen, we can test it with (thanks for the help from a few kind souls on irc.freenode.net#archlinux:
compiz --replace --indirect-rendering ccp &Somehow, the
--indirect-renderingoption is vital for the proper function of Compiz on my setup. As noted here and here, Intel GMA user (e.g., Thinkpad X61s user as me) should start Compiz with
LIBGL_ALWAYS_INDIRECT=1 INTEL_BATCH=1 compiz --replace --indirect-rendering --sm-disable ccpand add a file
/etc/X11/xorg.conf.d/with this content
Section "Device"And we can always fall back to GNOME's window manager
Identifier "Intel video card"
Option "AccelMethod" "exa"
Option "MigrationHeuristic" "greedy"
Option "ExaNoComposite" "false"
metacity --replace --sm-disable &Make them into bash scripts
my-metacity.shfor quick access; a good place would be
$HOME/binand add a line
If you want to automatically start with Compiz enabled, see this tip: create the file (if it does not exist)
/usr/share/applications/compiz.desktop containing the following
[Desktop Entry]and set GConf parameters with
Exec=bash -c 'compiz --replace --indirect-rendering --loose-binding\
--sm-client-id $DESKTOP_AUTOSTART_ID ccp decoration move resize'
# name of loadable control center module
# autostart phase
# name we put on the WM spec check window
# back compat only
gconftool-2 --set -t string /desktop/gnome/session/required_components/windowmanager compiz
A list of plug-ins can be found at
/usr/share/compiz/*.xml, which you can add to the
A few Compiz plug-ins comes very handy
General Options>Desktop Size: set desktop's virtual size to 2 (vertical) by 3 (horizontal);
Negative: we can use
<Mod4>Nto toggle color negation of a window;
Opacify: make a window transparent if it blocks the view of the window with focus;
Desktop Walltogether with
Viewport Switcher: so you can move among virtual desktops; set
Desktop Wall>Wall Sliding Durationto 0 for instant change of virtual desktop; set
Viewport Switcher>Switch to Viewport [num]with
<Super>[num]to move between them with the combo-key
Trailfocus: more fun with transparency;
Wobbly Windows: if you like something fun while moving the window; :-)
Application Switcher: poll window with
Extra WM Actions:
Grid: see the settings for key bindings with KeyPad (KP);
Maximumize: very handy for non-overlapping maximize (maximumize) with
<Super>m; very useful for achieving the tiling window manager effect;
Scale: I love the
Initiate Window Pickereffect and bind it with
<Mod4>m; optionally bind
Initiate Window Picker For All Windowsto
pacman -S texlive-most jabref gnochmSee here for a few LaTeX styles (e.g., IEEEtran). Simply extract the package into
pacman -S openjdk6
pacman -S ttf-dejavu artwiz-fonts ttf-ms-fonts
pacman -S openoffice-base
pacman -S openoffice-base-beta openoffice-base-devel
$HOMEshould work, i.e.,
tar xvf texmf.tgz.
Chinese Language Environment
Install Chinese fonts with
pacman -S ttf-arphic-ukai ttf-arphic-uming ttf-fireflysung
A Chinese input method is essential for everyday use. For this purpose, I find
ibus-pinyin a good choice.
pacman -S ibus-pinyinand configure it via
System > Preferences > IBus Preferencesdesktop menu.
Remember to install OpenOffice.Org's Chinese language support
pacman -S openoffice-zh-CN
... and Remember to Update the System
Do update and upgrade your system from time to time with
pacman -SyuThis is the beauty of a rolling release distro like Arch.