可以省略,默认为us键盘布局
# ls /usr/share/kbd/keymaps/**/*.map.gz
# loadkeys us
以下命令执行成功则为uefi模式启动
# ls /sys/firmware/efi/efivars
最好使用有线连接,因为简单
# ping www.baidu.com
# dhcpcd
使用
wifi-menu
命令,命令可能无法使用,需要先安装wpa_supplicant
和dialog
模块
# wifi-menu
安装
wpa_supplicant
# pacman -S wpa_supplicant
注意用
date
看一下时间,与正确时间差了8个小时
# timedatectl set-ntp true
目前划分的是3个分区,
/boot
,/home
,/
parted
进行磁盘分区
# parted -l
以下为虚拟机上的分区,分区表格式为mbr
Model: Virtio Block Device (virtblk) Disk /dev/vda: 42.9GB Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags: Number Start End Size Type File system Flags 1 1049kB 42.9GB 42.9GB primary ext4 boot
# parted /dev/vda
GPT
格式
(parted) mklabel
New disk label type? gpt
Warning: Partition(s) on /dev/vda are being used.
Ignore/Cancel? i
Warning: The existing disk label on /dev/vda will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? y
使用rm 数字删除分区
(parted) rm 1
boot
分区
(parted) mkpart
Partition name? []?
File system type? [ext2]? ext4
Start? 0
End? 512M
home
分区
(parted) mkpart
Partition name? []? /home
File system type? [ext2]? ext4
Start? 512M
End? 10G
根
分区
(parted) mkpart
Partition name? []? /
File system type? [ext2]?
Start? 10G
End? -1
(parted) p
Model: Virtio Block Device (virtblk) Disk /dev/vda: 42.9GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 1 17.4kB 512MB 512MB 2 512MB 10.0GB 9488MB /home 3 10.0GB 42.9GB 32.9GB /
(parted) quit
fdisk
进行磁盘分区
进行
fdisk
的命令交互操作时候不能删除输入的内容
# fdisk /dev/vda
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help):
empty gpt
分区表
Command (m for help): g
Building a new GPT disklabel (GUID: C5734B4C-B436-466C-9D1C-693388EA850A)
boot
分区
Command (m for help): n
Partition number (1-128, default 1):
First sector (2048-83886046, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-83886046, default 83886046): +512M
Created partition 1
home
分区
Command (m for help): n
Partition number (2-128, default 2):
First sector (1050624-83886046, default 1050624):
Last sector, +sectors or +size{K,M,G,T,P} (1050624-83886046, default 83886046): +10G
Created partition 2
/
分区
Command (m for help): n
Partition number (3-128, default 3):
First sector (22022144-83886046, default 22022144):
Last sector, +sectors or +size{K,M,G,T,P} (22022144-83886046, default 83886046):
Created partition 3
Command (m for help): p
Disk /dev/vda: 42.9 GB, 42949672960 bytes, 83886080 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: gpt # Start End Size Type Name 1 34 1000000 488.3M Microsoft basic 2 1000001 19531250 8.9G Microsoft basic /home 3 19531776 83884031 30.7G Microsoft basic /
boot
分区
必须为fat32格式
# mkfs.fat -F32 /dev/sdxY
home
,/
分区
# mkfs.ext4 /dev/sdxY
/
分区
# mount /dev/sda3 /mnt
boot
,home
分区
一定要先挂载
/
分区,不然这两个挂载点会被覆盖
# mkdir /mnt/boot
# mount /dev/sda1 /mnt/boot
# mkdir /mnt/home
# mount /dev/sda1 /mnt/home
这一步可以跳过,安装过程中网速可能有些慢
vim
vim最好装上
# pacman -S vim
# vim /etc/pacman.d/mirrorlist
也可以使用
# pacstrap /mnt base base-devel
# pacstrap /mnt base
# genfstab -U /mnt >> /mnt/etc/fstab
生成之后检查一下文件内容,应该有3个分区被挂载
# arch-chroot /mnt
再看时间是对的
# ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
# hwclock --systohc
/etc/locale.gen
文件中下面行的注释
zh_CN.UTF-8 UTF-8 zh_HK.UTF-8 UTF-8 zh_TW.UTF-8 UTF-8 en_US.UTF-8 UTF-8
# locale-gen
/etc/locale.conf
文件
# vim /etc/locale.conf
设置为英文,目前还没有安装中文字体
LANG=en_US.UTF-8
将
/etc/hostname
文件的内容修改为archlinux
# vim /etc/hostname
hosts
文件添加以下内容到
/etc/hosts
127.0.0.1 localhost ::1 localhost
# vim /etc/hosts
dialog
, wpa_supplicant
安装
wpa_supplicant
后可以使用wifi-menu
命令,用界面连接wifi,依赖dialog
模块
# pacman -S wpa_supplicant dialog
root
用户设置密码使用命令,然后根据提示输入密码
# passwd
非IntelCPU可以跳过此步骤
# pacman -S intel-ucode
grub
与efibootmgr
# pacman -S grub efibootmgr
grub
# grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=grub
# grub-mkconfig -o /boot/grub/grub.cfg
看一下Arch Linux入口是否出现在文件中
# vim /boot/grub/grub.cfg
这个时候应该是在新系统中。关于如何区分是在新系统还是在安装盘中,可以看命令提示符前面的
root
字的颜色,彩色的表示在安装盘中
# exit
# reboot
重启后进入新系统,到了字符界面,继续一些其他的设置,以及桌面环境的安装
# fallocate -l 512M /swapfile
600 = rw- --- ---
# chmod 600 /swapfile
# mkswap /swapfile
# swapon /swapfile
/etc/fstab
# vim /etc/fstab
新增加一行
/swapfile none swap defaults 0 0
# useradd -m -G wheel myUserName
- -m 是为用户创建家目录(如果有则不用这个参数)
- -G 为用户设置一个分组,wheel属于管理组
# passwd myUserName
如果在安装系统时安装了
base-devel
这个包,那么这个命令在安装系统是一起安装了
sudo
# pacman -S sudo
/etc/sudoers
root ALL=(ALL) ALL
行下新增加一行
myUserName ALL=(ALL) ALL
%wheel ALL=(ALL) ALL
行的注释要支持制作fat文件系统,安装dosfstools,默认内核只能读取ntfs,要支持ntfs读写,安装ntfs-3g
# pacman -S ntfs-3g dosfstools
dhcpcd
wifi-menu
# ping www.baidu.com
在安装Xorg的时候好像会一起安装
# pacman -S xf86-video-intel
# pacman -S xorg
# pacman -S xfce4 xfce4-goodies
# pacman -S sddm
# systemctl enable sddm
networkmanager
软件
是图形化的网络管理工具,安装桌面后需要用到
# pacman -S networkmanager
NetworkManager
网络服务
# systemctl disable netctl
# systemctl enable NetworkManager
# pacman -S network-manager-applet
# pacman -S ttf-roboto noto-fonts noto-fonts-cjk adobe-source-han-sans-cn-fonts adobe-source-han-serif-cn-fonts ttf-dejavu
开启中文后字符界面(tty)无法显示中文,无法进入桌面时可以将系统字体改为英文,通常也没有机会再用tty了
/etc/locale.conf
将
LANG=en_US.UTF-8
改为
LANG=zh_CN.UTF-8
fcitx
# pacman -S fcitx
# pacman -S fcitx-gtk3
# pacman -S fcitx-libpinyin
# pacman -S fcitx-configtool
浏览器
# pacman -S chromuim
在终端打印发行版logo
# pacman -S screenfetch
要获得像苹果osx一样的dock可以用docky或者dash-to-dock
# pacman -S docky
火车头
# pacman -S sl
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。