First, the first use its own vi editor
There is no default after installing the Ubuntu root password, if a password is required to set the root steps of:
1 sudo passwd
2 Enter the new password twice
Second, under the vi editor can not be deleted using the [backspace]
set compatible
Replaced
set nocompatible set backspace=indent,eol,start
As shown below
Then you can delete it silky ~
Third, replacing the source start operation, as the reference links: https: //blog.csdn.net/wzyaiwl/article/details/88571414
Ubuntu16.04 default is foreign source, which is very likely to cause our slow download speed. Next, we will replace Ali into domestic source.
- Copy the file to another local source
- Replacement source
- Update Source
- shell script
Copy the file to another local source
sudo cp /etc/apt/sources.list /etc/apt/sources.list.old
Replacement source
Open the sources.list file with vi, which will replace the contents below.
deb http://mirrors.aliyun.com/ubuntu/ xenial main deb-src http://mirrors.aliyun.com/ubuntu/ xenial main deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main deb http://mirrors.aliyun.com/ubuntu/ xenial universe deb-src http://mirrors.aliyun.com/ubuntu/ xenial universe deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates universe deb http://mirrors.aliyun.com/ubuntu/ xenial-security main deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe
更新源
更新软件包列表
sudo apt-get update
休复损坏的软件包,尝试卸载出错的包,重新安装正确版本的。
sudo apt-get -f install
升级系统中的所有软件包
sudo apt-get upgrade
脚本
在当前家目录下,将要使用的源保存在sources.list文件中。
# 更换国内源(使用的是阿里的源) #sourcesfile=/etc/apt/sources.list.old #if [ ! -e "$sourcesfile" ]; then # echo 'backups sources.list' # sudo cp /etc/apt/sources.list /etc/apt/sources.list.old # sudo cp $HOME/sources.list /etc/apt/sources.list #fi # 软件更新 sudo apt -y update # 更新源 sudo dpkg --configure -a sudo apt -y upgrade # 更新已安装的包 sudo apt -y dist-upgrade # 升级系统 # 注意以上安装过程中出现的安装选项,直接回车或者选择yes即可 sudo apt-get -y autoremove sudo apt -y autoclean
其他源
西电源(只有校内网网线使用,但是不限制流量,还是十分靠谱的)
deb http://linux.xidian.edu.cn/mirrors/ubuntu/ xenial main restricted universe multiverse #deb-src http://linux.xidian.edu.cn/mirrors/ubuntu/ xenial main restricted universe multiverse deb http://linux.xidian.edu.cn/mirrors/ubuntu/ xenial-security main restricted universe multiverse #deb-src http://linux.xidian.edu.cn/mirrors/ubuntu/ xenial-security main restricted universe multiverse deb http://linux.xidian.edu.cn/mirrors/ubuntu/ xenial-updates main restricted universe multiverse #deb-src http://linux.xidian.edu.cn/mirrors/ubuntu/ xenial-updates main restricted universe multiverse #deb http://linux.xidian.edu.cn/mirrors/ubuntu/ xenial-backports main restricted universe multiverse #deb-src http://linux.xidian.edu.cn/mirrors/ubuntu/ xenial-backports main restricted universe multiverse #deb http://linux.xidian.edu.cn/mirrors/ubuntu/ xenial-proposed main restricted universe multiverse #deb-src http://linux.xidian.edu.cn/mirrors/ubuntu/ xenial-proposed main restricted universe multiverse
清华源
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
网易源
deb http://mirrors.163.com/ubuntu/ wily main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ wily-security main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ wily-updates main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ wily-proposed main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ wily-backports main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ wily main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ wily-security main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ wily-updates main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ wily-proposed main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ wily-backports main restricted universe multiverse
参考于https://blog.csdn.net/qq_35451572/article/details/79516563