ubuntu中無法安裝vim
一般情況下,ubuntu中預設只安裝了vi編輯工具,沒有安裝vim編輯工具。由於vim對vi進行了最佳化,能夠主動識別Linux C語言中關鍵字,並用不同的顏色標記,具有很強的閱讀性。那麼在ubuntu中,如何安裝vim工具呢。 ubuntu中,通過命令“sudo apt-get install vim ”進行安裝,一般情況下,都可以正常安裝。成功安裝vim後,在shell終端輸入命令vim,可以看到有關vim相關資訊,如下圖所示。
圖 vim詳細資料
有時候vim會安裝失敗,此時我們可以從安裝失敗反饋的資訊中找到原因,一般vim安裝失敗,大都是無法擷取到vim資源,所以這個時候就需要去更新源,涉及的檔案為/etc/apt/sources.list檔案。具體操作步驟如下:
1、備份sources.list檔案 sudo cp sources.list sources.list.back
2、替換sources.list中的內容(本人使用官方源) 可以根據自己需求選擇不同的源,將相應的源拷貝到sources.list檔案中。由於許可權問題,最有效方法是在主目錄下建立一個sources.list檔案,將源資訊拷貝到該檔案中,然後通過cp命令將sources.list檔案拷貝到/etc/apt/目錄下。相關源的資訊如下: 1)官方源 deb http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
2)163源 deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse
3)阿里源 deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
4)搜狐源 deb http://mirrors.sohu.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-backports main restricted universe multiverse
5)centos源 deb http://centos.bitcomm.cn/ubuntu trusty main restricted universe multiverse
deb http://centos.bitcomm.cn/ubuntu trusty-security main restricted universe multiverse
deb http://centos.bitcomm.cn/ubuntu trusty-updates main restricted universe multiverse
deb http://centos.bitcomm.cn/ubuntu trusty-backports main restricted universe multiverse
deb http://centos.bitcomm.cn/ubuntu trusty-proposed main restricted universe multiverse
deb-src http://centos.bitcomm.cn/ubuntu trusty main restricted universe multiverse
deb-src http://centos.bitcomm.cn/ubuntu trusty-security main restricted universe multiverse
deb-src http://centos.bitcomm.cn/ubuntu trusty-updates main restricted universe multiverse
deb-src http://centos.bitcomm.cn/ubuntu trusty-backports main restricted universe multiverse
deb-src http://centos.bitcomm.cn/ubuntu trusty-proposed main restricted universe multiverse