This document records the first time arch linux was tossed on win10
- Disks booted for BIOS
II. Installation process
1. installation package
- arch linux version: in arch linux official Eureka Tsinghua University Open Source Software Mirror Station The version I downloaded is archlinux-2018.04.01-x86_64.iso
- Install media making tools: usbwriter
2. Disk preparation
- It was originally installed with ubuntu 16.04 LTS, which was deleted and then left with 200G.
3. U Disk Installation
3.1 Enter Linux System
Reboot to find the shortcut keys for your computer to enter BIOS (F2, F10, F12 or whatever, press and try, it's really not good to google)
Choose your own U disk as the boot item
Select Boot Arch Linux (x86_64)
If all goes well, it will enter an interface with only command prompts:
Arch Linux 4.15.14-1-ARCH(tty1) archiso login: root (automatic login) root@archiso ~ # _
So far, it has successfully entered arch linux
3.2 Check Guidance Mode
root@archiso ~ # ls /sys/firmware/efi/efivars ls: cannot access '/sys/firmware/efi/efivars': No such file or directory
The above output indicates booting in BIOS mode, otherwise EFI
Wired (my laptop has no internet interface and can only be wireless ==)
I use wifi-menu to input directly from the command line. It can open a visual interface. It's easy to operate.
If you want to change wifi, assume that the name of the WiFi memory you are currently connected to is XWIFI (don't tell me you forgot, there will be a default ==), which can be found in the directory of / etc/netctl. If you don't want to delete it, right?
root@archiso ~ # rm -rf /etc/netctl/XWIFI
- Network state detection: a necessary tool for scientific Internet access. If google is helping you search, baidu is helping you to detect the network state.
root@archiso ~ # ping www.baidu.com
3.4 Update System Time
root@archiso ~ # timedatectl set-ntp true
No news is the best news.
3.5 (FBI WARNING) Partitioning and Formatting
Be careful with this part of the operation.
root@archiso ~ # fdisk -l Disk /dev/nvme0n1: 477 GiB， 512110190592 bytes, 1000215216 sectors ... ... Device Boot Start End Sectors Size Id Type /dev/nvme0n1p1 * 4096 209965055 209960960 100.1G 7 HPFS/NTFS/exFAT /dev/nvme0n1p2 209965056 629395455 419430400 200G 7 HPFS/NTFS/exFAT
/ dev/nvme0n1p1 is the boot partition of win10, and / dev/nvme0n1p2 has a lot of space after its End, which is the unallocated space for arch linux
Create boot partitions
BIOS skip over
Create a root partition
- My hard drive is not entirely new, so if your hard drive is entirely new, you must Reference text Establish
- In addition, it should be noted that if your unallocated space is between the two partitions, you must be optimistic about Start and End when entering the start and end sectors, rather than knocking back by default.
- If you have any wrong operation before entering w, you can exit directly by entering q, so that the wrong operation will not be saved. But if you've already entered w, find your own way.
Format the partition you just created
See clearly what your partition is called, don't knock on commands.
root@archiso ~ # mkfs.ext4 /dev/nvme0n1p3
md made a mistake... I don't know exactly why. It's okay. You haven't got anything yet. Go back to win10 and reformat the partition. This time I chose to connect / dev/nvme0n1p1 with / dev/nvme0n1p2, but in principle this thing has no effect.
3.6 mount partition
See clearly what your partition is called, don't knock on commands.
This is the BIOS boot command
root@archiso ~ # mount /dev//dev/nvme0n1p3
3.7 Selection of Mirror Source
The choice of mirror source needs to be decided according to its own region. I believe that most of the articles we read are in P.R. China region, so we choose it. Source of Tsinghua University
root@archiso ~ # vim /etc/pacman.d/mirrorlist Server = http://mirrors.tuna.tsinghua.edu.cn/archlinux/$repo/os/$arch
wq saves and exits
3.8 Installation Basic Package
This step is to install the most basic Arch Linux package, which requires networking
root@archiso ~ # pacstrap /mnt base base-devel
3.9 Configure fstab
Generate fastab files for automatic mounting partitions
root@archiso ~ # genfstab -L /mnt >> /mnt/etc/fstab
The console has no output. You need to check whether the output generated files are correct:
root@archiso ~ # cat /mnt/etc/fstab # Static information about the filesystems. # See fstab(5) for details. # <file system> <dir> <type> <options> <dump> <pass> # /dev/nvme0n1p3 UUID=... # /dev/nvme0n1p3 / ext4 rw,relatime,data=ordered 0 1
Be careful to check if your new partition is mounted on the root partition
3.10 Chroot(Change root)
root@archiso ~ # arch-chroot /mnt
This step gives control to the newly installed Linux system, where future operations will take place. In addition, if there is a problem with the system in the future, you just need to re-insert the U disk to boot, mount the root partition of the system to / mnt, and enter this command to repair the system.
After execution, the terminal will be found to be like this:
3.11 Setting Time Zone
[root@archiso /]# ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime [root@archiso /]# hwclock --systohc
3.12 According to some essential software packages
There is a very powerful package management tool under ArchLinux, pacman. The installation command format is pacman-S package_name.
[root@archiso /]# pacman -S vim dialog wpa_supplicant ntfs-3g networkmanager
It's reasonable to confirm it all the way.
3.13 Setting Language Options
[root@archiso /]# vim /etc/locale.gen
Remove the # in front of the following four languages in the file:
- en_US.UTF-8 UTF-8
- zh_CN.UTF-8 UTF-8
- zh_HK.UTF-8 UTF-8
- zh_TW.UTF-8 UTF-8
Preserve and withdraw, and make it effective:
[root@archiso /]# locale-gen Generating locales... en_US.UTF-8 UTF-8... done zh_CN.UTF-8 UTF-8... done zh_HK.UTF-8 UTF-8... done zh_TW.UTF-8 UTF-8... done
Configure the default language:
[root@archiso /]# vim /etc/locale.conf 1: LANG=en_US.UTF-8
Save and exit
3.14 Setting Host Name
[root@archiso /]# vim /etc/hostname 1: jasonchan
The first line enters the host name you want to set, saves and exits. Then edit / etc/hosts:
[root@archiso /]# vim /etc/hosts 127.0.0.1 localhost.localdomain localhost ::1 localhost.localdomain localhost 127.0.1.1 jasonchan.localdomain jasonchan
Save and exit
3.15 Setting the root password
[root@archiso /]# passwd
Just set this up by yourself. Notice that the beginning of # in the terminal indicates that the command is executed as root. The normal user identity is$
3.16 Install Intel-ucode (for Intel CPU)
[root@archiso /]# pacman -S intel-ucode
3.17 Install Bootloader (boot for BIOS)
Install os-prober to cooperate with grub to detect existing systems and automatically set startup options
[root@archiso /]# pacman -S os-prober
[root@archiso /]# pacman -S grub
Note that the last item is the disk name, not the partition name just delimited.
[root@archiso /]# grub-install --target=i386-pc /dev/nvme0n1 Installing for i386-pc platform. Installation finished. No error reported.
Generate configuration files
[root@archiso /]# grub-mkconfig -o /boot/grub/grub.cfg grub-probe: error: cannot find a GRUB drive for /dev/sda1. Check your device.map. Found Windows 10 on /dev/nvme0n1p1
Reported the above error, it is said that restart and enter this command again, it is true for me, but after restart must be pulled out of the U disk, the error reported is / dev/sda1, this partition on the U disk.
Check if the installation is successful
[root@archiso /]# vim /boot/grub/grub.cfg
The partition where win10 is located can be found at the end of the file
If there are other errors to refer to Here
[root@archiso /]# exit [root@archiso /]# reboot
1. Necessary configuration
1.1 Connection Network
Note that your current system is not so malpracticed. Every time you boot it, you have to manually connect to the Internet, and even re-enter your password.
[root@archiso /]# dhcpcd
[root@archiso /]# wifi-menu
1.2 Create Exchange Files
Swap files can temporarily store part of the memory in the swap file when the physical memory is insufficient, so as to avoid the system stopping working completely because of the lack of memory. In the past, we usually used to use a separate partition as the exchange partition, but now we recommend the exchange of files, which is more convenient for our management.
[root@archiso /]# Fallocate-l 512M/swapfile (allocation of swap space) [root@archiso /]# Chmod 600/swapfile (change permissions) [root@archiso /]# Mkswap/swapfile (Setting Exchange File) Setting up swapspace version 1, size = 512 MiB (536866816 bytes) no label, UUID=... [root@archiso /]# Swapon/swapfile (switch file enabled) [root@archiso /]# Vim/etc/fstab (Setting the Entry for Exchange Files)
Finally, add a new line of input / swapfile none swap defaults 0 0
1.3 New Users
[root@archiso /]# useradd -m -G wheel jasonchan
- - m: Creating a folder with the same name as the user name in the / home directory at the time of creation has the following advantages:
- As long as the home directory remains unchanged, after reinstalling the system, you only need to reinstall the packages (they are not normally stored in the home directory), and then all the configurations will be read from the home directory.
- You can change the distribution without having to reconfigure the environment with the same home directory.
- After switching users, all settings will be read from the new user's home directory, and the data of different users will be completely isolated from the software settings.
- Some well-known configuration files, such as vim configuration file ~/.vimrc, can be completely restored by configuring it once according to your own usage habits and copying it to your home directory on another Linux system, such as your server.
- - G: Add users to a group
- wheel: group name, and then why you joined this group
[root@archiso /]# passwd jasonchan
1.4 Install and configure sudo
[root@archiso /]# pacman -S sudo
[root@archiso /]# visudo
Used specifically for editing sudo configuration files, can help check the format of the file, find% wheel ALL=(ALL)ALL to remove # comments, save and exit.
This step assigns sudo privileges to all users in the wheel group
2. Graphical Interface
2.1 Install Video Card Driver
Most computers are Intel centralized display (not centralized display is also recommended to be driven by centralized display installation), and NVIDIA's unique driver is not a necessity. If the set driver can't be installed, try the stand-alone one.
[root@archiso /]# sudo pacman -S xf86-video-intel
2.2 Installation of Graphics Services
Desktop environment needs the support of graphics service. Here, choose open source graphics service xorg and install all its components.
[root@archiso /]# sudo pacman -S xorg
2.3 Install Desktop Environment
If you want to choose for yourself, you can refer to it. Here . This article only introduces xfce and KDE(Plasma)
[root@archiso /]# sudo pacman -S xfce4 xfce4-goodies
[root@archiso /]# sudo pacman -S plasma kde-applications kde-l10n-zh_cn
Either of the above two can be installed. The default is KDE. After installation, we need to install the desktop manager. Here we use sddm, which can help us log in and choose the desktop environment.
[root@archiso /]# sudo pacman -S sddm [root@archiso /]# Sudo system CTL enable SDDM
2.4 Configuration Network
It's better to execute before installation and restart.
In the absence of a graphical interface, the network configuration service we use is netctl. With a desktop environment, we can use Network Manager.
[root@archiso /]# Sudo system CTL disable netctl (disable netctl) [root@archiso /]# Sudo system CTL enable network manager [root@archiso /]# sudo pacman -S network-manager-applet
At this point, restart the computer and you can choose the graphical interface and user login.
4. Custom Installation Package