Ubuntu18.04 添加下载源

1、下载并安装vim

在终端输入一下命令安装vim:
sudo apt-get install vim-gtk

备注:
可通过以下途径修改vim的界面:
1)用vim打开vimrc

sudo vim /etc/vim/vimrc

2)按键盘i进入编辑模式,将文件里面的 syntax on 取消注释。

3)在文件最后一行添加以下代码:

set nu                           // 在左侧行号
set tabstop                  //tab 长度设置为 4
set nobackup               //覆盖文件时不备份
set cursorline               //突出显示当前行
set ruler                       //在右下角显示光标位置的状态行
set autoindent             //自动缩进

按 esc退出编辑模式,输入:wq!强制保存并退出即可。

2、修改源文件sources.list

1)终端输入以下命令备份源文件:

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

1)输入以下命令打开文件编辑:
sudo vim /etc/apt/sources.list

2)将文件内容替换为以下TLS版清华镜像源:

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse

# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

你可能感兴趣的:(Ubuntu18.04)