archlinux 安装

ArchLinux install contents

  Connect to the internet

  Update the system clock

  Partition the disks

    Format the partitions

  Mount the file system

  Install system

  Configure the system

  Update kernel

  Set proxy for pacman

Connect to the internet 

1. wifi

enter network mode

iwctl

check wifi devices,example:wlan0

device list 

scan networks

station wlan0 scan

display networks

station wlan0 get-networks

connect network, and input password

station wlan0 connect <netowrk name>

exit iwctl

exit

2. eth

set proxy

export http_proxy=*
export https_proxy=*

Update the system clock

1. update clock

timedatectl set-ntp true

2. ensure clock is right

timedatectl status

Partition the disks

1. 查看你要安装的设备,一般是: /dev/sda /dev/nvme0n1 /dev/mmcblk0 等等

fdisk -l

2. 进行分区(cfdisk /dev/nvme0n1)

2.1 UEFI with GPT

fdisk /dev/nvme0n1

create partitions

g(GPT)
n,enter,enter, +512M, t,1(EFI System),
n,enter,enter, +4G, t,enter,19(Linux swap),
n,enter,enter, enter, t,enter,20(Linux filesystem),
w(save)

Format the partitions

1 format file system

mkfs.ext4 /dev/nvme0n1p3

2. init swap

mkswap /dev/nvme0n1p2

3. format EFI system

mkfs.fat -F 32 /dev/nvme0n1p1

Mount the file systems

1. mount the root file system partition

mount /dev/nvme0n1p3 /mnt

2. mount EFI system partition

mount --mkdir /dev/nvme0n1p1 /mnt/boot/efi

3. enable swap

swapon /dev/nvme0n1p2

4. check partitons whether is right

root@archiso ~ # lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
loop0         7:0    0 689.8M  1 loop /run/archiso/airootfs
sda           8:0    1     7G  0 disk
├─sda1        8:1    1   782M  0 part /run/archiso/bootmnt
└─sda2        8:2    1    13M  0 part
nvme0n1     259:0    0 119.2G  0 disk
├─nvme0n1p1 259:2    0   512M  0 part /mnt/boot
├─nvme0n1p2 259:3    0     4G  0 part [SWAP]
└─nvme0n1p3 259:4    0 114.7G  0 part /mnt

Install system

install essential packages

pacstrap /mnt base base-devel linux linux-firmware dhcpcd iwd vim sudo net-tools openssh wget zsh

Configure the system

1. fstab

generate an fstab file

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

check fstab file

cat /mnt/etc/fstab

2. chroot 

enter system

arch-chroot /mnt

3. Time zone

set the time zone(example: Shanghai)

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

sync hardware

hwclock --systohc

4. location

set system language, uncomment en_US.UTF-8 UTF-8

vim /etc/locale.gen

generate the locales

locale-gen

create the locale.conf file, set the LANG variable

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

5. Network configuration

set hostname

echo "archlinux" > /etc/hostname

generate hosts

vim /etc/hosts
--------------------
127.0.0.1   localhost
::1         localhost
127.0.1.1   archlinux.localdomain archlinux 

6. root

set password for root

passwd

add a new user

useradd -m -G wheel chrome

set password for new user

passwd chrome

add sudo permissions, uncomment %wheel ALL=(ALL) ALL

vim /etc/sudoers

7. install packages

pacman -S grub efibootmgr efivar networkmanager intel-ucode

 8. install grub

grub-install /dev/nvme0n1
grub-mkconfig -o /boot/grub/grub.cfg

9. 开机启动

enabel network

systemctl enable NetworkManager

enable sshd

systemctl enable sshd

10. install desktop

install gnome

pacman -S gnome

enable gdm(开机进入图形界面)

systemctl enable gdm

11. reboot

exit  # exit chroot
umount /mnt/boot/efi
umount /mnt
reboot

install other applications

1. install steam

修改pacman配置文件,去除下面的“#”

#[multilib]
#Include = /etc/pacman.d/mirrorlist 

安装steam

pacman -Sy steam

Update kernel

1. update kernel to LTS(5.15.72)

pacman -Sy linux-lts linux-lts-headers

Set proxy for pacman

1. set proxy

export http_proxy=*

2. set sudo variable

sudo -E pacman -Syu

3. kepp env, add "Defaults env_keep += "ftp_proxy http_proxy https_proxy no_proxy""

vim /etc/sudoers

Errors

1. Import PGP key 139B09DA5BF0D338, "David Runge <dvzrv@archlinux.org>"? [Y/n]

log:

:: Import PGP key 139B09DA5BF0D338, "David Runge <dvzrv@archlinux.org>"? [Y/n]
Y
error: key "139B09DA5BF0D338" could not be looked up remotely
error: required key missing from keyring
error: failed to commit transaction (unexpected error)
Errors occurred, no packages were upgraded.
==> ERROR: Failed to install packages to new root

solution:

pacman-key --refresh-keys
pacman -S archlinux-keyring
pacman -Syu

log:

/dev/nvme0n1 is apparently in use by the system; will not make a filesystem here!

solution:

dmsetup remove_all

  

参考:

官网:

https://wiki.archlinux.org/title/Installation_guide

https://www.cnblogs.com/oucbl/p/13892868.html  # install steam

https://blog.csdn.net/weixin_43869959/article/details/119806220  # pacman 404

https://blog.csdn.net/XM_89/article/details/120584742  # install desktop

https://blog.csdn.net/weixin_30532759/article/details/96029195  # mount disk

# install archlinux

https://www.bilibili.com/read/cv17572682

https://blog.csdn.net/qq_37367301/article/details/120343495

https://blog.csdn.net/qq_37367301/article/details/120343495

 

posted @ 2022-10-09 08:49  zhuang6  阅读(439)  评论(0编辑  收藏  举报