Sunday, 4 March 2012

Arch Linux 2011 - post installation

Every now and then I like to fiddle with a new Linux distro or a pre-release version of one o few distros I'm familiar with. After a quick look at I've picked Arch Linux, because :

- I use openSuse at work
- tried Fedora some months ago
- Debian is overall outdated
- I hate *buntu
- I've used Mandriva at work and home for few years

I usually don't bother to read instructions/documentation on distros I want to play with, until thing go really wrong - where's the fun in doing things by the book, right :D

Instalation process went fast and smoove, so lets skip to what I had to do after that.
Everything done loged in to shell as root.

1. Get IP adress by dhcp
dhcpcd -b eth0

2. Select pacman repos
nano /etc/pacman.conf

and uncoment few lines like this

#SigLevel = PackageRequired
Include = /etc/pacman.d/mirrorlist

#SigLevel = PackageOptional
Include = /etc/pacman.d/mirrorlist

#SigLevel = PackageOptional
Include = /etc/pacman.d/mirrorlist

- to save and exit from nano : Ctrl o , Enter , Ctrl x
- or : Ctrl x , y , Enter

3. Select pacman mirror
nano /etc/pacman.d/mirrorlist

and uncomment one link like so :

Server =$repo/os/$arch

4. Update system
pacman -Syu

5. Install few usefull apps
- mc - midnightcommander - file manager working in shell
- xfce4 - light X Desktop Environment
- gnome-packagekit - package manager for X
- wpa_supplicant - for connecting to wireless networkes
- htop - manage runing processes

pacman -S mc xfce4 wpa_supplicant gnome-packagekit htop

After starting X
You can run graphical package manager with
Alt F2

6. Tweak few bash commands - for lazy ppl
mcedit /etc/bash.bashrc
and add this lines
alias ll="ls -al --color=yes"
alias grep="grep --color"
alias df="df -aTh"

Press F2 to save and F10 to exit mcedit
Try 'll' or other command after re-loging in to shell - some distros have this neat feature by default.

7. Picking boot runlevel 3
mcedit /etc/inittab
# Boot to console
# Boot to X11

While editing inittab you can stop unnecessary terminals from starting at boot, I've rarely needed more than 2
#c3:2345:respawn:/sbin/agetty -8 -s 38400 tty3 linux
#c4:2345:respawn:/sbin/agetty -8 -s 38400 tty4 linux
#c5:2345:respawn:/sbin/agetty -8 -s 38400 tty5 linux
#c6:2345:respawn:/sbin/agetty -8 -s 38400 tty6 linux

8. If you have wifi router (or can connect to one), here's a helpfull hints

a) make a backup of config file
cp  /etc/wpa_supplicant.conf  /etc/wpa_supplicant.conf~

b) generate psk from ssid and passphrase
wpa_passphrase yourSSIDhere
# reading passphrase from stdin
copy the result - psk - will be needed for config file

c) I've removed all network examples from my conf (starting from then line : # Example blocks: )
mcedit /etc/wpa_supplicant.conf

and whipped out something like this - for most secure setup I can pick for my WRT160N, which is WPA2 with AES


d) and here's a script to start and stop wifi connection
mcedit /
Paste in this code

if [ -e /var/run/ ];then
    if [ -e /var/run/ ];then
        PIDF=`cat /var/run/`
        kill ${PIDF}
    dhcpcd -x wlan0
    ifconfig wlan0 down
    ifconfig wlan0 up
    wpa_supplicant -q -B -Dwext -iwlan0 -P/var/run/ -c/etc/wpa_supplicant.conf
    dhcpcd -b wlan0

press F2 to save and F10 to exit mcedit

chmod 700 /
Run by
Will start necessary apps and create pid files for them, if pids already exist - will stop those apps.

It's been a week and so far I'm loving Arch Linux. I get latest software & kernel and it's all running smoking fast.

No comments:

Post a Comment