Linux下用此命令将系统镜像写入到U盘:
dd if=archlinux.iso of=/dev/sdx
Windows下可以用ultraios或者量产工具将arch linux安装镜像文件写入到U盘里面,在此不详述,制作完启动盘后使电脑从U盘启动。
分区时建议使用cfdisk命令进入图形化分区界面,注意在分区时分两个分区,分区类型分别为swap分区和Linux分区,分区完成后使用mkfs将根文件系统分区(注意:这里你可以要把sda4更改为你电脑中的根文件系统分区)格式化为ext4格式。
mkfs -t ext4 /dev/sda4
将分区sda4挂载到“/mnt”:
mount /dev/sda4 /mnt
dhcpcd eth0否则,可能需要进行如下繁琐的配置(只是列举可能会用到的命令):
设置IP
“# ip addr add <IP address>/<subnet mask> dev <interface>”,如“# ip addr add 192.168.1.2/24 dev eth0”
设置网关:
“# ip route add default via <default gateway IP address>”,如“# ip route add default via 192.168.1.1”。
通过修改/etc/resolv.conf修改DNS:
nameserver 61.155.18.30 nameserver 8.8.8.8
# pacstrap /mnt base base-devel
# arch-chroot /mnt pacman -S grub-bios
# genfstab -p /mnt >> /mnt/etc/fstab # arch-chroot /mnt *Write your hostname to /etc/hostname. *Symlink /etc/localtime to /usr/share/zoneinfo/Zone/SubZone. Replace Zone and Subzone to your liking. For example: # ln -s /usr/share/zoneinfo/Europe/Athens /etc/localtime *Uncomment the selected locale in /etc/locale.gen and generate it with locale-gen. *Set locale preferences in /etc/locale.conf. *Add console keymap and font preferences in /etc/vconsole.conf *Configure /etc/mkinitcpio.conf as needed (see mkinitcpio) and create an initial RAM disk with: # mkinitcpio -p linux *Configure the bootloader. For GRUB, see GRUB installation and Configuration; for Syslinux, see Syslinux configuration.
*如果是双系统,即包含Windows系统的话,建议安装os-prober包,这样可以自动识别Windows引导分区 # modprobe dm-mod # grub-install --recheck /dev/sda # grub-mkconfig -o /boot/grub/grub.cfg *Set a root password with passwd. *Configure the network again for newly installed environment. See Network Configuration and Wireless Setup. pacman -S dnsutils inetutils iproute2 net-tools
#pacman -S slim #systemctl enable slim.service #vi /etc/slim.conf // 编辑slim配置文件,将session设为awesome安装awesome:
#pacman -S awesome #cp /etc/skel/.xinitrc ~ #vi ~/.xinitrc // 编辑xinitrc,写入exec awesome #chmod +x ~/.xinitrc执行完以上操作后再次重启电脑即可。
#!/bin/sh # # ~/.xinitrc # # Executed by startx (run your window manager from here) xset +fp /usr/share/fonts/local xset fp rehash if [ -d /etc/X11/xinit/xinitrc.d ]; then for f in /etc/X11/xinit/xinitrc.d/*; do [ -x "$f" ] && . "$f" done unset f fi # exec gnome-session # exec startkde # exec startxfce4 # ...or the Window Manager of your choice export LC_CTYPE="zh_CN.utf8" export XIM=fcitx export XIM_PROGRAM=fcitx export XMODIFIERS="@im=fcitx" export GTK_IM_MODULE=xim export QT_IM_MODULE=xim fcitx & exec awesome
tar cvpjf /usb/Arch_Linux_20130604.tar.bz2 / --exclude=/proc --exclude=/lost+found --exclude=/usb --exclude=/sys
tar xvpfj /usb/Arch_Linux_20130604.tar.bz2 -C /