ubuntu中無法安裝vim

來源:互聯網
上載者:User
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

3、更新源 1)sudo apt-get update(更新源資訊) 2)sudo apt-get upgrade(更新源對應的軟體庫資訊)
4、安裝vim   sudo apt-get install vim




相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.