【轉】ubuntu 11.04使用apt-get安裝軟體時一直提示E:unable to locate package

來源:互聯網
上載者:User

標籤:

問題:

VMware虛擬機器安裝了ubuntu 11.04,在使用apt-get安裝軟體時一直提示E:Unable to locate package。
百度了原因,說是要更新源,使用命令:sudo apt-get update更新了,但更新之後問題還是存在;

解決方案:

主要還是源的問題,目前網上找的很多源都是很久以前的了,很多的可能都不能用了; 然後自己重新下載了一個ubuntu 14.04版本的源替換原來的sources.list檔案,然後運行sudo apt-get update更新後就可以安裝軟體了。

更新源地址(這是Ubuntu 14.04的/etc/apt/source.list檔案的內容):
#deb cdrom:[Ubuntu 14.04 LTS _Trusty Tahr_ - Release amd64 (20140417)]/ trusty main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ trusty main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ trusty universe
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty universe
deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates universe
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://us.archive.ubuntu.com/ubuntu/ trusty multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty multiverse
deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu trusty-security main restricted
deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted
deb http://security.ubuntu.com/ubuntu trusty-security universe
deb-src http://security.ubuntu.com/ubuntu trusty-security universe
deb http://security.ubuntu.com/ubuntu trusty-security multiverse
deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse

## Uncomment the following two lines to add software from Canonical‘s
## ‘partner‘ repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu trusty partner
# deb-src http://archive.canonical.com/ubuntu trusty partner

## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb http://extras.ubuntu.com/ubuntu trusty main
deb-src http://extras.ubuntu.com/ubuntu trusty main

 

修改Ubuntu系統源的方法:

1、更源的儲存檔案的許可權,在終端中執行下面的命令:

chmod 777 /etc/apt/sources.list

 

2、開啟源檔案

在終端中執行下面的命令:

gedit /etc/apt/sources.list

 

喜歡vi的朋友可以用下面的命令:

vi /etc/apt/sources.list

 

3、把上面給出的Ubuntu 14.04的源複製到sources.list檔案中儲存退出,其中以 # 號開頭的表示注釋,可以一起複製,不會出錯。

 

4、在終端中執行下面的命令:

sudo apt-get update

 

5、關於添加源後Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit.*****錯誤的解決辦法:

  a、在終端中輸入命令:  vi apt.conf

  b、然後加入如下內容 :

    APT

    {

       Cache-Limit  67108864;

    };

  c、儲存退出,再次apt-get update,問題應該就可以解決了,若是你添加的源更多,可能還會報錯,那麼可以再把67108864這個數值改大,

   主要原因是預設的緩衝不夠,需要手動設定apt.conf 檔案, 在這裡設定了64mb

   註:若是沒有apt.conf,那麼就需要建立apt.conf檔案,建立檔案之後再執行以上操作。

 

本文轉自:

http://www.itnose.net/detail/6116378.html

http://jingyan.baidu.com/article/f54ae2fcc881881e93b84967.html

【轉】ubuntu 11.04使用apt-get安裝軟體時一直提示E:unable to locate package

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.