archlinux安装-1-基础安装

分区http://note.wuduihome.com/index.php?c=adminarticle&a=modify&id=33

# cfdisk      
# mkfs.ext4 /dev/sda1      
# mkswap /dev/sda2      
# mkfs.ext4 /dev/sda3      
# mkfs.ext4 /dev/sda4

挂载分区

# mount /dev/sda1 /mnt      
# mkdir /mnt/boot      
# mount /dev/sda3 /mnt/boot      
# mkdir /mnt/home       
# mount /dev/sda4 /mnt/home       
# swapon /dev/sda2

如果单独建立了 boot 或其他分区,同样进行挂载。

# mkdir /mnt/boot    
# mount /dev/sdaX /mnt/boot

选择安装镜像

vi /etc/pacman.d/mirrorlist

#Server = http://mirrors.163.com/archlinux/$repo/os/$arch    
#Server = http://mirror.bjtu.edu.cn/archlinux/$repo/os/$arch   
#Server = http://mirrors.hust.edu.cn/archlinux/$repo/os/$arch  
#Server = http://mirrors.hustunique.com/archlinux/$repo/os/$arch 
#Server = http://mirrors.neusoft.edu.cn/archlinux/$repo/os/$arch 
#Server = http://mirrors.tuna.tsinghua.edu.cn/archlinux/$repo/os/$arch      
#Server = http://mirrors.ustc.edu.cn/archlinux/$repo/os/$arch

推荐

# Mirror used during installation
Server = ftp://ftp.archlinux.org/$repo/os/$arch
Server = http://mirrors.163.com/archlinux/$repo/os/$arch
Server = http://run.hit.edu.cn/archlinux/$repo/os/$arch
Server = http://www.mirror.tw/pub/ArchLinux/$repo/os/$arch
Server = http://ftp.iinet.net.au/pub/archlinux/$repo/os/$arch
Server = http://ftp.cc.uoc.gr/mirrors/linux/archlinux/$repo/os/$arch
Server = ftp://ftp.hosteurope.de/mirror/ftp.archlinux.org/$repo/os/$arch
Server = ftp://mir1.archlinux.fr/archlinux/$repo/os/$arch
Server = http://ftp.hosteurope.de/mirror/ftp.archlinux.org/$repo/os/$arch
Server = http://mir1.archlinux.fr/archlinux/$repo/os/$arch
Server = http://mirror6.bjtu.edu.cn/archlinux/$repo/os/$arch
Server = http://www.gtlib.gatech.edu/pub/linux/distributions/archlinux/$repo/os/$arch
Server = ftp://archlinux.c3sl.ufpr.br/archlinux/$repo/os/$arch
Server = http://mirrors.sohu.com/archlinux/$repo/os/$arch

刷新软件包列表

# pacman -Syy

安装基本系统

精简安装
#pacstrap /mnt bash dhcpcd e2fsprogs linux coreutils cronie 
file filesystem glibc procps-ng pacman shadow 
systemd-sysvcompat vi reiserfsprogs netctl

如果需要使用网络管理命令,则还得安上inetutils,但安装这个包,系统会变得很大。

基本安装

# pacstrap /mnt base base-devel net-tools
生成 fstab
# genfstab -p /mnt >> /mnt/etc/fstab

Chroot 到新系统

# arch-chroot /mnt

配置系统

Local

vi /etc/locale.gen
en_US前面注释去掉
zh_CN前面注释去掉
locale-gen
echo LANG=en_US.UTF-8 > /etc/locale.conf

时区

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

硬件时间

hwclock --systohc --utc

Hostname

echo Archlinux > /etc/hostname

有线连接

systemctl enable dhcpcd.service

无线连接

pacman -S ifplugd
cd /etc/network.d
ln -s examples/ethernet-dhcp .
systemctl enable net-auto-wired.service

创建初始 ramdisk 环境

mkinitcpio -p linux

设置 Root 密码并创建一般用户

passwd
useradd -m -s /bin/bash jone
passwd jone

安装配置启动加载器

pacman -S grub-bios

设置grub引导程序至/dev/sda

grub-install /dev/sda

生成grub配置文件

grub-mkconfig -o /boot/grub/grub.cfg

更新系统

pacman -Syu

卸载分区并重启系统

exit
umount -R /mnt reboot

最基础的archlinux安装完成


安装过程出现的问题

ping: unknown host www.baidu.com
vi /etc/resolv.conf 修改为Google的公共DNS服务

nameserver 8.8.8.8
nameserver 8.8.4.4

时间差8小时
vi /etc/adjtime 改为

0.0 0.0 0.0
0
LOCAL

skype不能输入中文
.xinitrc文件里最前面添加"export LANG=zh_CN.UTF-8"

转载于:https://my.oschina.net/jonetwelve/blog/617183

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值