ArchLinux安装与配置

tip:我是在虚拟机内安装的,所以直接是共享网络,安装一定要有网络
桌面管理什么的后面,后续更新。

15,1,2017解决
1. 安装完成不能上网
2. 安装base出错

安装完成后不能上网

一、分割硬盘

用自己熟悉的分区工具进行分区,此处我分了/ 和/home

fdisk /dev/sda  

二、格式化分区

mkfs.ext4 /dev/sda2、挂载分区
mount /dev/sda1 /mnt 
mkdir /mnt/home
mount /dev/sda2 /mnt/home

使live cd能写入硬盘。
挂载顺序很重要

四、设定镜像源repo

vi /etc/pacman.d/mirrorlist,
使用vi或者其他编辑器搜索mirrorlist中的zh或Ch注意大小写
将如
##score xx China
Server =xxxxxx.xxxx.xxxxx
将Server那一行移动到第一行
把最想使用的Mirror Server放在在最前面。

更新pacman软件清单
pacman -Syy
经常使用,类似apt update

五、下载arch基本的东西

pacstrap /mnt base
这步可能是有问题的,因为signature问题,很多东西装不上
上个指令出现error可执行下面命令
pacman -Sy archlinux-keyring && pacman -Syyu或
pacman -Sy archlinux-keyring

六、建立新系统的fstab

genfstab -p -U /mnt > /mnt/etc/fstab
說明:建立/mnt/etc/fstab(新系统的文件系统分区表)

七、chroot到新系統

arch-chroot /mnt
目的:進入新系統以進行後續設定。
这时, /mnt == /

八、设定电脑名称

echo <write-you-onw-name> > /etc/hostname
< >内写自己想写名字就好了

九、设定时区

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

十、系统语言

修改/etc/locale.gen的內容(进入vi界面):
vi /etc/locale.gen
取消#注释的項目如下:
en_US.UTF-8 UTF-8
zh_CN.UTF-8 UTF-8
用什么语言就反注释掉对应那一

产生locale檔案 :locale-gen
建立/etc/locale.conf(进入vi界面):
vi /etc/locale.conf
英文系统语言LANG=”en_US.UTF-8”

十一、开机映像

mkinitcpio -p linux 生成initramfs

十二、安装grub,efi有其他方法

64位系统也是安装i386的grub没影响

pacman -S grub
grub-install --target=i386-pc --recheck /dev/sda --force
grub-mkconfig -o /boot/grub/grub.cfg

#目的:使系统能自动启动

十三、退出重启

退出chroot回到live cd环境:exit
重启:reboot

基本将装完了,但是这时重启后,arch是没有网络的。

[补充1]

1. 使用static ip网络配置 - 用systemd-network

使用DHCP的向后看

vi /etc/systemd/network/ens34.network

[Match]
Name=ens34
[Network]
Address=192.168.1.100/24
Gateway=192.168.1.1
vim /etc/systemd/resolved.conf
[Resolve]
DNS=114.114.114.114
rm -f /etc/resolv.conf
ln -s /etc/systemd/resolve/resolv.conf /etc/resolv.conf

2. 使用dhcp

rm -f /etc/resolv.conf

#原文这里有错误:/run/systemed/....  -->/etc/systemd/....
ln -s /etc/systemd/resolve/resolv.conf /etc/resolv.conf  
 systemctl disable netctl.service
systemctl enable systemd-networkd.service
systemctl enable systemd-resolved.service
systemctl enable dhcpcd
systemctl start dhcpcd
reboot

[补充2]常用软件

base-devel 
git 
wget 
zsh 
linux-headers+virtualbox-guest-dkms(virtualbox-tools)
open-vm-tools(vmware-tools)

curl -L http://install.ohmyz.sh | sh #oh my zsh

桌面安装推荐:
http://www.cnblogs.com/bluestorm/p/5929172.html
安装:(最重要的安装参考被Q了的)
http://www.jianshu.com/p/82a40aac52aa
http://mropengate.blogspot.jp/2015/08/linux-arch-linux.html
http://www.linuxdeveloper.space/install-i3-window-manager/
http://tutos.readthedocs.io/en/latest/source/Arch.html
http://www.linuxdeveloper.space/install-i3-window-manager/

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值