Skip to content

Instantly share code, notes, and snippets.

@songjiz
Last active June 7, 2016 09:09
Show Gist options
  • Save songjiz/3f34f1bf7fd75b8c948a to your computer and use it in GitHub Desktop.
Save songjiz/3f34f1bf7fd75b8c948a to your computer and use it in GitHub Desktop.
Install Arch linux
# Arch UEFI With USTC Mirror
# Use fdisk to create disk partitions
fdisk /dev/sdb
# sdb
# |-- sdb1 (as boot,EFI)
# |-- sdb2 (as root)
# |-- sdb3 (as home)
# Format
mkfs.vfat -F32 -n EFI /dev/sdb1
mkfs.ext4 -b 4096 /dev/sdb2
mkfs.ext4 -b 4096 /dev/sdb3
# Mount the disk partitions
mount -o discard,noatime /dev/sdb2 /mnt
mkdir -p /mnt/boot
mkdir -p /mnt/home
mount -o noatime /dev/sdb1 /mnt/boot
mount -o discard,noatime /dev/sdb3 /mnt/home
# Install Arch
# Change the mirrors to USTC
# Edit the /etc/pacmand.d/mirrorlist
# Server = https://mirrors.ustc.edu.cn/archlinux/$repo/os/$arch
pacman -Syy
# Ref: https://www.reddit.com/r/linuxmasterrace/comments/341rjy/oh_no_something_has_gone_wrong_arch_linux_with/
# Maybe you do not need to install intel-ucode
pacstrap /mnt base base-devel grub efibootmgr intel-ucode xdg-user-dirs vim
genfstab -pU /mnt >> /mnt/etc/fstab
arch-root /mnt
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
echo arch > /etc/hostname
# Edit /etc/locale.gen
# choose en_US.UTF-8 zh_CN.UTF-8 zh_CN.GBK
locale-gen
echo LANG=en_US.UTF-8 > /etc/locale.conf
echo KEYMAP=us /etc/vconsole.conf
ls -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
echo arch-pc > /etc/hostname
hwclock -w -u
# Grub
grub-install --efi-directory=/boot /dev/sdb
mkinitcpio -p linux
grub-mkconfig -o /boot/grub/grub.cfg
# Start dhcpcd service on boot
systemctl enable dhcpcd
# Desktop Env
pacman -S xorg xorg-server-devel xorg-twm xorg-xinit xterm
pacman -S nvidia
pacman -S plasma
# Create user and add to sudo
useradd -g users -m example
# Add the user example to sudoers file
example ALL=(ALL) ALL
# Set the password for the 'root'
passwd root
# Set the password for the user 'example'
passwd example
# Reboot
exit
umount /mnt/{boot,home}
umount /mnt
reboot
# ----------- After the user 'example' login -----------
# Create Documents, Downloads, Music, Desktop...
xdg-user-dirs-update
# yaourt
echo '#The Chinese Arch Linux communities packages.' >> /etc/pacman.conf
echo '[archlinuxcn]' >> /etc/pacman.conf
echo 'SigLevel = Never' >> /etc/pacman.conf
echo 'Server = http://repo.archlinuxcn.org/$arch' >> /etc/pacman.conf
sudo pacman -Syu yaourt
# TAR,ZIP,RAR...
sudo pacman -S file-roller p7zip zip unzip unrar
# Fcitx sougou pinyin
yaourt fcitx-sogoupin
sudo pacman -S fcitx-configtool fcitx-gtk2 fcitx-gtk3 fcitx-qt5
# Add to bottom of ~/.xinitrc
# export LC_ALL=zh_CN.UTF-8
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS="@im=fcitx"
# Font manager
yaourt -S font-manager
# Picture viewer
sudo pacman -S gpicview
# Music player
sudo pacman -S audacious
# Office
yaourt -S wps
# Email client
sudo pacman -S thunderbird
# Browser
sudo pacman -S chromium
# Others
sudo pacman -S screenfetch
# Auto start X at login hook
# Add to bottom of .xinitrc
echo 'exec startxfce4' >> ~/.xinitrc
# If you use zsh, please write to the .zshrc instead of .bashrc
echo '# Auto start X at login' >> ~/.bashrc
echo '[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx' >> ~/.bashrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment