有些时候,由于一些错误的操作,可能导致vim无法使用,例如如下情况:

root@eve-ng:~# vim /etc/profile
-bash: vim: command not found

此时,一般的操作方式是通过sudo apt-get install vim命令来安装。但是本次出现的问题是如下:

root@eve-ng:~# sudo apt-get install vim
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package vim is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'vim' has no installation candidate

所以我们可以选择重新更新一下。

root@eve-ng:~# sudo apt-get update
Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [109 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu xenial InRelease [247 kB]
Get:3 http://www.eve-ng.net/repo xenial InRelease [1,455 B]                                       
Get:4 http://www.eve-ng.net/repo xenial/main amd64 Packages [12.2 kB]                                  
Get:5 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [822 kB]                 
Get:6 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]                                                                                              
Get:7 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 Packages [1,201 kB]                                                                                          
Get:8 http://security.ubuntu.com/ubuntu xenial-security/main i386 Packages [638 kB]                                                                                      
Get:9 http://security.ubuntu.com/ubuntu xenial-security/main Translation-en [314 kB]                                                                                     
Get:10 http://security.ubuntu.com/ubuntu xenial-security/restricted amd64 Packages [7,204 B]                                                                             
Get:11 http://security.ubuntu.com/ubuntu xenial-security/restricted i386 Packages [7,224 B]                                                                              
Get:12 http://security.ubuntu.com/ubuntu xenial-security/restricted Translation-en [2,152 B]                                                                             
Get:13 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [480 kB]                                                                                
Get:14 http://us.archive.ubuntu.com/ubuntu xenial/main i386 Packages [1,196 kB]                                                                                          
Get:15 http://security.ubuntu.com/ubuntu xenial-security/universe i386 Packages [414 kB]                                                                                 
Get:16 http://security.ubuntu.com/ubuntu xenial-security/universe Translation-en [197 kB]                                                                                
Get:17 http://security.ubuntu.com/ubuntu xenial-security/multiverse amd64 Packages [5,728 B]                                                                             
Get:18 http://security.ubuntu.com/ubuntu xenial-security/multiverse i386 Packages [5,884 B]                                                                              
Get:19 http://security.ubuntu.com/ubuntu xenial-security/multiverse Translation-en [2,708 B]                                                                             
25% [14 Packages 93.4 kB/1,196 kB 8%]

......这需要一定的时间!

我们可以选择sudo apt-get update && sudo apt-get install vim

root@eve-ng:~# sudo apt-get update && sudo apt-get install vim
Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [109 kB]
Get:2 http://www.eve-ng.net/repo xenial InRelease [1,455 B]                                                            
Get:3 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [822 kB]                                     
Get:4 http://security.ubuntu.com/ubuntu xenial-security/main i386 Packages [638 kB]                         
Get:5 http://security.ubuntu.com/ubuntu xenial-security/main Translation-en [314 kB]                        
Get:6 http://security.ubuntu.com/ubuntu xenial-security/restricted amd64 Packages [7,204 B]                       
Get:7 http://security.ubuntu.com/ubuntu xenial-security/restricted i386 Packages [7,224 B]                
Get:8 http://security.ubuntu.com/ubuntu xenial-security/restricted Translation-en [2,152 B]               
Get:9 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [480 kB]                         
Get:10 http://security.ubuntu.com/ubuntu xenial-security/universe i386 Packages [414 kB]                    
Get:11 http://security.ubuntu.com/ubuntu xenial-security/universe Translation-en [197 kB]                              
Get:12 http://security.ubuntu.com/ubuntu xenial-security/multiverse amd64 Packages [5,728 B]                                 
Get:13 http://security.ubuntu.com/ubuntu xenial-security/multiverse i386 Packages [5,884 B]                              
Get:14 http://security.ubuntu.com/ubuntu xenial-security/multiverse Translation-en [2,708 B]                             
Get:15 http://us.archive.ubuntu.com/ubuntu xenial InRelease [247 kB]                                                                                                     
Get:17 http://www.eve-ng.net/repo xenial/main amd64 Packages [12.2 kB]                                                                                                   
Get:16 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]                                                                                             
Get:18 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 Packages [1,201 kB]                                                                                         
Get:19 http://us.archive.ubuntu.com/ubuntu xenial/main i386 Packages [1,196 kB]                                                                                          
Get:20 http://us.archive.ubuntu.com/ubuntu xenial/main Translation-en [568 kB]                                                                                           
Get:21 http://us.archive.ubuntu.com/ubuntu xenial/restricted amd64 Packages [8,344 B]                                                                                    
Get:22 http://us.archive.ubuntu.com/ubuntu xenial/restricted i386 Packages [8,684 B]                                                                                     
Get:23 http://us.archive.ubuntu.com/ubuntu xenial/restricted Translation-en [2,908 B]                                                                                    
Get:24 http://us.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages [7,532 kB]                                                                                     
Get:24 http://us.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages [7,532 kB]                                                                                     
Get:25 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 Packages [7,512 kB]                                                                                      
Get:26 http://us.archive.ubuntu.com/ubuntu xenial/universe Translation-en [4,354 kB]                                                                                     
Get:27 http://us.archive.ubuntu.com/ubuntu xenial/multiverse amd64 Packages [144 kB]                                                                                     
Get:28 http://us.archive.ubuntu.com/ubuntu xenial/multiverse i386 Packages [140 kB]                                                                                      
Get:29 http://us.archive.ubuntu.com/ubuntu xenial/multiverse Translation-en [106 kB]                                                                                     
Get:30 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [1,101 kB]                                                                                 
Get:31 http://us.archive.ubuntu.com/ubuntu xenial-updates/main i386 Packages [898 kB]                                                                                    
Get:32 http://us.archive.ubuntu.com/ubuntu xenial-updates/main Translation-en [422 kB]                                                                                   
Get:33 http://us.archive.ubuntu.com/ubuntu xenial-updates/restricted amd64 Packages [7,616 B]                                                                            
Get:34 http://us.archive.ubuntu.com/ubuntu xenial-updates/restricted i386 Packages [7,580 B]                                                                             
Get:35 http://us.archive.ubuntu.com/ubuntu xenial-updates/restricted Translation-en [2,272 B]                                                                            
Get:36 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [784 kB]                                                                               
Get:37 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe i386 Packages [712 kB]                                                                                
96% [37 Packages 219 kB/712 kB 31%]

