为什么安装没有更新的软件包会失败?更新可用后原始软件包是否会从存储库中删除?

为什么安装没有更新的软件包会失败?更新可用后原始软件包是否会从存储库中删除?

在全新安装 14.04.1 后,我删除了一些软件包,禁用了更新(因为更新导致挂起/睡眠功能不起作用),运行apt-get updateapt-get upgrade(当然会打印0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.),最后尝试使用安装软件包apt-get,但收到此错误消息:

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 clang-3.3 : Breaks: clang-3.4 but 1:3.4-1ubuntu3 is to be installed
 clang-3.4 : Breaks: clang-3.3 but 1:3.3-16ubuntu1 is to be installed
 clang-3.5 : Breaks: clang but 1:3.4-0ubuntu1 is to be installed
             Breaks: clang-3.3 but 1:3.3-16ubuntu1 is to be installed
             Breaks: clang-3.4 but 1:3.4-1ubuntu3 is to be installed
 clang-format-3.3 : Breaks: clang-format-3.4 but 1:3.4-1ubuntu3 is to be installed
 clang-format-3.4 : Breaks: clang-format-3.3 but 1:3.3-16ubuntu1 is to be installed
 clang-format-3.5 : Breaks: clang-format-3.3 but 1:3.3-16ubuntu1 is to be installed
 epiphany-browser : Depends: libwebkit2gtk-3.0-25 (>= 2.1.4) but it is not going to be installed
 libreoffice : Depends: libreoffice-base but it is not going to be installed
               Depends: libreoffice-core (= 1:4.2.3~rc3-0ubuntu2) but 1:4.2.4-0ubuntu2 is to be installed
               Depends: libreoffice-report-builder-bin but it is not going to be installed
 octave : Depends: default-jre-headless but it is not going to be installed
 openshot : Depends: gtk2-engines-pixbuf but it is not going to be installed
 python-clang-3.3 : Breaks: python-clang-3.4 but 1:3.4-1ubuntu3 is to be installed
 python-clang-3.4 : Breaks: python-clang-3.3 but 1:3.3-16ubuntu1 is to be installed
                    Breaks: python-clang-3.5 but 1:3.5~svn201651-1ubuntu1 is to be installed
 python-clang-3.5 : Breaks: python-clang-3.3 but 1:3.3-16ubuntu1 is to be installed
                    Breaks: python-clang-3.4 but 1:3.4-1ubuntu3 is to be installed
E: Unable to correct problems, you have held broken packages.

两个都:

dpkg --get-selections | grep hold

和:

apt-mark showhold 

不返回任何内容。

我怀疑这是由于禁用了更新源造成的。如果是,那么为什么 apt-get 不能只安装发布时的版本?为什么它需要更新的版本?

如果有安全更新,原始软件包是否会从存储库中删除?是否只有依赖项的更新版本可用?

$ cat /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
deb cdrom:[Ubuntu 14.04.1 LTS _Trusty Tahr_ - Release i386 (20140722.2)]/ trusty main restricted

答案1

我不知道你到底做了什么,但我猜你是对的,你的“已禁用的更新源”破坏了一切。(而且您的软件源应该与挂起/睡眠无关……即使更新也必须手动启动,因此一旦完成,它也不会影响挂起/睡眠)。
apt依赖软件源来知道在哪里和更新/下载/安装什么,如果没有适当可靠的软件源,它就会瘫痪。您可以尝试sudo apt-get check获取一些信息,但无论如何您可能需要恢复它们:

如果你以某种方式破坏了你的软件源,你可以去这个网站http://repogen.simplylinux.ch/创建新的 sources.list 文件。并/或按照此处有路线有关备份当前源并自动重新创建它们或从上述站点获取的更多信息。

如果您不想要更新版本的软件包,那么您可以只运行当前安装的软件包,尽管可能存在等待修补的安全漏洞,或者等待改进的更新。

答案2

您可以尝试运行sudo apt-get dist-upgrade,它会像普通的“升级”包一样更新更多包。
此外,调用sudo apt-get checksudo apt-get -f也不会有什么坏处。

答案3

如果您已禁用所有存储库,则问题在于您尝试安装的应用程序来自其中一个存储库。因此,您要么需要激活所有存储库,要么找到此软件使用的特定存储库并激活它。

相关内容