ArchLinux installation

ArchLinux

Installation (installation)

Check the guide way

  • The present embodiment is divided into EFI boot + GPT partition table and boot BIOS (LEGACY) guiding two kinds + MBR partition table, almost relatively new machines have adopted the EFI / GPT guided manner
  • Input:

ls / sys / firmware / efi / efivars

  • If you are prompted:

ls: cannot access ‘/sys/firmware/efi/efivars’: No such file or directory

  • It shows that you are booting the BIOS, EFI way to otherwise guide

networking

  • arch offline and can not be installed because we need an Internet connection to download the required components, so we must first connect to the network.
  • If a wired network and router supports DHCP, then plug the Internet cable after first executing the following command to obtain an IP address:

dhcpcd

  • If a wireless network connection WIFI:

wifi-menu

  • an examination

ping -c 4 www.baidu.com

Update the system time

timedatectl set-ntp true

Hard disk partitioning and formatting

  • View the current regional situation

fdisk -l

Create the partition

Use cfdisk to partition
  • Select the first (gpt)
  • UEFI systems need to have ESP partition, it is recommended to mount the ESP / boot, when using UEFI, at least 512 MiB space
  • After using GPT partition on the system BIOS, the BIOS will require an additional installation GRUB boot partition
  • If you do not need to install dual system partition EFI partition (Windows is installed there will be, and need to be mounted under the boot directory)
  • ArchLinux not recommended swap partition recommended swap file

Format the partition

  • Format the primary partition

mkfs.ext4 /dev/sda1

  • Format the EFI partition

mkfs.vfat /dev/sda2

Mount the partition

  • First, the root partition mounted on / mnt

mount /dev/sda1 /mnt

  • If you use multiple partitions, you also need to create a directory other partitions and mount them (/ mnt / boot, / mnt / home, ......) to
  • If EFI / GPT guided mode
mkdir /mnt/boot
mount /dev/sdxY /mnt/boot (将sdxY替换为之前创建或是已经存在的引导分区)
  • BIOS / MBR boot mode without this step.
  • Next genfstab will automatically detect the mounted file system and swap partitions

install the system

Replace domestic sources

  • Edit next file

vim /etc/pacman.d/mirrorlist

  • The list of domestic sources on the front (precedence)
  • Press "2dd" Cut down two lines, press gg back to the first file, press p to paste
  • : Wp save and exit

Install the basic package

  • Use pacstrap script installation base group

pacstrap /mnt base

  • This group does not include all the procedures in a live environment, some require additional installation

pacstrap -i /mnt base base-devel

  • This package contains the components needed to develop

Configuration Fstab

  • Generating automatically mount the partition fstab file (-U or -L options provided by UUID or label) with the following command:

genfstab -U /mnt >> /mnt/etc/fstab

  • After executing the above command, after check the resulting file is correct

cat /mnt/etc/fstab

Chroot

  • Change root to the newly installed system:

arch-chroot /mnt

  • If there is a problem after the system, simply insert U disk and start the system root partition to be mounted under / mnt (if efi partition should be mounted to the next / mnt / boot), and then through this command you can enter repair the system operation

Set the time zone

ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

  • Hwclock to generate run / etc / adjtime

hwclock --systohc

Setting local

nano /etc/locale.gen

  • Canceled the following two comments
  • en_US.UTF-8, UTF-8
  • zh_CN.UTF-8 UTF-8
  • Locale-gen is then performed to generate a message locale

locale-gen

  • Locale.conf create and edit: LANG variable

echo LANG = en_US.UTF-8> /etc/locale.conf

  • This setting is not recommended in any Chinese locale, or cause garbled tty

Set the host name

echo ArchLinux > /etc/hostname
nano /etc/hosts
# 输入
127.0.0.1	localhost
::1		    localhost
127.0.1.1	ArchLinux.localdomain	ArchLinux

Root Password

passwd

Add logged in user

  • Add wheel user group here is to be able to provide the right to use sudo

useradd -m -g users -G wheel -s /bin/bash rain

  • set password

passwd rain

  • Install vim

pacman -S vim

  • Finally, set the user group wheel can use sudo to gain root privileges:

visudo

  • After removal Note #% wheel ALL = (ALL) ALL preservation

Network Configuration

pacman -S iw wpa_supplicant dialog networkmanager

Installation Intel-ucode (non IntelCPU can skip this step)

pacman -S intel-ucode

Install the boot program Grub2

  • Os-prober install this package, it can be detected with Grub existing system, automatic setting start options

pacman -S os-prober

  • A single system can be disturbed

If BIOS / MBR boot mode:

  • Install grub package:

pacman -S grub

  • Deployment grub:

grub-install --target = i386-pc / dev / sdx (sdx into the installed hard disk)

  • Note here sdx be hard (e.g. / dev / sda), not shaped like such a partition / dev / sda1.
  • Generate a configuration file:

grub-mkconfig -o /boot/grub/grub.cfg

  • 如果报warning failed to connect to lvmetad,falling back to device scanning.错误
  • /Etc/lvm/lvm.conf edit this file, will find use_lvmetad = 1 0 1 modify, save, reconfiguring grub

If the boot mode is EFI / GPT:

  • And two grub installation package efibootmgr

pacman -S grub efibootmgr

  • Set the startup directory, and set the boot program ID. ESP mount the partition, for example, to mount / boot or / boot / efi. The following command esp_mount mount point is modified (usually / boot)

grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=grub

  • Generate the master configuration file

grub-mkconfig -o /boot/grub/grub.cfg

  • 如果报warning failed to connect to lvmetad,falling back to device scanning.错误
  • /Etc/lvm/lvm.conf edit this file, will find use_lvmetad = 1 0 1 modify, save, reconfiguring grub
  • If the message grub-probe: error: can not find a GRUB drive for / dev / sdb1, check your device.map similar mistakes, and sdb1 this place is your u disk, u disk uefi this is the wrong partition due to our does not affect the normal installation, you can ignore this error

an examination

  • Check successful generation of each inlet system

cat /boot/grub/grub.cfg

  • Check whether the part near the end menuentry have windows or other system name entry
  • If you do not see the Arch Linux system entry or the file does not exist, please check the / boot directory is correct deployment of linux kernel:

ls /boot

  • See if there initramfs-linux-fallback.img initramfs-linux.img intel-ucode.img vmlinuz-linux these files
  • If not, explain linux kernel is not properly deployed, most likely / boot directory is not properly mounted due to confirm the / boot directory correct, you can re-deploy linux kernel:

pacman -S linux

  • And then rebuild the configuration file, you can find the system entry
  • It is now possible under U disk installation environment can not be detected at the entrance to other systems, please visit the re-run after the restart in the next step:

grub-mkconfig -o /boot/grub/grub.cfg

Restart

systemctl enable dhcpcd

  • Exit chroot environment

exit

  • Is mounted partitions manually uninstall

umount -R /mnt

  • Restart

reboot

networking

  • If you are a cable network and router supports DHCP, then plug the Internet cable after first executing the following command to obtain an IP address:

dhcpcd

  • Wi-Fi

wifi-menu

  • or

systemctl enable dhcpcd

  • View Card

ip link

  • Use ens32

ip link set ens32 up

  • Restart

Create a swap file

  • Before usually a single swap partition as a way, and now the recommended way of using the swap file, more manageable
  • Allocate a space for the swap file:

fallocate -l 2G / swapfile (2G set into desired size, only units with M or G)

  • The size of the swap file can decide for yourself, we recommend the following 4G of physical memory, the swap file is consistent with the physical memory more than 4G of physical memory, swap file 4-8G
  • Change Permissions

chmod 600 /swapfile

  • Setting the swap file

mkswap /swapfile

  • Enable swap file

swapon /swapfile

  • Finally, you need to edit / etc / fstab set up an entry for the swap file

nano /etc/fstab

  • Direct add the following new line at the end:

/swapfile none swap defaults 0 0

Delete the swap file

  • If you want to delete a swap file, you must first disable it

swapoff -a

  • You can then delete it

rm -rf /swapfile

  • Finally, to remove the entry from / etc / fstab in

Pre-configured network

  • It has been used before netctl this comes with network services, desktop environment using NetworkManager this network service, so we need to disable and enable netctl NetworkManager:
sudo systemctl disable netctl
sudo systemctl enable NetworkManager (注意大小写)

Installing the Desktop environment

install driver

  • Enter the following command to see all the open source graphics drivers

pacman -Ss xf86-video

  • Mounting corresponding driving
  • Nvidia's independence was driving unless absolutely necessary, it is recommended only installed integrated graphics driver (power, if installed at the same time also use integrated graphics default), not prone to conflict

pacman -S nvidia

  • Touchpad driver

pacman -S xf86-input-synaptics

Install Xorg

  • Xorg is a well-known open source graphic services under Linux, some desktop environment needs the support of Xorg

sudo pacman -S xorg

Xfce

sudo pacman -S xfce4 xfce4-goodies

KDE (Plasma)

sudo pacman -S-wherein the plasma-applications where l10n-zh_cn

Installing the Desktop Manager

  • After installing the desktop environment package, we need to install a graphical desktop manager to help us to log in and select the desktop environment we use, we recommend sddm

sudo pacman -S sddm

  • Set boot sddm Service

sudo systemctl enable sddm

Deepin

installation

pacman -S deepin deepin-extra

Start Deepin desktop environment
  • Using the login manager
  • deepin default lightdm greeter is lightdm-deepin-greeter, can be installed by pacman
  • After installation you want to edit /etc/lightdm/lightdm.conf, modified:

greeter-session=lightdm-deepin-greeter

  • start up

systemctl enable lightdm.service

Add Source

sudo vim /etc/pacman.conf

  • First, remove the comment multilib in two lines
  • Add the following text at the end of the document:
[archlinuxcn]    
SigLevel = Optional TrustAll
Server = http://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch
# 这是清华的,也可用下面中科大的
Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch
  • Save and exit, refresh the pacman database

sudo pacman -Syy

Installation of common software
  • Chinese font

sudo pacman -S adobe-source-han-serif-cn-fonts

  • Sound Card

sudo pacman -S alsa-utils

  • Command line completion

sudo pacman -S bash-completion

  • chrome

sudo pacman -S google-chrome

  • Netease cloud music

sudo pacman -S netease-cloud-music

  • sogou Input

sudo pacman -S Fcitx sogoupinyin Fcitx Configtool

  • Configure input methods

vim .xprofile

  • Entry
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx
  • Save and restart
  • WPS

sudo pacman -S wps-office ttf-wps-fonts

Guess you like

Origin blog.csdn.net/qq_36427929/article/details/88842836