Arch Linux 2018.01.01 Installation Summary

New Year's Day holiday for 3 days, rest at home is cool!

A Linux distribution has been updated, and Arch Linux has released version 2018.01.01. When I saw this news, I fell into thinking, should I switch to this distribution? I have been using centos for more than five years, and it has been very good, especially the release of the DVD version and the Everything version, which solved my many problems of inconvenient Internet access and difficult software installation. However, on centos, the BCM 4360 wireless network card is not driven, which is very inconvenient for me; and, on my mac mini, the startup speed of centos 7 is indeed a bit slow. So, I want to try another system.

I have heard of Arch Linux for a long time, and I also know that it is deeply dependent on the network, far more than centos. Now the cost of using mobile network traffic has dropped greatly, so you can try it. Arch Linux For me, it is a further path to learn and understand the Linux system.

Experience has taught me that the fastest progress occurs when solving problems. So, I'm going out of my centos comfort zone and towards Arch Linux.

On January 3, 2018, the installation process of Arch Linux is as follows:

  1. Download the archlinux-2018.01.01-x86_64.iso file from the NetEase mirror site :

     $ wget -c http://mirrors.163.com/archlinux/iso/2018.01.01/archlinux-2018.01.01-x86_64.iso 
    
  2. The integrity of the operating system file is checked, and after the calculation is completed, it is compared with the md5sum of the download site, and it can be consistent:

     $ md5sum archlinux-2018.01.01-x86_64.iso
    
  3. Burn to U disk:

    • First, delete all the data and partitions on the U disk, use fdisk or parted;
    • Burn the verified file to the U disk:
      # dd  if=archlinux-2018.01.01-x86_64.iso  of=/dev/sdb  bs=4M 
    

    Note: /dev/sdb is the number of the U disk in the system.

  4. Insert the U disk into the computer, restart, hold down the ALT key, enter the startup selection interface, select the U disk to start, and enter the Live environment of Arch Linux.

  5. Install Arch Linux on your local computer by following the Arch Linux installation guide or the installation guide in a live environment:

    • Check the keyboard layout

    • Verify Boot Mode

        # ls /sys/firmware/efi/efivars 
      
    • connect to the internet

      Check the available network ports, including the network ports shared by the mobile phone through the USB port:

       # ip addr show 
      

      To obtain an IP address dynamically, Arch Linux uses the dhcpcd command:

       # dhcpcd enp0s20u1
      
    • Update system time

       # timedatectl set-ntp true 
      
    • To create a hard disk partition, either fdisk or parted can be used, but parted is recommended because more detailed information can be viewed. Note: The / partition and the /usr directory should be in the same partition, otherwise you will be prompted during startup:

        ERROR: Unable to determine major/minor number of root device 'dev/sda8'.
        You are being dropped to a recovery shell
        Type 'exit' to try and continue booting
        sh: can't access tty; job control turned off
      

      The reason for the error is probably that after the / partition is mounted, other mounted partitions recorded in the /etc/fstab file are not mounted, so that some commands cannot be executed during the execution of the system. This problem bothered me all night, especially pit, fortunately, it was finally solved.

      Note: Be sure to plan the ESP partition, which is necessary for EFI Shell to start, and needs to be formatted in FAT format, FAT16 or FAT32 can install the EFI Shell startup file; ), the memory is small and can be planned to be larger (4GB). The format command is as follows:

      # mkfs.vfat -F 32 /dev/sda1
      # mkfs.ext4 /dev/sda2
      # mkswap   /dev/sda3
      ...
      
    • mount partition first mount / partition

      # mount -t ext4 /dev/sda8  /mnt
      

      Create a partition directory, mount the partition

      # mkdir /mnt/boot
      # mount -t  ext2 /dev/sda2 /mnt/boot/
      # mkdir /mnt/boot/efi
      # mount -t vfat /dev/sda1  /mnt/boot/efi
      # swapon /dev/sda3
      ...
      

      Note: It must be executed in order. You cannot mkdir -p /mnt/boot/efi. There is no problem in mounting sda2 to the boot directory, but there will be problems when mounting sda1 to the /mnt/boot/efi directory. If unsuccessful, the correct fstab file cannot be generated later. Because after sda2 is mounted to the boot directory, it will overwrite the originally created boot/efi directory and replace it with the content in the sda2 partition. And sda2 has just been formatted, there is only one lost+found directory, there is no efi directory, so there will be a mount error.

    • Select the mirror source, edit the /etc/pacman.d/mirror-list file, and delete mirror sites in countries other than China.

    • Install the base system

      # pacstrap /mnt base
      
    • Generate the fstab file and see if the content is correct

      # genfstab -U /mnt >> /mnt/etc/fstab
      # cat /mnt/etc/fstab
      
    • chroot new system

       # arch-chroot /mnt
      
    • Set time zone and clock

      # ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
      # hwclock --systohc --utc
      
    • Localization settings, when there is only a terminal environment, only English characters should be set, because Chinese cannot be displayed

      # vim /etc/locale.gen  仅余以下内容
        en_US.UTF-8 UTF-8
        zh_CN.UTF-8 UTF-8
      # locale-gen
      # echo LANG=en_US.UTF-8 > /etc/locale.conf
      
    • Set root password, hostname

       # passwd
       # echo myhostname > /etc/hostname
      
    • Configure the network for the new operating system, or restart it.

    • Initramfs If mkinitcpio.conf is modified, create an initial RAM disk with the following command:

       # mkinitcpio -p linux
      
    • Install Grub, efibootmgr, efibootmgr create the .efi boot entry used by the GRUB install script

       # pacman -S grub efibootmgr
       # grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=Grub
      
    • Install intel-ucode and enable

      # pacman -S intel-ucode
      # grub-mkconfig -o /boot/grub/grub.cfg
      
  6. After the installation is complete, exit the chroot, unmount the file system mounted in the /mnt directory, and restart the system

     # exit
     # umount -R /mnt
     # sync
     # shutdown -r now
    
  7. Install the gnome desktop environment

      # pacman -S gnome
    
  8. Install fonts, set the Chinese environment

      # pacman -Ss font
      # pacman -S ttf-liberation  ttf-arphic-ukai
    

    The first command is to find available fonts, and the second command is to install fonts; Activity->Settings->Region and Language, change the setting to Chinese.

  9. Install the input method On the GNOME platform, you can use the fcitx mode input method or the ibus mode input method. Generally speaking, the ibus mode input method is easy to use, and the installation is simple:

       # pacman -S ibus ibus-googlepinyin
    

    Installing the fcitx input method is a little more troublesome.

       # pacman -S fcitx fcitx-im
    

    After the installation is complete, fcitx cannot always be started. Entering fcitx directly in the terminal will report an error

    DBus Service Already Exists(ERROR-836 /build/fcitx/src/fcitx-4.2.8.1/src/lib/fcitx/instance.c:424) Exiting.

    Execute the fcitx-diagnose check and find that the environment variable settings are missing, so various Baidu, but viewing various tutorials are to create ~/.xprofile or ~/.xinitrc, add variables to restart, etc., the results are invalid, and finally check Arch wiki found such a sentence

    If you are using a newer version of GNOME, using the Wayland display manager, add to /etc/environment:


             export GTK_IM_MODULE=fcitx
             export QT_IM_MODULE=fcitx
             export XMODIFIERS=@im=fcitx
    

    This is the reason, my gnome version is relatively new, restart the system after changing in /etc/environment, it can be used normally. When I looked at the Arch wiki after the installation, I found that I was really stupid. I should have taken a good look at the instructions on the input method in the wiki page:

    GNOME has integrated support for input methods through IBus, only ibus and the wanted input method engine (e.g. ibus-libpinyin for Intelligent Pinyin) needed to be installed, after installation the input method engine can be added as a keyboard layout in GNOME's Regional & Language Settings.

  10. Install chromium browser

    The chrome browser under Arch Linux is chromium, and the functions are the same

      # pacman -S chromium
    

    The result is an error: Unable to download chromium from the mirror site. I'm just wondering, what's going on? Go to the NetEase mirror source to find it, no problem, there is this package. After re-installing, the same error is reported. After carefully reading the reported error, I found that the version number is wrong. It turned out that in the past two days, the chromium version was updated again. It's easy to know the cause of the error:

      # pacman -S
      # pacman -S chromium
    

    After the installation is complete, everything is the same except for the icon color.

  11. Install the Broadcom BCM4360 Wireless Card Driver

    View the specific information of the wireless network card

      # lspci -v | grep 14e4
      ...
      02:00.0 Network controller [0280]: Broadcom Limited BCM4360 802.11ac Wireless Network 
      Adapter [14e4:43a0] (rev 03)
      Subsystem: Apple Inc. BCM4360 802.11ac Wireless Network Adapter [106b:0112]
    

    Check the applicable driver type table, BCM4360 is suitable for broadcom-wl driver module. Check the information of this module, it is in the AUR library, it cannot be installed directly with pacman, should I give up? of course not.

      # git clone https://aur.archlinux.org/broadcom-wl.git
      # cd /git/broadcom-wl/                      #替换为自己的实际路径
      # makepkg
      # rmmod  b43 ssb
      # pacman -U broadcom-wl-6.30.223.271-6-x86_64.pkg.tar.xz
      # modprobe wl  lib80211
    

    Restart the system and finally see the wireless network card.


The installation has finally come to an end, and my MAC MINI MGEM2 can finally be used normally again. During the installation process, I experienced that /usr and / were not in the same partition, which made it impossible to start. I tried my best to do it. Baidu everywhere, and finally solved it. In the end, the wireless network card can be used normally, and there are still some gains.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325992096&siteId=291194637