Installing Arch can be a tough job for a Linux newbie because there is no silly installer, but when you can install it, you will have a better understanding of Linux. I will share my experience installing Arch with you in the hope that it will be helpful.

First of all, you need to download an image from the official website of ARCH, and then install it in the virtual machine using the image. I tried three times in the virtual machine and then installed it in the physical environment.

Installation steps

First make sure you can connect to the Internet, because Arch installation needs to be done in a networked environment.

You can use the following two commands to connect to the Internet:

Wired connection # DHCPCD

Wireless connection # wifi-Menu

partition

Manual partitioning is required. Fdisk is an interactive command line, and cfdisk is a graphical operation on the command line. As for how to do this, please search for tutorials on how to use both tools, so skip them because they are not the focus of this article.

You can install Linux all at once, or you can select different system components to install in different partitions.

Since I have a 128GB SSD and a 1TB regular hard drive, my partition scheme looks like this

SSD is divided into three parts: system kernel 200M /boot Variable data 16G /var Root partition 112G /

A common hard disk is formatted and mounted directly to /home

I didn’t use a swap partition because I had 8GB of ram and I didn’t think I needed a swap partition.

Run the formatting command after the partition is complete

mkfs.ext4 -b 4096 /dev/sda1
mkfs.ext4 -b 4096 /dev/sdb1
mkfs.ext4 -b 4096 /dev/sdb2
mkfs.ext4 -b 4096 /dev/sdb3
Copy the code

In my system partition, SDA is a common hard disk and SDB is an SSD

When the partition is complete, mount the hard disk to the mirrored/MNT directory, which is used in Linux to mount external devices, such as USB drives, CD/DVD drives, etc.

# mount -t ext4 /dev/sda1 /mnt/home
# mount -t ext4 /dev/sdb1 /mnt/boot
# mount -t ext4 /dev/sdb2 /mnt/var
# mount -t ext4 /dev/sdb3 /mnt
Copy the code

Modify the software source, the software source is arch’s software repository, although you can use the default without modifying it, but the speed experience is not very good.

https://www.archlinux.org/mirrorlist/

Select China on the official software source generation page to obtain the latest domestic software sources

Modify the software source configuration file

vim /etc/pacman.d/mirrorlist
nano /etc/pacman.d/mirrorlist
Copy the code

The above are just two different editors to edit, depending on which one you prefer.

sed -i "s/^/#/g" /etc/pacman.d/mirrorlist //
Copy the code

This command can make all files annotated, remember to back up. Then paste in the latest source from the url above.

pacman -Syy
Copy the code

Update the software source

pacstrap /mnt base base-devel vim
Copy the code

Install the base system, base is the base package group, Base-Devel is the base development package group, vim is the best editor in the world.

Generate fstab

genfstab -U -p /mnt > /mnt/etc/fstab
Copy the code

Switch to the newly installed system

arch-chroot /mnt
Copy the code
passwd root
Copy the code

Run passwd to set the root password. Type twice and don’t forget it.

The host name

Use vim to open /etc/hostname and write a name for the hostname, just letters, lines, and numbers.

The language environment

Then open /etc/locale.gen with vim and uncomment the following four lines:

en_US.UTF-8
zh_CN.UTF-8
zh_CN.GBK
zh_CN.GB2312
Copy the code

Then run # locale-gen

Then edit /etc/locale.conf and write in it

LANG="en_US.UTF-8"
Copy the code

Now generate the ramdisk to boot with

mkinitcpio -p linux
Copy the code
pacman -S wpa_supplicant dialog
Copy the code

Make sure the new system is networked, now you can install any other packages you feel you need.

Boot device

pacman -S grub
grub-install --target=i386-pc --recheck --debug /dev/sdb
grub-mkconfig -o /boot/grub/grub.cfg
Copy the code

My system is installed in /dev/sdb. Change this parameter based on your actual situation

Next to execute

exit
umount -R /mnt
reboot
Copy the code

These commands are:

Exit the Linux system of the hard disk

Cancel the used mount under/MNT

restart

Run the command on the newly installed system

useradd -m admin
passwd admin
Copy the code

Create a new user named admin and set the password for it. Normally, it should not be performed under root user when using Linux.

Remember to execute one of the first two network commands, otherwise you won’t be able to install the software without the network.

This is actually arch installed, but it works on the server, not on your PC, you can install a desktop environment.

Neil: I said GNome. It depends on your preference.

Other software, configuration, and so on have been written by two predecessors, I refer to their tutorial to install my ARCH, you can refer to it.

Official Installation Tutorial

Finally, the official wiki is quite a good tutorial, you can find a solution to the basic problems of Arch in it, learn to use it.