VirtualBox設(shè)置
- 虛擬機名稱和類型
名稱:隨意
類型:Linux
版本:Arch Linux(64-bit) - 內(nèi)存大小:1024M
- 虛擬硬盤
大小:8G
格式:VDI
固定大小 - 下載Archlinux
版本:archlinux-2016.01.01-dual - 將下載好的文件分配到虛擬機的光驅(qū)
安裝
參考:官方wiki
- 命令
lsblk
查看設(shè)備情況,得到硬盤為:sda - 創(chuàng)建分區(qū)表
- 打開設(shè)備:
parted /dev/sda
- 創(chuàng)建MBR/msdos 分區(qū)表:
(parted) mklabel msdos
- 創(chuàng)建Boot分區(qū):
(parted) mkpart primary ext4 1M 100M
(parted) set 1 boot on
- 創(chuàng)建swap分區(qū):
(parted) mkpart primary linux-swap 100M 2048M
- 創(chuàng)建/分區(qū):
(parted) mkpart primary ext4 2048M 100%
- 格式化分區(qū):
- boot分區(qū):`mkfs.ext4 /dev/sda1`
- /分區(qū):`mkfs.ext4 /dev/sda3`
- swap分區(qū):`mkswap /dev/sda2`
- 啟用swap:
swapon /dev/sda2
- 掛載分區(qū):
- /分區(qū):`mount /dev/sda3 /mnt`
- boot分區(qū):
`mkdir /mnt/boot`
`mount /dev/sda1 /mnt/boot`
- 增加國內(nèi)鏡像源
nano /etc/pacman.d/mirrorlist
Server = http://mirrors.163.com/archlinux/$repo/os/$arch
Server = http://mirrors.sohu.com/archlinux/$repo/os/$arch
Server = http://mirrors.ustc.edu.cn/archlinux/$repo/os/$arch
- 刷新:
pacman -Syy
安裝基本系統(tǒng)
- 安裝基本系統(tǒng)
pacstrap -i /mnt base #base-devel 可不裝
- fstab
genfstab -U -p /mnt > /mnt/etc/fstab
使用命令cat /mnt/etc/fstab
檢查內(nèi)容是否正確 - 切換目錄chroot
arch-chroot /mnt /bin/bash
- Locale
nano /etc/locale.gen
增加內(nèi)容:
en_US.UTF-8 UTF-8
zh_CN.UTF-8 UTF-8
使最后用命令locale-gen
生成。
創(chuàng)建locale.conf文件:
echo LANG=en_US.UTF-8 > /etc/locale.conf
nano搜索文本:按Ctrl+W,回車確定。用Alt+W定位到下一個匹配。
- 時間設(shè)置
選擇時區(qū):tzselect
設(shè)置關(guān)聯(lián)文件:ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
- 設(shè)置root密碼:
passwd root
- 設(shè)置主機名:
echo "Archlinux" > /etc/hostname
- 安裝bootloader:
pacman -S grub #os-prober 識別硬盤上其他系統(tǒng)的工具
grub-install --recheck /dev/sda
生成配置文件:
grub-mkconfig -o /boot/grub/grub.cfg
- 配置網(wǎng)絡(luò)
查看網(wǎng)卡名:ip link show
設(shè)置啟動dhcp:systemctl enable dhcpcd@enp0s3.service
- 卸載分區(qū)并重啟系統(tǒng)
推出chroot:exit
卸載分區(qū):
umount -R /mnt/boot
umount -R /mnt
重啟系統(tǒng):reboot
配置
- 新增用戶
- 新增用戶及設(shè)置密碼:
useradd -m mu
passwd mu
- 安裝sudo
pacman -S sudo
- 增添sudo用戶
nano /etc/sudoers
添加:mu ALL=(ALL) ALL
- 安裝字體
中文字體:pacman -S wqy-zenhei wqy-microhei
等寬字體:
pacman -S ttf-dejavu
pacman -S adobe-source-code-pro-fonts
- openssh安裝
- 安裝:
pacman -S openssh
- 允許root登陸:
nano /etc/ssh/sshd_config
將PermitRootLogin
改為yes,沒有就添加 - 啟動服務(wù):
systemctl start sshd
- 設(shè)置開機啟動:
systemctl enable sshd
- 解壓軟件:
zip:pacman -S p7zip
rar:pacman -S unrar
圖形界面:pacman -S file-roller
- Yaourt
添加源:nano /etc/pacman.conf
[archlinuxfr] SigLevel = Never Server = http://repo-fr.archlinuxcn.org/$arch
安裝:pacman -Sy yaourt
- networkmanager
安裝:pacman -S networkmanager
圖形:pacman -S network-manager-applet xfce4-notifyd
PPTP:networkmanager-pptp
運行:systemctl start NetworkManager
開啟啟動:systemctl enable NetworkManager
圖形界面的安裝
- 安裝顯卡驅(qū)動:
pacman -S xf86-video-vesa
- 安裝Xorg:
pacman -S xorg-server xorg-xinit xorg-utils xorg-server-utils
- 安裝xfce4
安裝:pacman -S xfce4 xfce4-goodies
啟動參數(shù)設(shè)置:- 復(fù)制配置文件到home目錄:
cp /etc/X11/xinit/xinitrc ~/.xinitrc
-
nano .xinitrc
添加:exec startxfce4
- 啟動桌面:
startx
- 復(fù)制配置文件到home目錄:
- 中文設(shè)置
nano .xinitrc
在exec前添加內(nèi)容:
export LANG=zh_CN.UTF-8
export LANGUAGE=zh_CN:en_US
export LC_CTYPE=en_US.UTF-8
安裝sogou拼音
- 安裝fcitx:
pacman -S fcitx-im
fcitx圖形界面配置:
pacman -S fcitx-configtool
- 下載sogou:
curl -L-O https://aur.archlinux.org/cgit/aur.git/snapshot/fcitx-sogoupinyin.tar.gz
- 解壓包:
tar -xvzf fcitx-sogoupinyin.tar.gz
- 生成并安裝軟件包:
makepkg -sri
-s /--syncdeps 表示自動執(zhí)行安裝依賴關(guān)系。
-r /--rmdeps 會在編譯后刪除不需要的編譯時依賴。
-i /--install 會安裝軟件包。
-
~/.xprofile
文件添加:
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS="@im=fcitx"
安裝wps-office
- 先安裝aur里面的libpng12
- 再安裝aur里面的wps-office
問題
- 裝好后沒有網(wǎng)絡(luò)
ip link show 看下網(wǎng)卡叫什么名字,然后用下面的命令
ip link set eth0 up
dhcpcd eth0 - 關(guān)閉tty1
ps aux | grep tty1 | grep bash
kill -9 tty1_pid
........
http://user.qzone.qq.com/1010841065/blog/1428768109