This tutorial goes from http://blog.sina.com.cn/u/5692023517 to thank the great God for writing such a detailed tutorial and allowing reprint
- The purpose of this tutorial: to make it easier for beginners to install arch, a good tutorial can take a lot less detours
- Tutorials using the software: VMware Workstation 12.5.5,virtualbox 5.1.20-
- Image: Archlinux-2017.05.01-x86_64.iso
- Installation environment for BIOS + MBR
:
- Basic knowledge: Need to know a little about the use of Nano or vim
- Others can look at the Arch Wiki
1. Download Arch Linux
Baidu Arch, find the official website
2. Install Arch Linux
Start a virtual machine
Option Description:
- Boot Arch Linux #引导安装系统
- Boot existing OS #启动现有的操作系统
- Run memtest86+ (ramtest) #运行Memtest86 + (RAM test)
- Hardware information (HDT) #显示硬件信息
- Reboot #重启
- Power off #关闭电源
Select the first item here to boot the installation system
Create a hard disk partition
After entering the optical disk system, the first is to partition the hard drive and format it. The disc system itself comes with a lot of tools. Can be learned from Archwiki. Here, I use parted to partition (according to the picture).
Use parted to enter
\2. The usage of Mkpart is < main/Sub-partition > < format > < > < stop >
Using the MSDOS partition table
Create a primary partition with a size of all spaces
P Print the partition table to see if it's what we want
Q exit
Enter Q to exit
formatting partitions
The next step is to format the work. lsblk Printing Device , you can see that the partition corresponding to the real device named SDA1
mk* format device, sda1 use MKFS.EXT4 format to EXT4
MKFS.EXT4/DEV/SDA1 #把sda1格式化成ext4
Mount Partition
First mount the root partition to/mnt
mount/dev/sda1 /mnt
Set source
Theoretically, we can install the system next. In order to speed up the installation, we add the source of NetEase.
Using commands
Nano/etc/pacman.d/mirrorlist
Use the arrow keys to adjust the cursor, in the appropriate place to write the source of NetEase, and then use ctrl+o save changes, Ctrl+x quit editing.
Of course, you can also use Tsinghua Source:
Tutorial: https://mirrors.tuna.tsinghua.edu.cn/help/archlinux/
Update source
Use the Pacman-syy update source to capture the NetEase source you just added
Installing the base system
PACSTRAP/MNT Base Base-devel
To install the system into the/MNT directory (that is, the Sda3 partition)
Base-devel is a compilation and packaging related toolset for GCC g++ M4 make etc. I personally think it is necessary.
Configuring the System
Use the following command to generate the Fstab file (with -U
or -L
option to set the UUID or volume label):
Genfstab-u/mnt>>/mnt/etc/fstab
It means to map all the mount relationships under the/mnt directory to etc so that the next boot will automatically mount, such as the swap partition, the SDA1 mount to boot.
Chroot
Changeroot to the newly installed system: (Switch to the file system of the system we just installed)
Arch-chroot/mnt/bin/bash
At this point, the root directory/becomes the root of the new installation system, that is, where it was originally located in/mnt so that no more access to the original disc system files, using bash login root user
Locale
Localized programs and libraries to localize text, both rely on Locale, which explicitly specifies the format of the region, currency, time zone date, character arrangement, and other localization criteria, and so on. In the following two file settings: locale.gen
with a locale.conf
.
/etc/locale.gen
is a text file that contains only the comment document. To specify the type of localization you need, simply remove the comment symbol () in front of the corresponding line #
, and suggest UTF-8
the following:
Use the Nano Editor to edit/etc/locale.gen (use Vi/vim or Vi/vim)
How to use the Nano:
Move cursor: Use arrow keys to move
Flip Page: Ctrl + V PAGE DOWN, ctrl+y page up
Search: Press Ctrl+w, then enter the keywords you want to search, enter OK. This will locate the first matched text, and then you can use Alt+w to navigate to the next matching text.
Delete: Backspace
Save: Use Ctrl+o to save your changes
Exit: Ctrl+x
Find en_US. UTF-8 This line, delete the previous comment symbol ( #
)
This environment is the guarantee that the system can work properly, of course it is the English environment, if you want to see the Chinese system environment
Then scroll down to find ZH_CN. UTF-8, delete the previous comment symbol ( #
)
Save exit
Note: en_US. UTF-8 is a must have whether you are not planning to choose Chinese language environment unless you have the ability to solve all the software you encounter compatibility issues.
# Nano/etc/locale.gen
en_US. UTF-8 UTF-8
Zh_cn. UTF-8 UTF-8
Zh_tw. UTF-8 UTF-8
Then execute locale-gen
to generate the locale message:
Tip: Setting the system locale to the en_US.UTF-8
system Log will be displayed in English, which will make it easier to judge and handle the problem. Users can set their own locale, see Locale#peruserbroken link for details
Configuring a system-first language environment for English
Echo Lang=en_us. UTF-8 >/etc/locale.conf
Host Name
To set hostname, add it to /etc/hostname
, myhostname is the hostname you need:
# echo myhostname > /etc/hostname
Set Root password
Input passwd
( Note: The password is not displayed )
Create user
We have just been using root bare-Ben, which is very dangerous for Linux, so the next task is to add users
Useradd-m-G Wheel-s/bin/bash her
-M is the user directory created by default to generate/HOME/XXX, hereinafter referred to as "~".
-G is appended to a group inside this is the wheel group, which is the next group that we want to configure with sudo permissions
-S is what shell to use, here we use Bash first, and then we'll get rid of it.
She's my username.
Then create the password
passwd her
Until this user is finished creating.
Add sudo permissions to a user
This user does not currently have sudo execute permission, so there is no need to switch users or use root to install sudo.
Pacman-s sudo
After installing sudo, use the
Visudo
To configure those users to use sudo.
Visudo uses Vim's editing environment, which is followed by command mode,
Use/privilege Enter to find the privilege keyword, press N to find the next
Locate the beginning of the line in, and then press two X to release the comment for this line. This line represents the wheel group of users who can use sudo to execute all commands, and the following line means that the wheel group user can execute all commands without requiring a password. You can do as you want. after you've changed it, type: Wq, enter
Add to boot service: Systemctl enable DHCPCD
To install the boot program
Now the system has been installed, but at this time the restart is not able to enter the system, because there is no boot program installed. (Note: If you use Gpt+efi, this should be a direct boot, if you can not try to install systemd-boot)
Download Grub
Pacman-s Grub
Then install GRUB on the SDA device and generate the configuration file
Grub-install/dev/sda
Grub-mkconfig-o/boot/grub/grub.cfg
Don't choose the wrong here, not sda1, but the whole SDA.
OK, I admire your patience, you can see the words here, your system is completely ready
Enter exit
or press Ctrl+D
exit Chroot
Unmount a mounted partition
Umount-r/mnt
Input reboot restart
Post-installation work
How, happy to enter the system!
Using root to enter the system, there are a large number of configurations waiting for us ahead.
Input root
Enter password
Install desktop
If it restarts smoothly, then you can look down. Cause play is coming, that is the Desktop de environment, this is a love and hate Linux desktop environment:)
Desktop
The following is a tutorial on installing the Xfce desktop, similar to the GNOME or KDE installation method, please own Baidu
On the Linux desktop above the general architecture is the use of X, connected to the local xserver, call the X11 interface to implement, on the Linux desktop display Architecture arch and wiki have very good documentation. There is not much to do in the introduction.
So, the first step is to install X,xserver
Pacman-syu xorg Xorg-xinit
Press ENTER, install all
Then the desktop is installed, and the XFCE desktop is installed here
Pacman-s Xfce4 xfce4-goodies
Run Xfce
Manual Start You only need to run: startxfce4 boot from terminal, for example use XINIT/STARTX need to configure XINITRC (Simplified Chinese).
Input exec Startxfce4
Save exit
Next, an exciting moment has come, using commands
StartX
Start the desktop.
The long-lost desktop is so red fruit of the show out!
Installing Slim
Automatic Login
Every time the manual startx certainly uncomfortable, if we do need to automatically login, we have to use the Slim login Manager
Introduced
Slim is an abbreviation for simple login Manager. The slim is simple, lightweight, and easy to configure, and is relatively easy to use in low-and high-end systems. Slim is also a good fit for those looking for a login manager that is not dependent on GNOME or KDE and can be used in Xfce, Openbox, Fluxbox and other environments.
Installation
Pacman-s Slim
Set Boot slim
Restart
Slim Login Interface
Log on to the desktop
Installing VMware Tools
Installation ifconfig: pacman–s net-tools
Installing the Graphics driver: pacman–s xf86-video-vmware
Installing Yaourt
The simplest way to install Yaourt is to add a Yaourt source to your/etc/pacman.conf:
Add the following to/etc/pacman.conf
[ARCHLINUXCN]
#The Chinese Arch Linux communities packages.
Siglevel = Optional trustedonly
Server =http://repo.archlinuxcn.org/$arch
And then execute
Pacman-sy pacman-s Yaourt
Yaourt-s Open-vm-tools
Installing the Virtual Box Enhancement pack
Installing the Linux kernel module: pacman–s linux-headers
- Click the menu bar device –> Assign the optical drive –> Select a virtual disc, locate the Vboxguestadditions.iso in the VirtualBox installation directory, and load the image.
- Start the Linux system and log into the system as root
- Execute the Mount command to hang the virtual disc on to/mnt/cdrom, and if there is no CDROM directory, create it first.
The code is as follows: Mkdir/mnt/cdrom Mount/dev/cdrom/mnt/cdrom
- Copy the script to the/home directory
Cd/mnt/cdrom CP Vboxlinuxadditions.run/home Cd/home
./Vboxlinuxadditions.run
Reboot restart after installation
Environment Settings 1 font
Because of the lack of fonts, you explore the current desktop, you will find that the Chinese display is either garbled, or ugly, or can not be displayed.
Pacman-ss Font
Can be used to search the installation package containing font keywords, you can choose the installation of interest.
sudo pacman-s Ttf-dejavu Wqy-microheiwqy-zenhei
I'll just install these. By the way, the Ubuntu font is very beautiful oh, you can try.
2 Modifying the system language to Chinese
Set the Chinese locale separately in ~/.XINITRC or ~/.xprofile. Add the following to the most front-end comments for the above file (if you are unsure which file to use, add it):
Exportlang=zh_cn. UTF-8
Exportlanguage=zh_cn:en_us
Exportlc_ctype=en_us. UTF-8
Note : If you want to place this three lines in ~/.xinitrc, be careful to place them before the exec example_wm_or_de line; This is a common error;
Note : This method is suitable for slim or users without a login manager, and GDM and KDM users can select a language in GNOME or KDE settings.
Then copy the. XINITRC Home Directory
:
Vmware
Virtual Box
Virtual machine Installation ARCHLINUX+XFCE Desktop Tutorial (Updated on 2017-5-8)