Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Sample Analysis of ArchLinux 2020 installation

2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article shows you a sample analysis of the installation of ArchLinux 2020, which is concise and easy to understand. I hope you can gain something through the detailed introduction of this article.

Summary of ArchLinux 2020 installation

2020-4-1

This year I began to fully use the ArchLinux system, this system is relatively small, the installation process to control more content, reduce a lot of unnecessary trouble, but also more in line with my own habits. I like it best for three reasons:

ArchLinux source is very perfect, easy to use, can solve a lot of partial door problems (compared to centos), such as my Apple MAC mini wireless network card, Bluetooth driver problems, can be solved in ArchLinux.

ArchLinux has a dedicated Chinese source-ArchLinuxcn, which is a welfare for Chinese people, and many software we are used to can be found here, such as Sogou Pinyin input method.

ArchLinux's wiki is perfect and has a Chinese translation, and many questions can be found there.

I not only installed it on MAC mini, but also installed ArchLinux system on my Thinkpad notebook and DIY desktop, which is very easy to use. My MAC mini last time did not install the wireless network card driver, Bluetooth driver, I did not get it right, and the network card was messed up, so this time I reinstalled the ArchLinux system on MAC mini. This time I used ArchLinux 2020-02-01. The installation process is somewhat different from the ArchLinux 2018-01-01 recorded last time.

Preparatory work

Download ArchLinux and record it to U disk (tentatively / dev/sdb). All partitions on U disk should be deleted before burning and burn directly:

# dd if=/path/to/archlinux-x86_64-2020.02.01.iso of=/dev/sdb bs=4M system installation

Insert the burned U disk into the computer and choose to boot from U disk when starting. For MAC mini, keep pressing the Alt key when you boot, and choose to boot from U disk:

Press the default entry to enter the system installation interface, and then enter a started ArchLinux Live system. Take this as a starting point to install the ArchLinux system, and then complete the following:

Set the keyboard layout and press the default layout

Verify startup mode

# ls / sys/firmware/efi/efivars

The files in this directory are in EFI startup mode, while MAC mini and other computers are started in EFI mode.

When you connect to the Internet, there is no wireless network card to drive MAC mini. You can only use your mobile phone to open hotspots and share the network through USB. The effect on MAC mini is as follows:

# ip addr show / / you can see the network interface shared by mobile phone through USB-enp0s20u8# dhcpcd enp0s20u8

Update system time

# timedatectl set-ntp ture

Create a disk partition, either fdisk or parted. Note when partitioning: / and / usr need to be on a partition, otherwise an error will be reported and the system cannot start normally; EFI startup mode requires ESP partition, which is not too large, 128MB is fine, and must be formatted into FAT format. If you install multiple systems, you need to install other systems (MAC OS X _ ArchLinux) before installing Windows, and don't touch the partitions of other systems during the installation process.

# mkfs.vfat-F 32 / dev/sda4 # mkfs.ext4 / dev/sda5# mkfs.ext4 / dev/sda6# mkfs.ext4 / dev/sda7# mkfs.swap / dev/sda8...

To mount disk partitions, you need to mount them sequentially. Mount / partition first, and then mount other partitions under /. Enable swap partition:

# mount-t ext4 / dev/sda7 / mnt / / Mount the / partition to the / mnt directory of the ArchLinux Live system as the root partition of the new system # mkdir / mnt/boot / mnt/home# mount-t ext4 / dev/sdb6 / mnt/home / / boot, home must be established in the mnt directory, and after mounting / partition, the # mount-t ext4 / dev/sdb5 / mnt/boot# mkdir / mnt/efi / / efi directory must be established in the / mnt/boot directory And after / mnt/boot mounts the disk # mount-t vfat / dev/sda4 / mnt/boot/efi# swapon / dev/sda8 / / starts the swap partition

The mounting process must be carried out sequentially, otherwise the directory will only be established in the directory of the Live system, or mounted in the directory of the Live system. If the operation is in the Live system, everything will not be written to disk after shutdown, and the system must not be installed correctly. The ESP partition must also be mounted in the efi directory under the / dev/sda5 partition (mounted in the / boot directory), otherwise it cannot be started.

Select the mirror source, edit / etc/pacman.d/mirrorlist file, keep the Chinese source, and delete everything else.

# vim / etc/pacman.d/mirrorlist

Check to see if the fstab file can be generated properly, and if you continue the installation process normally, otherwise the installation process will be invalid:

# genfstab-U / mnt

Check whether several partitions in the output: /, / home, / boot, / boot/efi, swap are mounted normally, and if the mount is abnormal, re-check whether there is an error in the disk partition and mount process.

Install the basic system:

# pacstrap / mnt base linux linux-firmware

Generate the fstab file:

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

Chroot enters the new system

# arch-chroot / mnt

Install the necessary software:

# pacman-S dhcpcd vim / / vim is used below. Dhcpcd is required to connect to the network after reboot.

Set time zone and clock

# ln-sf / usr/share/zoneinfo/Asia/Shanghai / etc/localtime# hwclock-- systohc

