ArchLinux安裝(BIOS)
說在前頭:在經歷過無數次的失敗嘗試過后總結出的可用的安裝過程(比官方的簡單一點)
官方安裝指導
一.連接網絡
1.連接
# wifi-menu
2.檢查是否聯通
(ctrl+c停止)
# ping www.baidu.com
3.遠程安裝
注:連接上網絡之后可以通過遠程鏈接(同一個網絡下)在另一台電腦上進行安裝操作(可方便復制代碼),如不想這么做請忽略這一步驟
開啟ssh
# systemctl start sshd
查看ip地址
# ip a
更改root賬戶密碼(這還不是系統的root)
# passwd
在另外的電腦上連接
# ssh root@[ip地址] 例如: ssh root@192.168.1.1
二.更新系統時鍾
1.設置
# timedatectl set-ntp true
2.檢查
# timedatectl status
三.磁盤分區
1.查看當前的可用磁盤
一般都是 /dev/sda
# fdisk -l
2.創建新分區
# fdisk /dev/sda
-->n -->回車 -->回車 -->回車 -->+500m
-->n -->回車 -->回車 -->回車 -->+6G
-->n -->回車 -->回車 -->回車 -->回車
-->w
如:
root@archiso ~ # fdisk /dev/sda
Welcome to fdisk (util-linux 2.33).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x1d29b8d3.
Command (m for help): n
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p):
Partition number (1-4, default 1):
First sector (2048-41943039, default 2048):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-41943039, default 41943039): +500m
Created a new partition 1 of type 'Linux' and of size 500 MiB.
Command (m for help): n
Partition type
p primary (1 primary, 0 extended, 3 free)
e extended (container for logical partitions)
Select (default p):
Using default response p.
Partition number (2-4, default 2):
First sector (1026048-41943039, default 1026048):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (1026048-41943039, default 41943039): +6G
Created a new partition 2 of type 'Linux' and of size 6 GiB.
Command (m for help): n
Partition type
p primary (2 primary, 0 extended, 2 free)
e extended (container for logical partitions)
Select (default p):
Using default response p.
Partition number (3,4, default 3):
First sector (13608960-41943039, default 13608960):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (13608960-41943039, default 41943039):
Created a new partition 3 of type 'Linux' and of size 13.5 GiB.
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
root@archiso ~ #
3.格式化分區
將bios分區格式化為ext2
根目錄格式化為ext4
請注意自己的對應的目錄是那塊區域
# mkfs.ext2 /dev/sda1
# mkswap /dev/sda2
# mkfs.ext4 /dev/sda3
4.打開swap分區
請注意自己的swap分區是哪塊
swapon /dev/sda2
5.掛載分區
# mount /dev/sda3 /mnt
# mkdir /mnt/boot
# mount /dev/sda1 /mnt/boot
四.安裝系統基本包
1.配置源
將國內源放到第一位
# vim /etc/pacman.d/mirrorlist
2.刷新源
# pacman -Syy
3.安裝基本包
# pacstrap /mnt base base-devel
4.生成fstab文件
# genfstab -U /mnt >> /mnt/etc/fstab
四.切換環境
1.切換
# arch-chroot /mnt
2.配置時區
# ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
3.硬件時間
# hwclock --systohc
4.安裝vim
方便操作
# pacman -S vim
6.設置語言
將/etc/locale.gen中en_US.UTF-8的注釋去掉
避免中文亂碼,推薦先使用英文
# vim /etc/locale.gen
# locale-gen
7.配置 /etc/locale.conf文件
# vim /etc/locale.conf
寫入
LANG=en_US.UTF-8
8.重置root密碼
# passwd
9.安裝網絡相關的包
# pacman -S iw wpa_supplicant dialog net-tools networkmanager
10.安裝編碼
# pacman -S intel-ucode
11.安裝引導
# pacman -S grub
# grub-install /dev/sda
# grub-mkconfig -o /boot/grub/grub.cfg
五.退出當前環境
# exit
六.卸載新分區
# umount -R /mnt
七.重啟
# reboot
到此安裝完成
八.可能遇到的問題
1.網絡鏈接不上
具體表現為ping不同百度
解決辦法:
# systemctl enable dhcpcd
# systemctl restart dhcpcd