從一臺(tái)新的ubuntu開(kāi)始配置
1.添加新用戶
使用命令
#adduser bobo
Adding user 'second' ...
Adding new group 'second' (1001) ...
Adding new user 'second' (1001) with group 'second' ...
Creating home directory '/home/second' ...
Copying files from '/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for second
Enter the new value, or press ENTER for the default
Full Name []:
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n] y
在/etc/sudoers可以看到有關(guān)sudo的配置誓篱,將bobo加入sudo組就可以執(zhí)行sudo
#usermod -g sudo bobo
2.添加阿里的源
備份/etc/apt/sources.list
#cd /etc/apt
#mv sources.list sources.list.bak
新建一個(gè)sources.list抡爹,將以下內(nèi)容寫(xiě)入新建的文件中
deb http://mirrors.aliyun.com/ubuntu/ trusty main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main multiverse restricted universe
之后執(zhí)行#sudo apt update
即可成功更換軟件源
3.安裝oh my zsh
首先切換到新建的用戶bobo上登錄敢课。之后$sudo apt install zsh git
安裝zsh和git冤荆,完成之后使用以下命令安裝ohmyzsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
之后修改/etc/passwd對(duì)應(yīng)賬戶之后的內(nèi)容就可以將默認(rèn)shell更改為zsh
4.安裝python3.6, virtualenv,建立獨(dú)立環(huán)境
安裝zlib依賴
apt-get install zlib1g-dev
安裝python36
wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tar.xz
xz -d Python-3.6.0.tar.xz
tar -xvf Python-3.6.0.tar
cd Python-3.6.0
./configure
make
sudo make install
第一次編譯安裝之后,有可能會(huì)發(fā)現(xiàn)輸入python3.6 之后他托,方向鍵失效礼仗。
原因是 readline 庫(kù)沒(méi)有安裝。
解決方式:
安裝 readline 庫(kù)
$sudo apt-get install libreadline-dev
安裝之后会宪,再將 python 重新編譯安裝一次
cd Python-3.6.0
./configure
make
sudo make install
指定環(huán)境的python版本(3.6沒(méi)有zlib肖卧,很瓜皮,不好用)
virtualenv python36 --python=python3.5