Ign:37 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe i386 Packages
Get:38 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe Translation-en [329 kB]
Get:39 http://us.archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 Packages [16.8 kB]                                                                            
Get:40 http://us.archive.ubuntu.com/ubuntu xenial-updates/multiverse i386 Packages [15.9 kB]                                                                             
Get:41 http://us.archive.ubuntu.com/ubuntu xenial-updates/multiverse Translation-en [8,468 B]                                                                            
Get:37 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe i386 Packages [712 kB]                                                                                
Fetched 19.8 MB in 43min 50s (7,510 B/s)                                                                                                                                 
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libgpm2 libpython3.5 libpython3.5-minimal libpython3.5-stdlib python3.5 python3.5-minimal vim-common vim-runtime
Suggested packages:
  gpm python3.5-venv python3.5-doc binfmt-support ctags vim-doc vim-scripts vim-gnome-py2 | vim-gtk-py2 | vim-gtk3-py2 | vim-athena-py2 | vim-nox-py2
The following NEW packages will be installed:
  libgpm2 libpython3.5 vim vim-common vim-runtime
The following packages will be upgraded:
  libpython3.5-minimal libpython3.5-stdlib python3.5 python3.5-minimal
4 upgraded, 5 newly installed, 0 to remove and 313 not upgraded.
Need to get 12.1 MB of archives.
After this operation, 35.0 MB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 python3.5 amd64 3.5.2-2ubuntu0~16.04.9 [165 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libpython3.5-stdlib amd64 3.5.2-2ubuntu0~16.04.9 [2,137 kB]                                          
Get:3 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 python3.5-minimal amd64 3.5.2-2ubuntu0~16.04.9 [1,593 kB]                                            
Get:4 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libpython3.5-minimal amd64 3.5.2-2ubuntu0~16.04.9 [524 kB]                                           
Err:4 http://security.ubuntu.com/ubuntu xenial-security/main amd64 libpython3.5-minimal amd64 3.5.2-2ubuntu0~16.04.9                                                     
  Connection failed [IP: 91.189.91.26 80]
Get:4 http://security.ubuntu.com/ubuntu xenial-security/main amd64 libpython3.5-minimal amd64 3.5.2-2ubuntu0~16.04.9 [524 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 libgpm2 amd64 1.20.4-6.1 [16.5 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 vim-common amd64 2:7.4.1689-3ubuntu1.3 [103 kB]                                                      
Get:7 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libpython3.5 amd64 3.5.2-2ubuntu0~16.04.9 [1,360 kB]                                                 
Get:8 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 vim-runtime all 2:7.4.1689-3ubuntu1.3 [5,179 kB]                                                     
Get:9 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 vim amd64 2:7.4.1689-3ubuntu1.3 [1,036 kB]                                                           
Fetched 12.1 MB in 13min 29s (14.9 kB/s)                                                                                                                                 
(Reading database ... 93423 files and directories currently installed.)
Preparing to unpack .../python3.5_3.5.2-2ubuntu0~16.04.9_amd64.deb ...
Unpacking python3.5 (3.5.2-2ubuntu0~16.04.9) over (3.5.2-2ubuntu0~16.04.4) ...
Preparing to unpack .../libpython3.5-stdlib_3.5.2-2ubuntu0~16.04.9_amd64.deb ...
Unpacking libpython3.5-stdlib:amd64 (3.5.2-2ubuntu0~16.04.9) over (3.5.2-2ubuntu0~16.04.4) ...
Preparing to unpack .../python3.5-minimal_3.5.2-2ubuntu0~16.04.9_amd64.deb ...
Unpacking python3.5-minimal (3.5.2-2ubuntu0~16.04.9) over (3.5.2-2ubuntu0~16.04.4) ...
Preparing to unpack .../libpython3.5-minimal_3.5.2-2ubuntu0~16.04.9_amd64.deb ...
Unpacking libpython3.5-minimal:amd64 (3.5.2-2ubuntu0~16.04.9) over (3.5.2-2ubuntu0~16.04.4) ...
Selecting previously unselected package libgpm2:amd64.
Preparing to unpack .../libgpm2_1.20.4-6.1_amd64.deb ...
Unpacking libgpm2:amd64 (1.20.4-6.1) ...
Selecting previously unselected package vim-common.
Preparing to unpack .../vim-common_2%3a7.4.1689-3ubuntu1.3_amd64.deb ...
Unpacking vim-common (2:7.4.1689-3ubuntu1.3) ...
Selecting previously unselected package libpython3.5:amd64.
Preparing to unpack .../libpython3.5_3.5.2-2ubuntu0~16.04.9_amd64.deb ...
Unpacking libpython3.5:amd64 (3.5.2-2ubuntu0~16.04.9) ...
Selecting previously unselected package vim-runtime.
Preparing to unpack .../vim-runtime_2%3a7.4.1689-3ubuntu1.3_all.deb ...
Adding 'diversion of /usr/share/vim/vim74/doc/help.txt to /usr/share/vim/vim74/doc/help.txt.vim-tiny by vim-runtime'
Adding 'diversion of /usr/share/vim/vim74/doc/tags to /usr/share/vim/vim74/doc/tags.vim-tiny by vim-runtime'
Unpacking vim-runtime (2:7.4.1689-3ubuntu1.3) ...
Selecting previously unselected package vim.
Preparing to unpack .../vim_2%3a7.4.1689-3ubuntu1.3_amd64.deb ...
Unpacking vim (2:7.4.1689-3ubuntu1.3) ...
Processing triggers for mime-support (3.59ubuntu1) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Setting up libpython3.5-minimal:amd64 (3.5.2-2ubuntu0~16.04.9) ...
Setting up python3.5-minimal (3.5.2-2ubuntu0~16.04.9) ...
Setting up libpython3.5-stdlib:amd64 (3.5.2-2ubuntu0~16.04.9) ...
Setting up python3.5 (3.5.2-2ubuntu0~16.04.9) ...
Setting up libgpm2:amd64 (1.20.4-6.1) ...
Setting up vim-common (2:7.4.1689-3ubuntu1.3) ...
Setting up libpython3.5:amd64 (3.5.2-2ubuntu0~16.04.9) ...
Setting up vim-runtime (2:7.4.1689-3ubuntu1.3) ...
Setting up vim (2:7.4.1689-3ubuntu1.3) ...
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vim (vim) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vimdiff (vimdiff) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rvim (rvim) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rview (rview) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vi (vi) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/view (view) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/ex (ex) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/editor (editor) in auto mode
Processing triggers for libc-bin (2.23-0ubuntu10) ...
root@eve-ng:~#

然后可以编辑。

root@eve-ng:~# vi /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
iface eth0 inet manual
auto pnet0
iface pnet0 inet dhcp
    bridge_ports eth0
    bridge_stp off

EVE无法安装vim的更多相关文章

  1. acm的ubuntu (ubuntu16.04 安装指南,chrome安装,vim配置,git设置和github,装QQ)

    日常手贱把ubuntu14.04更新到了16.04,然后就game over了.mdzz,不然泥萌也看不到这篇博客了=.= 然后花了些时间重装了一个16.04版的,原来那个14.04的用可以用,就是动 ...

  2. ubuntu安装vim时提示 没有可用的软件包 vim,但是它被其它的软件包引用了 解决办法

    ubuntu安装vim时提示 没有可用的软件包 vim-gtk3,但是它被其它的软件包引用了 解决办法 本人在ubuntu系统安装vim  输入 sudo apt-get install vim 提示 ...

  3. [转] vim自定义配置 和 在ubnetu中安装vim

    Ubuntu 12.04安装vim和配置   问题: ubuntu默认没有安装vim,出现: jyg@ubuntu:~$ vim test.cThe program 'vim' can be foun ...

  4. mac OS X Yosemite (10.10.5) 下 安装vim 7.4笔记

    摘要 前言 需求与mac OS X 自带vim版本的冲突 默认Python解释器问题 并非Mac自带python的 homebrew 1. 前言 本文为自己作死折腾的问题记录 2. 需求与mac OS ...

  5. Debian下安装vim

    问题描述:安装完系统以后,刚要打算开始写程序,发现,vim还没有装,用su -切换到root后 直接运行apt-get install vim,提示插入disc源,然后回车,陷入无法解决的状态. 上网 ...

  6. 10秒钟安装 Vim编辑器,5分钟浏览常用命令 2015.10.25

    首先我想说,vim与vi的命令几乎相同,,所以学习编辑命令时很轻松,排除扩展相关,以及自动补全等配置的使用在外30秒钟安装 Vim编辑器,5分钟浏览常用命令环境:虚拟机Ubuntu:安装vim并浏览命 ...

  7. 安装vim

    命令安装vim sudo apt-get install vim

  8. Linux安装vim失败的解决办法

    最近想了解一下linux编程,于是linux系统下输入vim,发现竟然没有安装.好吧,那就安装吧.命令: sudo apt-get install vim 百度百科:apt-get是一条linux命令 ...

  9. Ubuntu 12.04安装vim和配置

    问题: ubuntu默认没有安装vim,出现: jyg@ubuntu:~$ vim test.cThe program 'vim' can be found in the following pack ...

随机推荐

  1. 【python&pycharm的安装使用】

    一.Python3.7安装 1. 运行python3.7.exe 2. 检查是否安装成功:命令窗口输入python -V 二.Pycharm安装 1. 运行pycharm.exe(社区版) 2. 配置 ...

  2. eclipse 项目的创建 编写 'Hello World'

    写项目之前确保 eclipse 安装完成 以及JDK 环境配置 成功 开始: 打开eclipse  右键file ->new->java project 如图: 然后输入项目名 点击Fin ...

  3. LEF 格式

    LEF 文件是布局布线根据使用的cell 几何信息库的文件格式,下面是一个LEF文件的部分,右边是对他的解释.布局布线工具将根据LEF文件的信息决定怎样布局,怎么走线,怎样生成通孔. VERSION ...

  4. .NET知识梳理——4.特性Attribute

    1. 特性 1.1        特性Attribute 特性就是一个类,继承自Attribute抽象类(该类无抽象方法.避免实例化),约定俗成用Attribute类结尾,标记时可省略掉Attribu ...

  5. Web安全测试学习笔记 - 文件包含

    基础知识 文件包含指的是一个文件动态引用另一个文件,这是一种非常灵活的动态调用方式.有点类似Java引用jar包,但区别在于jar包引用后一般是固定不变的(一般不能动态改变所引用的jar包名称),而文 ...

  6. javaScript--ECMAScript 6

    ECMAScript 6 一.ECMAScript 6 简介 1.ECMAScript 和 JavaScript 的关系 一个常见的问题是,ECMAScript 和 JavaScript 到底是什么关 ...

  7. BUUCTF [SUCTF 2019]EasySQL

    首先打开网址 发现有三种显示方法 还有一个没有输出 可以堆叠注入 1;show databases; 1;show tables; 可以看到有一个Flag表 测试发现from flag都被过滤不能直接 ...

  8. Codeforces Round #601 (Div. 2) C League of Leesins

    把每一次输入的一组数字存下来,然后把每个数字出现的组数存下来 然后找只出现过一次的数字a,那么这个数字a不是开头就是结尾,默认为开头(是哪个都无所谓),然后去找和它出现在同一组的两个数字b和c,而b和 ...

  9. js中迭代方法

    基础遍历数组:            for()            for( in )             for(var i = 0;i<arr.length;i++){       ...

  10. gets(), getline(), cin.getline()

    gets(str), getline(cin, s), cin.getline(str, len),这三个函数都是读入一行字符串的函数,下面是这三个函数的区别 1. gets() 函数是 C 语言的函 ...