ArchLinux installation tutorial

ArchLinux installation tutorial

Preparation before installation

Get the installation image

Visit the download page and obtain the ISO file or netboot image and the corresponding GnuPG signature depending on the desired boot method .

Verify signature

It is recommended to verify the signature of downloaded files before use, especially files downloaded from HTTP mirror sources , because HTTP connections are generally easy to be intercepted and provide malicious mirrors .

On a system that has GnuPG installed , you can download the PGP signature ( under Checksums on the download page ) to the path where the ISO file is located, and then verify the signature using the following method :

$ gpg --keyserver-options auto-key-retrieve --verify archlinux-*version*-x86_64.iso.sig

In addition, on a computer that has Arch Linux installed, it can be verified in the following ways:

$ pacman-key -v archlinux-*version*-x86_64.iso.sig

Notice:

Prepare installation media

Installation images are available to the target machine via USB flash drive , CD-ROM and network with PXE : please prepare the installation media with an image that suits you.

Boot into Live environment

Notice:

Arch Linux installation images do not support Secure Boot.

To boot the installation media, Secure Boot needs to be disabled .

If necessary, you can reconfigure Secure Boot after completing the installation .

  1. To choose to boot from the media with the Arch installation file, you usually need to press a certain button during the computer's power-on self-test , and there will usually be a prompt on the startup screen. Please refer to the motherboard manual for specific conditions.

  2. When the bootloader menu appears, select Arch Linux install medium and press Enterto enter the installation environment.

    hint:

    The installation image boots UEFIusing mode and boots in mode .GRUBBIOSsyslinux

  3. Will rootlog in to a virtual console as , the default Shellis Zsh.

If you want to install and use Lynxthis guide at the same time, you can use Alt+*箭头* shortcut keys to switch between different consoles.

To edit the configuration file, use mcedit(1) , nanoand vim.

Console keyboard layout

The console keyboard layout defaults to us(US keymap).

To list all available keyboard layouts, use:

# ls /usr/share/kbd/keymaps/**/*.map.gz

If you want to change the keyboard layout, add the corresponding file name to loadkeys(1) , but omit the path and extension.

For example, to add a German keyboard layout:

# loadkeys de-latin1

The console font is located /usr/share/kbd/consolefonts/in the directory. For setting methods, please refer to setfont(8) .

Verify boot mode

To verify boot mode, list the efivars directory with the following command:

# ls /sys/firmware/efi/efivars

If the command results show the directory and no errors are reported, the system boots in UEFI mode.

If the directory does not exist, the system may boot in BIOS mode (or CSM mode).

If the system does not boot in the desired mode, please refer to the motherboard manual.

Connect to the Internet

To configure network connectivity in a Live environment, follow these steps:

  • Make sure the network interface is enabled on the system , check with ip-link(8) :

    # ip link
    

    For Wireless LAN (Wi-Fi) and Wireless Wide Area Network (WWAN), make sure the network card is not disabled by rfkill .

  • To connect to the network:

    • Wired Ethernet - Connect the network cable.

    • WiFi - Use iwctl to verify wireless networks.

      • iwdThe software package provides client programs iwctl, daemons iwd, and WiFi monitoring tools iwmon. Activate/enable iwd.service so that it can iwctlbe controlled using . iwctlThe daemon can be started with the following command iwd:

        # systemctl start iwd
        

        Or use the following command to start iwctlthe daemon iwd:

        # systemctl start iwd.service
        

        To enter the interactive prompt, execute:

        $ iwctl
        

        The interactive prompt will then [iwd]#be displayed with the prefix.

        hint:

        iwctlIn the prompt, you can use Tabthe key to automatically complete commands and device names.

        To exit the interactive prompt, press Ctrl+dto send the EOF signal.

        All commands can be used as command-line arguments without entering an interactive prompt.

        For example: iwctl device wlp3s0 show.

        Connect to the network :

        First, if you don't know the network device names, list all WiFidevices:

        [iwd]# device list
        

        Second, to scan the network, execute:

        [iwd]# station <device> scan
        

        Again, all available networks can be listed:

        [iwd]# station <device> get-networks
        

        Finally, to connect to a network:

        [iwd]# station <device> connect <SSID>
        

        If a network password is required, the user will be prompted to enter it.

        In addition, the connection operation can be applied as a command line parameter:

        $ iwctl --passphrase <passphrase> station <device> connect <SSID>
        

        Notice:

        • iwdNetwork passwords are automatically stored in /var/lib/iwdthe directory and can be used later to automatically connect to remembered networks.

        • To connect to a network with spaces in the SSID, enclose the network name in double quotes when connecting.

        • iwd only supports PSK passwords consisting of 8 to 63 ASCII-encoded characters. If the requirements are not met, the following error message will appear: PMK generation failed. Ensure Crypto Engine is properly configured.

        Connect to the Internet using WPS/WSC

        If the network is configured to connect with the push of a button ( Wikipedia: Wi-Fi Protected Setup , WPS, WiFi protected configuration), first check whether the device is compatible with the following configuration steps:

        [iwd]# wsc list
        

        Second, assuming the device appears in the list above:

        [iwd]# wsc <device> push-button
        

        Press the button on the router again.

        If the button is pressed in advance, but as long as it is less than two minutes ago, the above steps will also take effect.

        If the network requires verification of a PIN to connect, check helpthe output of the command to see how to wscprovide the correct options to the command.

        Disconnect from the network

        To disconnect from the network:

        [iwd]# station <device> disconnect
        

        Show device and connection information

        To display WiFi device details, such as MAC address:

        [iwd]# device <device> show
        

        To display the connection status including the network to which a WiFi device is connected:

        [iwd]# station <device> show
        

        Manage known networks

        To list previously connected networks:

        [iwd]# known-networks list
        

        To forget known networks:

        [iwd]# known-networks <SSID> forget
        
    • Mobile Broadband Modem (Mobile Network Card) - Use mmclithe utility to connect to a mobile network.

  • Configure network connection:

  • Check the network connection with pingthe command:

    # ping archlinux.org
    

