Ubuntu

軟體包沒有安裝候選

  • December 25, 2017

我有一個 Ubuntu 15.04,每次我嘗試下載一些東西(使用 sudo apt-get install)時,它都會說:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package <packagename> 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 '<packagename>' has no installation candidate

我試過“sudo apt-get update”,最後說:

W: Failed to fetch http://ppa.launchpad.net/irie/blender/ubuntu/dists/vivid/main/binary-amd64/Packages  404  Not Found

W: Failed to fetch http://ppa.launchpad.net/irie/blender/ubuntu/dists/vivid/main/binary-i386/Packages  404  Not Found

E: Some index files failed to download. They have been ignored, or old ones used instead.

我還檢查了“軟體和更新”視窗的“Ubuntu 軟體”選項卡中的所有復選框是否已被選中,並嘗試了“sudo apt-get upgrade”,但它們都不起作用。

另外,這是我的 sources.list 文件,看起來不錯:

# deb cdrom:[Ubuntu 15.04 _Vivid Vervet_ - Release amd64 (20150422)]/ vivid main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://old-releases.ubuntu.com/ubuntu vivid main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://old-releases.ubuntu.com/ubuntu vivid-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://old-releases.ubuntu.com/ubuntu vivid universe
deb http://old-releases.ubuntu.com/ubuntu vivid-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://old-releases.ubuntu.com/ubuntu vivid multiverse
deb http://old-releases.ubuntu.com/ubuntu vivid-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://old-releases.ubuntu.com/ubuntu vivid-backports main restricted universe multiverse

deb http://old-releases.ubuntu.com/ubuntu vivid-security main restricted
deb http://old-releases.ubuntu.com/ubuntu vivid-security universe
deb http://old-releases.ubuntu.com/ubuntu vivid-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 vivid partner
# deb-src http://archive.canonical.com/ubuntu vivid partner
deb http://www.openprinting.org/download/printdriver/debian/ lsb3.2 contrib

另外,我知道還有其他類似的問題,但沒有一個解決方案對我有用。

編輯:

正如我所看到的,評論中的許多人建議我將 sources.list 中的“archives.ubuntu.com”行更改為“old-releases.ubuntu.com”,因為我有一個過時的 Ubuntu 版本。我試過了,當我輸入“sudo apt-get update”(一些索引文件無法下載)時彈出相同的消息,當我嘗試安裝一個包時,同樣的事情發生了。

評論中的其他一些人建議我升級到更新的 Ubuntu 版本,我也嘗試過(sudo do-release-upgrade),但最後它說:

Cannot upgrade, an upgrade from 'vivid' to 'xenial' is not supported with this tool.

我也嘗試過使用 sudo do-release upgrade -d 進行升級,但是它說:

Checking for a new Ubuntu release
No new release found

我自己修好了。我遵循了評論中的一堆人的建議,將sources.list文件中的“archives.ubuntu.com”連結替換為“old-releases.ubuntu.com”,還刪除了一堆阻止的過時儲存庫我從執行’sudo apt-get update’。

引用自:https://unix.stackexchange.com/questions/412884