Installation of archlinux (refer to the official documentation, desktop installation is not completed yet)
First, start the installation system (I use a vmwarevm)
1. Set the keyboard layout
# Loadkeys "us" # Set it to the U.S. keyboard layout. Generally, it can be set to the default layout.
2. Create a hard disk partition
I use fdisk to partition the disk. There are only three primary partitions: //,/boot, and SWAP, but the SWAP partition is different from the other two, is to press t to modify its format to SWAP format.
Fdisk is used to start fdisk as root (disk-device is like/dev/sda): # If fdisk disk-device is a brand new disk or you want to repartition, use the o command to create a new empty DOS partition table. Use the n command to create a new partition (primary partition/first partition ). Use the + xG format to specify the partition size as x GB. For example, if you want to create a 15 GiB partition, you need to enter + 15 GB. Use the t command to change the partition ID from the default value to Linux (type 83 ). This is an optional step. You can also create other types of partitions, such as swap, NTFS, and LVM. Note: The complete list of available partition types can be obtained using the l command. The processing of other partitions is similar. Use the w command to write the Partition Table to the disk and exit. Format the new partition as a file system.
3. Create a file
Run the following command to create an ext4 File System: Warning: after a new file system is created, the data previously stored in this partition will be lost and cannot be retrieved. Back up the data you want to retain. # Mkfs. ext4/dev/partition In addition, you can use mkfs. This is the unified entrance to the mkfs. fstype tool. # Mkfs-t ext4/dev/partition
4. Mount partitions
Check the identifier and layout of the current Disk: # lsblk/dev/sda first mounts the root partition to/mnt. # mount/dev/sda1/mnt # After ls/mnt is formatted, it should be a lost + found and then mount the/home partition and other independent partitions (/boot,/var, etc ). Create the home directory in/mnt and mount the partition: # mkswap/dev/sdaX & swapon/dev/sdaX # format the partition as swap, create a swap partition # mount/dev/sdaX/mnt # mount/partition to/mnt
5. Select an image
Run the nano command to edit/etc/pacman. d/hosts list and select the image you want to select. Here, the default image is used, and the domestic source can be used quickly.
6. Start to install the system.
Install the base software group using packers. # Pacbench/mnt base
You can also use
# Pacbench/mnt base-devel # Install the basic development kit
7. Configure the system
Run the following command to generate the fstab file (set UUID or volume label with-U or-L options): # genfstab-p/mnt>/mnt/etc/fstab
# Cat/mnt/etc/fstab # view the fstab OF THE SYSTEM
Switch the system to the latest system
# arch-chroot /mnt
Set Host Name
# echo computer_name > /etc/hostname
Set Time Zone
# ln -sf /usr/share/zoneinfo/zone/subzone /etc/localtime
Example ):
# ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
Configure the System Language
Edit/etc/locale. gen. All content in this file is annotated, and the corresponding comments are canceled according to the language you need.
# nano /etc/locale.gen
If Chinese is enabled, configure the following:
en_US.UTF-8 UTF-8en_GB.UTF-8 UTF-8zh_CN.GB18030 GB18030zh_CN.GBK GBKzh_CN.UTF-8 UTF-8zh_CN GB2312
If only English is enabled, just en_US.UTF-8 UTF-8
Then execute
# Locale-gen # generate correct locale information
Set the system locale preference in/etc/locale. conf. For a single user, set $ HOME/. config/locale. conf:
# echo LANG=your_locale > /etc/locale.conf
Example:
echo LANG=en_US.UTF-8 > /etc/locale.conf
Configure the network
systemctl enable dhcpcd.service
Set Password
passwd
Input
# Exit chroot
Cancel partition mounting in turn cancel mounting
# umount -R /mnt
Restart the system
# reboot
8. Install the boot program
Three BIOS systems are available-Syslinux, GRUB, and LILO. Select one boot as per your preferences
I chose GRUB.
# pacman -S grub-bios# grub-install --target=i386-pc --recheck /dev/sda# grub-mkconfig -o /boot/grub/grub.cfg
9. Install the desktop environment
pacman -S lxde