Notice:

By default, the installation image is preconfigured with systemd-networkd, systemd-resolved, iwdand enabled ModemManager.

But this is not the case for already installed systems.

Update system time

Use timedatectl(1) to ensure the system time is accurate:

# timedatectl set-ntp true

You can use timedatectl statusto check the service status.

Create hard disk partition

If the system recognizes the disk, it will allocate it as a block device , such as /dev/sda, /dev/nvme0n1or /dev/mmcblk0. Available using lsblkor fdiskviewing:

# fdisk -l

Devices ending with rom, loopor can be ignored in the results .airoot

For a selected device, the following partitions are required:

If you need to create multi-level storage such as LVM , disk encryption or RAID , please do it at this time.

Please use fdisk or parted to modify the partition table. For example:

# fdisk /dev/<the_disk_to_be_partitioned(要被分区的磁盘)>

Notice:

You can also use a simpler method cfdiskto partition the disk. Use the following command:

# cfdisk /dev/<the_disk_to_be_partitioned(要被分区的磁盘)>

Note :

GPTIf you mistakenly mix partition and partition here MBR, you can use the following command to convert:

GPTPartition to MBRpartition:

Use partedtool conversion. If the system does not contain this tool, please install it first and then execute the following command:

# parted -s /dev/<the_disk_to_be_partitioned(要被分区的磁盘)> mklabel msdos
Partition example
UEFIandGPT
mount point Partition Partition type Recommended size
/mnt/boot1 /dev/*efi_system_partition* EFI system partition At least 300 MiB
[SWAP] /dev/*swap_partition* Linux swap (swap space) Greater than 512 MiB
/mnt /dev/*root_partition* Linux x86-64 root directory (/) remaining space

If you are using a bootloader that can load the kernel and initramfsimage from the root disk volume, you can use other mount points (for example /mnt/efi).

BIOSandMBR
mount point Partition Partition type Recommended size
[SWAP] /dev/*swap_partition* Linux swap (swap space) Greater than 512 MiB
/mnt /dev/*root_partition* Linux remaining space

Format partition

After the partitions are created, each newly created partition must be formatted with an appropriate file system .

For example, to /dev/*root_partition*create an Ext4 file system on the root partition, run:

# mkfs.ext4 /dev/*root_partition(根分区)*

If a swap partition is created , use mkswap(8) to initialize it:

# mkswap /dev/*swap_partition(交换空间分区)*

Notice:

For stacked block devices please replace above with the appropriate block device path /dev/**_partition*.

To create a EFIsystem partition , use mkfs.fat(8) to format it Fat32.

warn:

Formatting is only required when creating an EFI system partition during the partitioning step.

If there is already an EFI system partition on this disk, reformatting will destroy the boot loader of other installed operating systems.

# mkfs.fat -F 32 /dev/*efi_system_partition*

Mount partition

Mount the root disk volume to /mnt, for example:

# mount /dev/*root_partition(根分区)* /mnt

Use mkdir(1) to create other remaining mount points (for example /mnt/efi) and mount their corresponding disk volumes.

hint:

--mkdirRun mount(8) with the option to create the specified mount point.

Or, use mkdir(1) to create a mount point first and then mount it.

Notice:

The order of mounting partitions must be followed: first mount the root partition (to /mnt), then mount the boot partition (to /mnt/bootor /mnt/efi, if separated separately), and finally mount other partitions.

Otherwise, you may encounter the problem of being unable to start the system after the installation is completed.

For UEFIsystems, mount the EFI system partition:

# mount /dev/*efi_system_partition* /mnt/boot

If a swap space volume is created , use swapon(8) to enable it:

# swapon /dev/*swap_partition(交换空间分区)*

The mounted file system and swap space will be automatically detected later genfstab(8) .

Install

Select image

File /etc/pacman.d/mirrorlistdefines the mirror from which the package will be downloaded.

On a LiveCD-booted system, after connecting to the Internet, the mirror list reflectoris updated by selecting the 20 most recently synced HTTPSmirrors and sorting them by download rate.

Mirrors that are earlier in the list have higher priority when downloading software packages.

Might want to check the file and see if you're happy with it.

If you are not satisfied, you can modify the file accordingly /etc/pacman.d/mirrorlistand move the geographically closest image source to the head of the file. Some other criteria should also be considered.

Use the following command to add the fastest local Chinese mirror source and world mirror source to the top position to improve the installation speed:

# reflector -c Worldwide -c China -a 15 -p https -p http --sort rate --save /etc/pacman.d/mirrorlist

This file will then be pacstrapcopied to the new system, so please make sure the settings are correct.

Install required packages

Using the pacstrap(8) script, install basethe package and Linux kernel as well as the firmware for regular hardware:

# pacstrap /mnt base linux linux-firmware

hint:

  • can be linuxreplaced with other kernel packages described in the kernel page.

  • When installing in a virtual machine or container, the firmware package does not need to be installed.

baseSoftware packages do not contain Liveall programs in the environment.

So to get a fully functional basic system, you may need to install additional packages.

In particular, consider installing:

To install other packages or package groups (for example base-devel), please append their names to pacstrapthe command above (separated by spaces), or use to manually install the package or package group after Chrootentering a new system .pacman

packages.x86_64You can learn about the differences between different software packages or software package groups.

The following commands are recommended software packages to install :

# pacstrap /mnt base base-devel linux linux-firmware dhcpcd iwd vim sudo bash-completion nano net-tools openssh man

If you want a relatively more stable system, you can install a long-term support version of Linuxthe kernel.

The recommended software packages and long-term support version Linuxkernel installation commands are as follows:

# pacstrap /mnt base base-devel linux-lts linux-firmware dhcpcd iwd vim sudo bash-completion nano net-tools openssh man

Configure the system

Fstab

Generate fstabthe file with the following command (use the -Uor -Loption to set the UUID or volume label):

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

It is strongly recommended to check whether the generated file is correct after executing the above command /mnt/etc/fstab. You can use the following command to check:

# cat /mnt/etc/fstab

You can also use a text editor to view it. The command is as follows:

nanoEditor view command:

# nano /mnt/etc/fstab

vimCompiler view command:

# vim /mnt/etc/fstab

Default editor viewing command:

# gedit /mnt/etc/fstab

……

Chroot

chrootTo the newly installed system:

# arch-chroot /mnt

Edit AURChinese sources and other mirror sources (optional)

Use a text editor to edit ArchLinuxCNthe source and other mirror sources:

Use vimedit:
# vim /etc/pacman.conf
Use nanoedit:
# nano /etc/pacman.conf
Edit using the default editor:
# gedit /etc/pacman.conf
The edited content is as follows:

Open the 32-bit software source and delete [community]the previous ones #. The final effect is as follows:

[community]
Include = /etc/pacman.d/mirrorlist
Add ArchLinuxCN source:

Add the following content to /etc/pacman.conf:

[archlinuxcn]
Server = https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch
Installation archlinuxcn-keyringpackage importGPG key
# pacman -S archlinuxcn-keyring
# pacman-key --init
# pacman-key --populate archlinuxcn
Add other mirror sources:

/etc/pacman.confAdd the following content to import , blackarch, arch4edusource lado.me-audio:

[blackarch]
SigLevel = Optional TrustAll
Server = https://mirrors.cloud.tencent.com/blackarch/$repo/os/$arch

[arch4edu]
Server = https://mirrors.tuna.tsinghua.edu.cn/arch4edu/$arch

[lado.me-audio]
SigLevel = Optional TrustAll
Server = https://lado.me/repo/$arch
Update mirror source:

Use the following command to update the imported image source:

# pacman -Sy

Time zone

To set the time zone :

# ln -sf /usr/share/zoneinfo/*Region(地区名)*/*City(城市名)* /etc/localtime

