In this next post I’ll go through the steps of installing Arch Linux on an Acer 5940G laptop. I recently bought an SSD and wanted to re-install. So I figured this would make a good post and it would give me something of an advanced install notes if I wanted to redo it in the future.
Now Installing Arch is not like installing ubuntu, mint or fedora. There is a graphical way to install Arch, but the main installation method commonly used is via the command line. It is also this method I’ll be explaining in this post. If you are new to Linux or the Linux command line it may be better to look at one of the other distributions mentioned above.
I will be using the 2014 installation media (April) which I burned onto a cd prior to installing.
Ok let’s start 🙂
After booting from the cd, you should be greeted with the arch install screen.
Select x86_64 as we want to install the 64 bit version.
Next you will be greeted by a root console from which you can start the installation.
First lets load our keyboard layout
# List all keymaps localectl list-keymaps # Load the Belgian keys (of course select your own here) loadkeys be-latin1
You will notice that there is no network card detected and/or you have no internet.
# try lspci to list the pci modules that are detected lspci | grep Broadcom
Lets fix that issue first. According to the wiki the broadcom module is loaded after the tg3 module. This is what is causing the issue. This is easy to fix:
# unplug the cable modprobe -r tg3 modprobe broadcom modprobe tg3 # plug the cable back in
This should result in an active internet connection. Try ping and see if it works.
Next lets partition the drive. Of course this is up to you how to partition your drive. Some like the /home folder on a separate partition, others also like /var/logs to be on one. I chose a simple setup of a partition for swapping and then the rest for /.
Start fdisk of cfdisk (the latter is a little easier to use)
Use the menu to create the partitions for me this resulted in:
- / 241G
- swap 8G
Lets make the file system. The ‘L’ option is not required, it’s just to give the partitions a label.
mkfs.ext4 /dev/sda1 -L Linux mkswap /dev/sda2 -L Swap
Next mount the new file-system to /mnt/
mount /dev/sda1 /mnt/
Now lets install the system. You can add extra packages to be installed. I’ve add vim, net-tools and links.
pacstrap /mnt base vim net-tools links
After that is complete lets create a fstab file. This will tell arch what to mount during boot. The result of genfstab will be written to the fstab file in the mnt directory (aka your new system).
genfstab -p /mnt >> /mnt/etc/fstab
Now before we chroot into our new environment lets just copy the install notes.
cp /root/install.txt /mnt/root/
Then lets chroot into your new Arch Linux installation and continue configuration. If at any time you want to leave chroot, press ctrl-D.
We need to give our computer a name or hostname, this is done by issuing the following command.
echo "type your new name" > /etc/hostname
Now set the local timezone
ln -s /usr/share/zoneinfo/Europe/Brussels /etc/localtime
# Uncomment Be_* and en_GB in vim /etc/locale.gen # Generate locale locale-gen
Set the standard console keymap.
# Add KEYMAP=be-latin1 to vim /etc/vconsole.conf
Because of our special broadcom tg3 module load order we need to specify this in the mkinitcpio.conf file.
Look for Modules=”” and add “broadcom tg3”
Next generate mkinitcpio.
mkinitcpio -p linux
Now we need to install grub.
pacman -S grub grub-install /dev/sda grub-mkconfig -o /boot/grub/grub.cfg
Next enable the dhcp daemon to start at boot (you can do this later to if you want, just note that without this running or without a static IP you won’t have an internet connection.)
systemctl enable dhcpcd
That’s it, now exit, un-mount the filesystem and reboot.
exit umount /dev/sda1
Once rebooted I suggest setting a root password (as the default one will be blank).
Adding bash completion.
pacman -S bash-completion source /etc/bash.bashrc
Setting up ntp.
pacman -S openntpd # add servers be.pool.ntp.org vim /etc/ntpd.conf systemctl enable openntpd systemctl start openntpd # Set the time zones timedatectl set-timezone Europe/Brussels timedatectl set-ntp true # adjust hardware clock hwclock # outputs the hardware clock hwclock -w # sync local to hwclock
pacman -S openssh
If you want to use page-up and page-down to search through bash history, you can do this by changing some values in inputrc.
vim /etc/inputrc # Search history with arrow up and down keys #"\e[A": history-search-backward #"\e[B": history-search-forward # Search history with page up and down keys "\e[5~": history-search-backward "\e[6~": history-search-forward
Adding a user to the system and configuring sudo.
pacman -S sudo EDITOR=vim # temporarily sets the default editor visudo ## Uncomment to allow members of group sudo to execute any command %sudo ALL=(ALL) ALL groupadd sudo useradd -m -U username usermod -a -G sudo,power,network,video,audio,scanner,optical,floppy,storage,users username
pacman -S vim-molokai vim /etc/vimrc # add syntax on set number colorscheme molokai
Install a desktop environment
Next I recommend to install a DE. What you chose to install is completely up to you, I went with a base install of KDE.
pacman -S kdebase