ubuntu 10.04 VIM安装以及apt-get修正

背景:

        Ubuntu 10.04 搭载Linux2.6.32-21 generic,从目前看也算是比较老的发行版了。此版本用来学习Linux 2.6内核比较有帮助,特别是学习Linux驱动编程,包括市场上比较经典的书籍都是基于Linux2.6内核讲的,所以一个稳定的2.6内核学习环境是必不可少的。然而,比较让人遗憾的是,Ubuntu 10.04配套的VIM却没有安装,而是比较老的VI编辑器,比如要支持C语言语法比如不支持(syntax=c),而且对于VI使用起来有诸多的不友好。VIM可以通过apt-get进行安装。

但是使用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

这种错误的根本原因是/etc/apt/sources.list里的源基本上已经不再维护Ubuntu10.04版本了,但是Ubuntu也给老版本提供了old-release维护站点,所以删除原来/etc/apt/sources.list里面的内容,将下面这个站点拷贝进去。

deb http://old-releases.ubuntu.com/ubuntu lucid main restricted universe multiverse   
deb http://old-releases.ubuntu.com/ubuntu lucid-security main restricted universe multiverse   
deb http://old-releases.ubuntu.com/ubuntu lucid-updates main restricted universe multiverse   
deb http://old-releases.ubuntu.com/ubuntu lucid-proposed main restricted universe multiverse   
deb http://old-releases.ubuntu.com/ubuntu lucid-backports main restricted universe multiverse   
deb-src http://old-releases.ubuntu.com/ubuntu lucid main restricted universe multiverse   
deb-src http://old-releases.ubuntu.com/ubuntu lucid-security main restricted universe multiverse   
deb-src http://old-releases.ubuntu.com/ubuntu lucid-updates main restricted universe multiverse   
deb-src http://old-releases.ubuntu.com/ubuntu lucid-proposed main restricted universe multiverse   
deb-src http://old-releases.ubuntu.com/ubuntu lucid-backports main restricted universe multiverse  

此时再进行apt-get update就可以成功了。

最后调用sudo apt-get install vim 就可以成功安装VIM编辑器了,vim --version显示的版本是7.2.330。

猜你喜欢

转载自blog.csdn.net/jackixzj/article/details/84898912