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。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章