Ubuntu 16.04 LTS 安装 Vim (及无法安装Vim的解决方法)

打开命令终端 输入vi

若系统已安装 Vim,则会出现以下界面

Ubuntu 16.04 LTS 安装 Vim (及无法安装Vim的解决方法)_第1张图片

 

若未安装,则会出现以下界面

xxx

请尝试使用命令 apt-get 或  安装

(由于笔者没保留安装失败截图,所以只能用语言描述一下,eeee)

 

此时输入安装命令:sudo apt-get install vim

等待安装即可

 

安装完成后,在终端输入 vim --version 查看是否安装成功。

 

PS:有的人会出现输入安装命令后,等待很久都无法安装的情况(笔者在安装过程中也遇到了该问题)

这可能是因为安装源的问题

解决方法:更换安装源

1.在终端输入

sudo gedit /etc/apt/sources.list  

该命令的作用是用gedit打开安装来源文件 sources.list

 

2.替换安装源,使用阿里的云

将文件中的内容替换为以下内容

# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse
(安装来源转在自  https://blog.csdn.net/Mr_dhy/article/details/80489485 )

 

3.在终端重新输入

sudo apt-get update

sudo apt-get install vim

即可成功安装

 

 

 

 

 

你可能感兴趣的:(Ubuntu,软件安装,Ubuntu,Vim)