hint:

For example, if you want to set the Shanghai time zone, please run

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

Then run hwclock(8) to generate /etc/adjtime:

# hwclock --systohc

This command assumes that the hardware time has been set to UTC time .

localization

Programs and libraries that require localized text rely on locale settings , which specify the region, currency, time zone date format, character arrangement, and other localization standards.

Need to be set in these two files: locale.genand locale.conf.

Edit /etc/locale.genand uncomment ( ) before en_US.UTF-8 UTF-8and other required locale settings .#

Then execute locale-gento generate localeinformation:

# locale-gen

Create the locale.conf(5) file and edit and set the LANG variable , such as:

/etc/locale.conf
LANG=*en_US.UTF-8*

Also for Chinese users:

hint:

  • Users can set locale by themselves;

  • Set the system locale to en_US.UTF-8, the system logwill be displayed in English, which makes it easier to judge and deal with problems;

    • It can also be set to en_GB.UTF-8or en_SG.UTF-8, with the following advantages:

      • After entering the desktop environment, the time is displayed in 24-hour format;
      • The paper size of office software such as LibreOffice will default to A4instead of Letter(US);
      • Try to avoid unnecessary and potentially troublesome imperial units.
    • The set LANG variable must be consistent with the locale setting, otherwise the following error will occur:

      - `Cannot set LC_CTYPE to default locale: No such file or directory`
      