Localization settings, only English characters should be set when there is only a terminal environment, and Chinese characters cannot be displayed at this time:

# vim / etc/locale.gen / / keep only the following en_US.UTF-8 UTF-8 zh_CN.UTF-8 UTF-8# locale-gen# echo LANG=en_US.UTF-8 > / etc/locale.conf

Set the root password:

# passwd root

Set the host name:

# echo Arch > / etc/hostname / / my system name: Arch# vim / etc/hosts / / add the following: 127.0.0.1 Arch:: 1 localhost 127.0.1.1 Arch.localdomain Arch

Initramfs regeneration is generally not required, and I did not perform this step:

# mkinitcpio-p linux

Install grub, intel-ucode, efibootmgr and generate startup scripts:

# pacman-S grub efibootmgr# grub-install-- target=x86_64-efi-- efi-directory=/boot/efi-- bootloader-id=grub# pacman-S intel-ucode# grub-mkconfig-o / boot/grub/grub.cfg

After the system is installed, exit chroot, unmount the file system in the / mnt directory, and restart the Live system:

# exit / / Settings after exiting chroot# sync# umount-R / mnt# sync# shutdown-r now installation

After the system reboot, choose to boot from the hard disk, enter the newly installed ArchLinux system at this time, and make the settings after installation.

Add user

# groupadd coder# useradd-g coder-m coder / /-g coder join the coder group, and-m create / home/coder directory as coder user home directory # passwd coder

Install and enable the gnome desktop environment:

# pacman-S gnome# systemctl enable gdm.service / / enable gnome desktop environment # shutdown-r now

Prompt to install a lot of software, just put evince (PDF browser), gnome-photos (picture manager), eog (picture viewer), gnome-terminal, gnome-setting (settings), gnome-keyring, gnome-control-center (management center), gdm (graphics launcher) gnome-menus (gnome menu), nautilus (graphical management file program, similar to windows folder), you can choose these software. Other software is automatically installed based on dependencies.

You should be able to see the normal desktop environment at this time, but it is all in English and you need to install Chinese fonts:

# pacman-S tty-arphic-ukaisettings- > zone&language-> add Chinese, Chinese input method

Logout from gnome, log in again, it should be a Chinese environment.

Install wireless network card and Bluetooth driver.

# lspci / / looking at all PCI devices, you can see that Broadcom BCM4360 802.11AC Wireless Network Adapter..., can see the specific model of BCM4360 [14e4:43a0]. # / / the driver module corresponding to this model is broadcom-wl. Is the module in the comunity library # pacman-S broadcom-wl / / very simple? remember that it is not so simple in ArchLinux 2018. It is even more impossible to install # shutdown-r now / / in centos. After rebooting, you will see the wireless network card.

Install the tmux splitter:

# pacman-S chromium# pacman-S tmux# vim / etc/tmux.conf / / add the following content # Turn off the status line. Set- g status off # Change the prefix keys from Cmurb to Alt-x unbind Cmurb set- g prefix Mlyx # Change the prefix'%'to'-'to split windown horizon unbind% bind-split-window-v # Change the prefix'"'to'\'to split window vertical unbind'" bind\\ split-window-h # Set windown control mode to vi set-window-option-g mode-keys vi

Enable the archlinuxcn source:

# vim / etc/pacman.conf / / add the following under the [comunity] column: [archlinuxcn] Include = / etc/pacman.d/archlinuxcn Architecture = x86room64 / / change the original auto to my own x86room64 architecture # vim / etc/pacman.d/archlinuxcn / / add the following source # # China Server = http://mirrors.163.com/ Archlinux-cn/x86_64 # # China Server = http://mirrors.zju.edu.cn/archlinuxcn/x86_64 # # China Server = http://mirrors.cqu.edu.cn/archlinuxcn/x86_64 # # China Server = http://mirrors.neusoft.edu.cn/archlinuxcn/x86_64 # # China Server = http://mirror.lzu.edu.cn/archlinuxcn/x86_64# pacman-Sy / / Update the source file # pacman-S archlinuxcn-keyring / / start the ArchLinuxcn source

Install Pinyin input method

# pacman-S # pacman-S fcitx-lilydjwg-git fcitx-sogoupinyin# pacman-S fcitx-configtool fcitx-qt5# vim / etc/environment / / add the following content GTK_IM_MODULE=fcitx QT_IM_MODULE=fcitx XMODIFIERS= "@ im=fcitx"

If you do not want to use sogou input method, you can also install rime input method. It is said that this is a better input method framework. Do not install the fcitx framework at this time, install the ibus framework.

# pacman-S ibus ibus-rime / / just after installing rime, you need to set up the Chinese input method. I choose the Mingyue Pinyin input method # vim. Bashrc / / add the following three lines to set the Chinese input method to ibus frame export GTK_IM_MODULE=ibus export XMODIFIERS=@im=ibus export QT_IM_MODULE=ibus / / when you start using ibus-rime, you default to traditional Chinese. Need to change to simplified Chinese # vim / home/coder/.config/ibus/rime/build/default.yaml schema\ _ list:\-schema: luna\ _ pinyin\ _ simp / / this is simplified Pinyin, put it on the first line\-schema: luna\ _ pinyin

