一、首先使用自带的vi编辑器

安装完ubuntu后没有默认的root密码,如果要设置root密码需要进行如下步骤:

1 sudo passwd

2 连续输入两次新密码

ubuntu16.04更换成国内源-LMLPHP

二、vi编辑器下使用【backspace】无法删除

1.
先找到vimrc.tiny文件,一般路径是  
cd   /etc/vim/
 ubuntu16.04更换成国内源-LMLPHP

2.
由于vimrc.tiny文件需要用到root权限修改,所以要使用
sudo gedit    vimrc.tiny 
命令,在gedit里修改
3.
把原来的
set compatible

替换成

set nocompatible
set backspace=indent,eol,start

如下图所示

 ubuntu16.04更换成国内源-LMLPHP

然后就可以进行丝滑的删除操作啦~

三、开始进行替换源操作,参考链接为:https://blog.csdn.net/wzyaiwl/article/details/88571414

Ubuntu16.04默认是国外的源,这非常容易造成我们下载速度的缓慢。接下来,我们将其更换成国内阿里的源。

  1. 复制本地源到另一个文件
  2. 更换源
  3. 更新源
  4. shell脚本

复制本地源到另一个文件

sudo cp /etc/apt/sources.list /etc/apt/sources.list.old

更换源

用vi打开sources.list文件,将里面的内容换成下面。

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

05-11 19:36