warn:

It is not recommended to set any Chinese here locale, as it will cause ttygarbled characters.

If you need to modify the # console keyboard layout , you can edit vconsole.conf(5) to make it effective for a long time, for example:

/etc/vconsole.conf
KEYMAP=*de-latin1*

Network Configuration

Create hostname file:

/etc/hostname

myhostname(主机名)

Please proceed to complete the network configuration of the newly installed environment . You may need to install appropriate network management software during the configuration process.

Initramfs

There is usually no need to create a new one initramfs, since it pacstrapis already installed when executing linux, which has already been run mkinitcpio.

For partition configurations such as LVM, system encryptionor RAID, modify mkinitcpio.confand re-create an Initramfs with the following command:

# mkinitcpio -P

Root password

Set Root password :

# passwd

Create a new personal user

Use the following command to create a new non root-personal user to improve security:

# useradd -m -G wheel -s /bin/bash <用户名>
Set personal user password

Use the following command to set the account password of the individual user:

# passwd arch
Edit individual user permissions

If used vim, you can use the following command for simple settings:

# EDITOR=vim visudo

If used nano, the file needs to be modified sudoers. The command is as follows:

# nano /etc/sudoers

Just delete %wheelthe one before #, or add the following content under %wheelor :root

<用户名>    ALL=(ALL)    ALL

Set up the network:

In order to prevent many functions from being unavailable due to no network available after booting, LiveCDset Chrootup the network environment first.

  • ① Use the following command to install the network setting software:

    • # pacman -S networkmanager dhcpcd iw wpa_supplicant dialog net-tools openssh
      
  • systemdSet the network to start automatically at boot using:

    • # systemctl enable Networkmanager sshd dhcpcd
      
    • Notice:

      You can also use the following command to iwdautomatically start the computer to obtain a wireless network connection, which NetworkManageris the same as the above function.

      # systemctl enable iwd
      

      iwdAlthough and NetworkManagercan run at the same time, it cannot be used at the same time, that is, it has no effect if iwda connection is used.NetworkManager

Install bootloader

A bootloader needs to be installed Linuxto start the system after installation. The available bootloaders are listed in Bootloader . Please select one to install and configure it. This GRUB is the most common choice.

Install boot software:

Use the following command to install the software for booting:

# pacman -S grub efibootmgr os-prober
Install the microcode update software:

If there is or Intel, please enable microcode updates in addition.AMDCPU

IntelThe microcode installation command is as follows:

# pacman -S intel-ucode

AMDThe microcode installation command is as follows:

# pacman -S amd-ucode
Installation guide:
BIOSSystem boot installation:

Install the package according to the previous steps grub. Use the following command to boot the installation:

