1 安装Archlinux

  • 1.1 脚本:将任意os切换为ArchLinux:vps2arch

  • 1.2 用法:

    • 1.2.1 安装screen

centos:

yum -y install screen

debian/ubuntu:

apt-get install screen
  • 1.2.2 创建screen

screen -S vps2arch
  • 1.2.3 安装vps2arch

wget http://git.io/vps2arch
chmod +x vps2arch
./vps2arch
  • 1.2.4 重启vps

sync ; reboot -f
  • 1.2.5 重新ssh连接vps:用户为root,端口为22,密码为之前vps系统里的密码

2 ArchLinux的配置

  • 2.1 更新root用户密码

passwd root
  • 2.2 更新系统

pacman -Syyu
  • 2.3 安装常用软件

pacman -S base-devel screen git gcc python python2 vim zsh yaourt wqy-microhei archlinuxcn-keyring 

安装python pip

curl -O https://bootstrap.pypa.io/get-pip.py
python get-pip.py
python2 get-pip.py

查看Python版本

python -V
---
Python 3.5.1
python2 -V
---
Python 2.7.11
  • 2.4 切换bash为zsh,并使用Oh My Zsh配置

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
  • 2.5 添加源,并启用AUR

vim /etc/pacman.conf
---
添加
[archlinuxfr]
SigLevel = Never
Server = http://repo.archlinux.fr/$arch

[archlinuxcn]
SigLevel = Optional TrustedOnly
Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch

安装 yaour t以及 "archlinuxcn-keyring" 钥匙环

pacman -Sy yaourt archlinuxcn-keyring
  • 2.6 本地化设置

vim  /etc/locale.gen
---
en_US.UTF-8 UTF-8
zh_CN.UTF-8 UTF-8
zh_TW.UTF-8 UTF-8

执行locale-gen以生成locale讯息:

locale-gen
---
Generating locales...
  en_US.UTF-8... done
  zh_CN.UTF-8... done
  zh_TW.UTF-8... done
Generation complete.

设置时间:

ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
  • 2.7 修改ssh端口号

vim /etc/ssh/sshd_config
---
取消Port前的#注释,并将端口22改成1024到65535的数字

转载请注明出处(http://blog.pcwuyu.com/2016/657.html)