VM Archlinux

timedatectl status
lsblk
cfdisk
mkfs.ext4 /dev/sda
mount /dev/sda /mnt
mkdir /mnt/home
mount /dev/sda /mnt/home

##切换国内源
echo '## China\nServer = http://mirrors.aliyun.com/archlinux/$repo/os/$arch' > mrlist
grep -A 1 'China' /etc/pacman.d/mirrorlist|grep -v '\-\-' >> mrlist
cat /etc/pacman.d/mirrorlist >> mrlist
mv mrlist /etc/pacman.d/mirrorlist

##安装系统
pacstrap -i /mnt base base-devel vim
##配置系统
genfstab -U /mnt >> /mnt/etc/fstab
##查看生成情况
nano /mnt/etc/fstab
##切换到新系统
arch-chroot /mnt
生成ramdisk环境
mkinitcpio -p linux
##设置时区
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
##设置时间标准为UTC,并调整时间漂移
hwclock --systohc --utc

##配置Locale
nano /etc/locale.gen
[en_US.UTF-8 UTF-8
zh_CN.UTF-8 UTF-8
zh_TW.UTF-8 UTF-8]
##locale-gen生成Locale信息,并列出所有启用的Locale:
locale-gen
locale -a
##创建locale.conf文件
echo LANG=en_US.UTF-8 > /etc/locale.conf
locale
##设置主机名
echo freeLinux > /etc/hostname
nano /etc/hosts
[127.0.0.1    localhost.localdomain    localhost
::1          localhost.localdomain    localhost
127.0.1.1    freeLinux.localdomain    freeLinux
##有线网络
systemctl enable dhcpcd.service
##设置密码
passwd
##创建用户
useradd -m -G wheel -s /bin/bash name
passwd name
##修改权限
visudo
pacman -S vim[no vim]

##安装grub
pacman -S grub efibootmgr(efi使用)
grub-install --recheck /dev/sda
grub-install --recheck /dev/sda --efi-directory=/boot
grub-install /dev/sda
grub-install --force /dev/sda(都错使用)
grub-mkconfig -o /boot/grub/grub.cfg

##重启
exit
umount -R /mnt
reboot

##图形服务
sudo pacman -S xorg
##xfce
sudo pacman -S xfce4 xfce4-goodies

你可能感兴趣的:(VM Archlinux)