# grub-install --target=i386-pc </dev/sdX>

where is the disk ( not partition ) /dev/sdXto be installed GRUB, such as disk , or , rather than partition `/dev/sda1./dev/sda/dev/nvme0n1/dev/mmcblk0

UEFISystem boot installation:

Notice:

  • Different hardware manufacturers implement UEFI in different ways. The steps described below should be applicable to most UEFI systems.

    • For users who have encountered problems after using the method below, please share the details of the problem encountered on the specific hardware and possible solutions.

    • These examples can be added to the page GRUB/EFI examples (Simplified Chinese) .

  • This section assumes you are installing GRUB on an x86_64 system.

    • For IA32 (32-bit) UEFI systems (not to be confused with 32-bit CPUs), will be x86_64-efireplaced by i386-efi.

Follow the steps above to install the software package gruband efibootmgr.

Among them, " GRUB" is the startup boot loader, and " efibootmgr" is used by GRUBthe script to write startup items NVRAM.

Follow these steps to GRUBinstall to your hard drive:

  1. Mount EFIthe system partition . It should be noted that in the content of this section, replace with the partition*esp* mount point;ESP
  2. Select a bootloader ID, in this case called GRUB. This will *esp*/EFI/create a directory with the same name as the logo in to store the EFI binaries, and this name will also be used to distinguish GRUBboot items in the UEFI boot menu;
  3. Execute the following commands to grubx64.efiinstall the GRUB EFI application *esp*/EFI/GRUB/and install its modules /boot/grub/x86_64-efi/.

Notice:

Make sure the system where you install GRUBthe package and run the command is GRUBthe system you want to boot from.

That is, if you boot from the installation media, you need to chrootrun it again grub-install.

If you have to run it outside the installed system for some reasons grub-install, add --boot-directory=the option at the end to specify /bootthe path to the mounting directory, such as --boot-directory=/mnt/boot.

# grub-install --target=x86_64-efi --efi-directory=*esp* --bootloader-id=GRUB

After the above installation is complete GRUByour home directory will be located /boot/grub/.

Note that in the above example, an entry grub-installwill also be created in the firmware boot manager called GRUB.

If the startup items are full, this command will fail.

Need to use efibootmgr to remove unnecessary entries.

After the configuration is completed, remember to #generate the main configuration file .

hint:

If the option is used --removable, GRUBit will be installed to *esp*/EFI/BOOT/BOOTX64.EFI(when is used i386-efi) *esp*/EFI/BOOT/BOOTIA32.EFI, and it will still be possible to boot from the drive even if EFIthe variables are reset or the drive is connected to another computer.

Normally, just BIOSselect the drive at startup like a device.

If the device is installed Windowswith multi-boot at the same time, please note that an executable program Windowsis usually installed here , and the purpose of this program is to only rebuild the startup items.EFIWindowsUEFI

If you want to install on a MacGRUB , you must use this option.

Notice:

  • --efi-directoryand --bootloader-idare GRUB UEFIunique to .

    • --efi-directoryReplaced the obsolete one --root-directory.
  • You may notice that there is no device_path option (eg ) in grub-installthe command ./dev/sda

    • In fact, even if device_path is provided , it will be GRUB UEFIignored by the installation script because UEFIthe boot loader does not use MBRboot code or boot sectors.

After completing the installation, GRUB loads the configuration file every time it is started /boot/grub/grub.cfg.

You can use tools to # generate grub.cfg , or you can move # to customize grub.cfg .

Generate grub.cfg

Note:

Remember, whenever you modify a file in /etc/default/grubor /etc/grub.d/, you need to generate the main configuration file again .

Generate main configuration file

After installation, the main configuration file needs to be generated /boot/grub/grub.cfg.

The configuration file generation process is affected by /etc/default/gruboptions in and /etc/grub.d/scripts under .

Without additional configuration, the autogenerator detects configuration files in the root file system of the currently booted system.

So please make sure the system has been started or chrootentered via .

Notice:

  • The default file path is /boot/grub/grub.cfg, not /boot/grub/i386-pc/grub.cfg.

  • If you run it in chroota or systemd-nspawncontainer grub-mkconfig, you may get an error of grub-probe"Unable to obtain " canonical path of /dev/sdaX" and fail to execute normally. You can try to use it at this time arch-chroot.

  • If installed in an environment LVMusing , it will hang indefinitely.chrootGRUBgrub-mkconfig

Use grub-mkconfigtools to generate /boot/grub/grub.cfg:

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

The auto-generate script will by default add entries in the generated configuration file for all installed Arch Linux kernels .

hint:

  • Each time you install or remove a kernel , you need to rerun grub-mkconfigthe command.

  • To manage multiple GRUBentries, set up as follows:

    • If multiple kernels are installed, such as linuxand linux-lts, grub-mkconfigthey will be divided into a group to create a submenu by default, and use the following command to generate the main configuration file to manage multiple startup entries:

      # grub-mkconfig -o /boot/grub/grub.cfg
      
    • If multiple kernel startup entries are divided into one startup entry each, you need to /etc/default/grubadd the following command in the file or #delete it in front of it to return to the situation with only one menu:

       GRUB_DISABLE_SUBMENU=y
      
    • If you use GRUBthe current startup item as the default startup item, you need to edit the /etc/default/grubMedium GRUB_DEFAULToption as follows:

      GRUB_DEFAULT=saved
      
    • If you want to use GRUBthe currently selected startup item as the default startup item, you need to /etc/default/grubadd the following command to the file or #delete it in front of it:

      GRUB_SAVEDEFAULT=true
      
    • Notice:

      Since GRUBcannot btrfsbe written to, it can only be used when /bootis not btrfsa file system.

      However, a misleading error message is generated: " sparse file not allowed. Press any key to continue."

      Notice:

      To manually add startup items to /etc/grub.d/40_customor /boot/grub/custom.cfg, such as adding Windowsstartup items, you need to add savedefaultoptions first.

  • To modify the default menu entries, set as follows:

    The default startup items can be changed by modifying the value /etc/default/grubin :GRUB_DEFAULT

    ① Use menu title:

    GRUB_DEFAULT='Advanced options for Arch Linux>Arch Linux, with Linux linux'
    

    ② Use numerical numbers:

    GRUB_DEFAULT="1>2"
    

    Note :

    GRUBThe startup item 0serial number starts from , 0which represents the first startup item, which is also the default value of the above options, which 1represents the second startup item, and so on.

    Main menu and submenu items are >separated by .

    The above example starts Advanced options for Arch Linuxthe third item of the submenu under the main menu item ' '.

If you want to add custom entries, edit /etc/grub.d/40_customthe file and then regenerate it /boot/grub/grub.cfg.

You can also create /boot/grub/custom.cfga file and add entries to it.

/boot/grub/custom.cfgThere is no need to run the program after modifying the file grub-mkconfig, because /etc/grub.d/41_customthe file has already been referenced by adding relevant sourcestatements in the generated main configuration file /boot/grub/custom.cfg.

hint:

/etc/grub.d/40_customIt can be used as a template for creating /etc/grub.d/*nn*_customfiles, where *nn*is the priority and specifies the execution order of script files.

The execution order of the script files determines the position of the entries added in the GRUB startup menu.

*nn*Should be 06larger than to ensure that important scripts can be executed first.

Detect other operating systems

To grub-mkconfigdetect other installed systems and automatically add them to the boot menu, install the os-prober package and mount the disk partition containing the boot loader of the other system.

Then run again grub-mkconfig.

If you get the following output: Warning: os-prober will not be executed to detect other bootable partitions, you need to edit /etc/default/gruband uncomment the following line. If there is no corresponding comment, add it at the end of the file:

GRUB_DISABLE_OS_PROBER=false

Run grub-mkconfigand try again.

Notice:

  • The partition mount point is not important, os-prober reads mtabthe information to confirm and search for the bootloader location.

  • grub-mkconfigRemember to mount the partition containing the boot programs of other operating systems before each run to avoid losing the startup items of these operating systems.

hint:

You may want to grubremember the last selected startup item, see GRUB/Tips and tricks#Calling previous startup items

warn:

This is the last and crucial step of the installation. Please follow the above instructions to correctly install the boot loader before restarting.

Otherwise, you will not be able to enter the system normally after restarting.

Restart

Enter exitor press Ctrl+dto exit the chroot environment.

You can optionally umount -R /mntmanually unmount the mounted partition:

This helps to detect any "busy" partitions and find out the cause via fuser(1) .

Finally, by executing reboota reboot, systemd will automatically unmount any partitions that are still mounted.

Don't forget to remove the installation media and log in to the new system using the root account.

Post-installation work

System administration tutorials and post-work such as creating non-privileged accounts, GUI installation, sound management, touchpad support, etc.


Not original, please do not reprint

Guess you like

Origin blog.csdn.net/GaaraZ/article/details/127219532