-
First, get a latest, fresh ISO image.
-
Boot.
-
Load keymap. Typically it will be:
loadkeys us
but it should be already loaded for you on boot.
-
Partition.
cfdisk /dev/sdX
Making a
swap
partition is not recommended unless you are installing it on a notebook. -
Format.
mkfs.FORMAT /dev/sdXn
Recommended
FORMAT
isext4
. -
Mount the partition under
/mnt
.mount /dev/sdXn /mnt
-
Edit the
/etc/pacman.d/mirrorlist
: put your preferred mirror at top. JAIST was the best in my circumstances. In order to edit easily, you might want to installvim
. You would also userankmirrors
. Refer to this page. -
Install the base packages into your partition.
pacstrap /mnt base base-devel curl git grub openssh screen tmux vim wget zsh zsh-completions
-
When it's done, generate
fstab
.genfstab -p /mnt >> /mnt/etc/fstab
-
chroot
into the partition.arch-chroot /mnt
-
Write your hostname.
echo HOSTNAME >> /etc/hostname
-
Symlink local time zone.
ln -s /usr/share/zoneinfo/Asia/Seoul /etc/localtime
-
Uncomment locale of your liking from
/etc/locale.gen
. Typically it would been_US.UTF-8
. -
Generate your locales.
locale-gen
-
Set locale preferences.
locale > /etc/locale.conf
-
Set console keymap and font preferences. In
/etc/vconsole.conf
:# /etc/vconsole.conf KEYMAP=us FONT=lat2-16
-
Configure
/etc/mkinitcpio.conf
. My liking is to changeCOMPRESSION
tocat
:COMPRESSION="cat"
-
Create an initial RAM disk with:
mkinitcpio -p linux
-
Set a root password with
passwd
.
Enable and start services you would run. All of these commands should be run
as root
.
```shell
sudo systemctl enable sshd
sudo systemctl start sshd
```
From now on, follow if you are not installing your distribution from a machine different from where it will be distributed (i.e. not on linode). Other than that, reboot and apply after deploy as needed.
Configure your network. I personally prefer systemd-networkd
. All of these
commands should be run as root
.
- Configure
/etc/systemd/network/PROFILE_NAME.network
(you should have one every NIC).
- for static IP:
[Match]
Name=INTERFACE_NAME
[Network]
Address=YOUR.IP.ADDRESS.HERE/CIDR
Address=ANOTHER.IP.ADDRESS.HERE/CIDR
Gateway=GATEWAY.IP.ADDRESS.HERE
- for DHCP:
[Match]
Name=INTERFACE_NAME
[Network]
DHCP=yes
;uncomment this section if you want to *not* use received from the DHCP server as the transient hostname.
;[DHCPv4]
;UseHostname=false
-
Start
systemd-resolvd
and linkresolv.conf
for DNS resolution from DHCP, or if DNS is defined in network files.sudo systemctl enable systemd-resolved sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf sudo systemctl start systemd-resolved
-
Enable and start
systemd-networkd
.sudo systemctl enable systemd-networkd sudo systemctl start systemd-networkd
-
Check network status.
ip addr ping -c3 google.com
Install your bootloader. I prefer GRUB.
-
for MBR partitioned disk:
grub-install --target=i386-pc --recheck --debug /dev/sdX grub-mkconfig -o /boot/grub/grub.cfg
Reboot to newly installed system.
```shell
exit
umount -R /mnt
reboot
```
-
Create a new user for typical use. Using root for everyday chores are EVIL.
useradd -m -G wheel -s /bin/bash USERNAME
-
Edit sudoers. Before editing, I recommend you to edit your
vimrc
for easy editing, or install sensible.vim.EDITOR=vim sudo visudo
# visudo USERNAME ALL=(ALL) NOPASSWD: ALL
If you enabled sshd
and configured network, you can use ssh to
work from now on.
I recommend you use a swap file instead of a swap partition because it is
easier to modify. All of these commands should be run as root
.
-
Create file for use as swap file.
sudo fallocate -l 1024M /swapfile # allocate file for swapfile sudo chmod 600 /swapfile # set proper permissions sudo mkswap /swapfile # format swapfile as swap sudo swapon /swapfile # enable swap
-
Edit
/etc/fstab
and add an entry for the swapfile:# /etc/fstab /swapfile none swap default 0 0
In case you want to remove swapfile:
sudo swapoff /swapfile
sudo rm -f /swapfile
and remove the entry from /etc/fstab
.
If you want to resize swapfile, just remove it and regenerate it without removing the fstab entry.
When removing or resizing swapfile, note that swap is managed by systemd and will be re-enabled by it after some time.
Because we installed zsh
on system install, we do not have to install the
package. However, I will install oh-my-zsh
for ease of configuration
and themes.
-
Install oh-my-zsh.
curl -L http://install.ohmyz.sh | sh
-
Automatic chsh is likely to fail, so you have to do it for yourself.
chsh # authorize and type zsh on prompt
-
Edit
~/.zshrc
and change oh-my-zsh theme. I prefer agnoster, which is flavored with powerline-patched fonts and solarized colors. I recommend you to install powerline-patched fonts such as Source Code Powerline if you are going to use agnoster.# ~/.zshrc ZSH_THEME="agnoster" # it should be residing on top, you should modify it.
-
Editing
~/.zshrc
, change your$EDITOR
environmental variable and alias:# ~/.zshrc export EDITOR="vim" alias vi="vim"
-
Editing
~/.zshrc
, enable keypad by appending:# ~/.zshrc # Keypad # 0 . Enter bindkey -s "^[Op" "0" bindkey -s "^[Ol" "." bindkey -s "^[OM" "^M" # 1 2 3 bindkey -s "^[Oq" "1" bindkey -s "^[Or" "2" bindkey -s "^[Os" "3" # 4 5 6 bindkey -s "^[Ot" "4" bindkey -s "^[Ou" "5" bindkey -s "^[Ov" "6" # 7 8 9 bindkey -s "^[Ow" "7" bindkey -s "^[Ox" "8" bindkey -s "^[Oy" "9" # + - * / bindkey -s "^[Ok" "+" bindkey -s "^[Om" "-" bindkey -s "^[Oj" "*" bindkey -s "^[Oo" "/"
-
Change into zsh by:
exec zsh
You now have installed Arch Linux, tkistic style. Now go on and install other stuff you would use, such as:
- Edit vimrc.
- Edit .tmux.conf.
- Install rvm.
- Install pyenv.
- Install mkvirtualenv.
- Install powerline.
- and many other geeky things!