Install Baidu brain map and chromium browser

# pacman-S desktop-naotu# pacman-S chromium# echo alias naotu='desktop-naotu' > > / etc/bash.bashrc

Set the MAC OS X.P. Windows startup entry:

# vim / etc/grub.d/40_custom menuentrt 'MAX OS X' {exit} menuentry' window 7' {insmod part_gpt insmod fat set root='hd0,gpt1' / / windows partition chainloader / EFI/Microsoft/Boot/bootmgfw.efi} # grub-mkconfig-o / boot/grub/grub.cfg

Set up a wired network card

# vim / etc/systemd/network/name-of-network-adpter.network [Match] Name=enp3s0 [Network] Address=192.168.1.3/24 Gateway=192.168.1.254 # systemctl restart systemd-networkd.service / / restart the network service, and the Nic configuration file takes effect immediately

Adjust the normal user bash prompt from'$'to'>'

# vim ~ / .bashrc PS1=' [\ u@\ h\ W] >

Add keyboard shortcuts settings-> keyboard shortcuts:

Set the F1 system settings, F2 chromium browser, F3 gnome-terminal,F6 home directory

Install git, gitbook

# pacman-S git nodejs npm# npm install-g gitbook# npm install-g gitbook-cli / / an error was reported at this time, / usr/bin/gitbook already exists. # rm / usr/bin/gitbook# npm install-g gitbook-cli# gitbook- V / / the command CLI version 2.3.2 Installing Gitbook 3.2.3 TypeError: cb.apply is not a function should be executed in a networked environment. At / usr/lib/node_modules/gitbook-cli/node_modules/npm/node_modules/graceful-fs/polyfills.js / / I don't know exactly why, but there seems to be an inconsistency between the nodejs version, the npm version, and the Gitbook version. # vim / usr/lib/node\ _ modules/gitbook-cli/node\ _ modules/npm/node\ _ modules/graceful-fs/polyfills.js / / comment out 62-64 3 lines of code / / fs.stat=statFix (fs.stat) / / fs.fstat=statFix (fs.fstat) / / fs.lstat=statFix (fs.lstat) # gitbook- V / / The first execution of the command requires networking # gitbook serve / / the first execution of the command requires networking Also slow # vim book.json / / under the directory where the document is written {"title": "XXX", "author": "Gitbooker", "description": "Write", "plugins": [/ / add plug-in "chapter-fold" / / directory folding plug-in "todo" / / list to-do plug-in]} # gitbook install / / plugin added to the configuration file The command needs to be executed

Installation man manual, Chinese man manual:

# pacman-S man-pages# pacman-S man-pages-zh\ _ cn

Command line to connect to the wireless network

# pacman-S wpa\ _ supplicant/ / install the wireless connection software # wpa\ _ passphrase SSID Password > / etc/wpa\ _ supplicant/SSID.conf# ip link set wlp2s0 up# wpa\ _ supplicant-B-I wlp2s0-c / etc/wpa\ _ supplicant/SSID.conf# dhcpcd wlp2s0

You can also write a shell script to do this.

#! / bin/bash if [$UID-ne 0]; then echo "Permission denied, only root can execute this script." Exit fi ip link set wlp2s0 up wpa_supplicant-B-I wlp2s0-c / etc/wpa_supplicant/MATE9.conf dhcpcd wlp2s0 exit

Enable Bluetooth connection:

# systemctl enable bluetooth.service

Set gnome-terminal: I personally like tty-liberation font very much, but I don't know why it can't always be used normally in terminal, so I chose Source Code Pro Regular, but after comparison, Source Code Pro Regular and Liberation Mono Regular glyphs are very similar, but the line spacing is larger, so I choose to use Source Code Pro Regular. This font basically meets my needs, the font size is 14, the color is green on a black background, and the scrolling option does not show the scroll bar. These are my habits.

If gnome-termianl does not support Source Code Pro Regular fonts, install gnome-tweaks optimization. # pacman-S gnome-tweak

Turn on optimization and set Source Code Pro Regular in the font bar. At this point, do not select the optional font in gnome-terminal, and automatically apply the font and font size in gnome-tweaks.

Adjust the gnome-terminal color match:

Gnome-terminal-> profile preferences-> Color-> Green words on black background

Set the terminal ls color to distinguish between various files

# vim / etc/bash.bashrc alias ls= `ls-- color= auto`

Set ssh to allow other machines to log in to this machine in ssh mode

# systemctl enable sshd.service / / enable the service, and the next restart takes effect # systemctl start sshd.service / / start the service immediately # systemctl status sshd.service / / check the service status

Read mobile phone files the phone connects to the computer in MTP mode, and the computer supports reading MTP device files.

# pacman-S mtpfs android-file-transfer

Set up iptables Firewall

# systemctl disable iptables.service / / turn off the firewall and turn off the above content by default is the example analysis of ArchLinux 2020 installation. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report