apt-get 似乎忽略了指定的软件包版本

apt-get 似乎忽略了指定的软件包版本

我刚刚添加了一个版本号较低的 PPA(用于 Compiz),并创建了一个 apt_preferences 文件:

Package: *
Pin: release o=LP-PPA-townsend-compiz-nvidia-refresh-test
Pin-Priority: 600

果然,政策改变了,但我必须手动“降级”软件包(这里我已经这样做了compiz):

$ apt-cache policy libcompizconfig0 compiz{,-core,-gnome,config-settings-manager,-plugins{,-default}}  
libcompizconfig0:
  Installed: 1:0.9.11.1+14.04.20140623-0ubuntu1
  Candidate: 1:0.9.11.1+14.04.20140623-0ubuntu1
  Version table:
 *** 1:0.9.11.1+14.04.20140623-0ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ trusty-proposed/main amd64 Packages
        100 /var/lib/dpkg/status
     1:0.9.11+14.04.20140423-0ubuntu1ppa2 0
        600 http://ppa.launchpad.net/townsend/compiz-nvidia-refresh-test/ubuntu/ trusty/main amd64 Packages
     1:0.9.11+14.04.20140423-0ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
     1:0.9.11+14.04.20140409-0ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
compiz:
  Installed: 1:0.9.11+14.04.20140423-0ubuntu1ppa2
  Candidate: 1:0.9.11+14.04.20140423-0ubuntu1ppa2
  Version table:
     1:0.9.11.1+14.04.20140623-0ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ trusty-proposed/main amd64 Packages
 *** 1:0.9.11+14.04.20140423-0ubuntu1ppa2 0
        600 http://ppa.launchpad.net/townsend/compiz-nvidia-refresh-test/ubuntu/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status
     1:0.9.11+14.04.20140423-0ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
     1:0.9.11+14.04.20140409-0ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
compiz-core:
  Installed: 1:0.9.11.1+14.04.20140623-0ubuntu1
  Candidate: 1:0.9.11.1+14.04.20140623-0ubuntu1
  Version table:
 *** 1:0.9.11.1+14.04.20140623-0ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ trusty-proposed/main amd64 Packages
        100 /var/lib/dpkg/status
     1:0.9.11+14.04.20140423-0ubuntu1ppa2 0
        600 http://ppa.launchpad.net/townsend/compiz-nvidia-refresh-test/ubuntu/ trusty/main amd64 Packages
     1:0.9.11+14.04.20140423-0ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
     1:0.9.11+14.04.20140409-0ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
compiz-gnome:
  Installed: 1:0.9.11.1+14.04.20140623-0ubuntu1
  Candidate: 1:0.9.11.1+14.04.20140623-0ubuntu1
  Version table:
 *** 1:0.9.11.1+14.04.20140623-0ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ trusty-proposed/main amd64 Packages
        100 /var/lib/dpkg/status
     1:0.9.11+14.04.20140423-0ubuntu1ppa2 0
        600 http://ppa.launchpad.net/townsend/compiz-nvidia-refresh-test/ubuntu/ trusty/main amd64 Packages
     1:0.9.11+14.04.20140423-0ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
     1:0.9.11+14.04.20140409-0ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
compizconfig-settings-manager:
  Installed: 1:0.9.11.1+14.04.20140623-0ubuntu1
  Candidate: 1:0.9.11.1+14.04.20140623-0ubuntu1
  Version table:
 *** 1:0.9.11.1+14.04.20140623-0ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ trusty-proposed/universe amd64 Packages
        100 /var/lib/dpkg/status
     1:0.9.11+14.04.20140423-0ubuntu1ppa2 0
        600 http://ppa.launchpad.net/townsend/compiz-nvidia-refresh-test/ubuntu/ trusty/main amd64 Packages
     1:0.9.11+14.04.20140423-0ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ trusty-updates/universe amd64 Packages
     1:0.9.11+14.04.20140409-0ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
compiz-plugins:
  Installed: 1:0.9.11.1+14.04.20140623-0ubuntu1
  Candidate: 1:0.9.11.1+14.04.20140623-0ubuntu1
  Version table:
 *** 1:0.9.11.1+14.04.20140623-0ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ trusty-proposed/universe amd64 Packages
        100 /var/lib/dpkg/status
     1:0.9.11+14.04.20140423-0ubuntu1ppa2 0
        600 http://ppa.launchpad.net/townsend/compiz-nvidia-refresh-test/ubuntu/ trusty/main amd64 Packages
     1:0.9.11+14.04.20140423-0ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ trusty-updates/universe amd64 Packages
     1:0.9.11+14.04.20140409-0ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
compiz-plugins-default:
  Installed: 1:0.9.11.1+14.04.20140623-0ubuntu1
  Candidate: 1:0.9.11.1+14.04.20140623-0ubuntu1
  Version table:
 *** 1:0.9.11.1+14.04.20140623-0ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ trusty-proposed/main amd64 Packages
        100 /var/lib/dpkg/status
     1:0.9.11+14.04.20140423-0ubuntu1ppa2 0
        600 http://ppa.launchpad.net/townsend/compiz-nvidia-refresh-test/ubuntu/ trusty/main amd64 Packages
     1:0.9.11+14.04.20140423-0ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
     1:0.9.11+14.04.20140409-0ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages

当我尝试一次性替换 PPA 中的版本时,会发生以下情况:

$ sudo apt-get install  {libcompizconfig0,compiz{,-core,-gnome,config-settings-manager,-plugins{,-default}}}=1:0.9.11+14.04.20140423-0ubuntu1ppa2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
compiz is already the newest version.
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:
 compiz-plugins : Depends: compiz-core (= 1:0.9.11.1+14.04.20140623-0ubuntu1) but 1:0.9.11+14.04.20140423-0ubuntu1ppa2 is to be installed
 compiz-plugins-default : Depends: compiz-core (= 1:0.9.11.1+14.04.20140623-0ubuntu1) but 1:0.9.11+14.04.20140423-0ubuntu1ppa2 is to be installed
E: Unable to correct problems, you have held broken packages.

这是什么意思1:0.9.11.1+14.04.20140623-0ubuntu1?我为所有软件包指定了兼容版本。

让我们尝试一些更保守的方法:

$ sudo apt-get install  compiz-core=1:0.9.11+14.04.20140423-0ubuntu1ppa2
Reading package lists... Done
Building dependency tree   
Reading state information... Done
The following packages will be REMOVED:
  compiz compiz-gnome compiz-plugins compiz-plugins-default
  compizconfig-settings-manager libcompizconfig0 python-compizconfig
  ubuntu-desktop unity unity-tweak-tool
The following packages will be DOWNGRADED:
  compiz-core
0 upgraded, 0 newly installed, 1 downgraded, 10 to remove and 1 not upgraded.
Need to get 710 kB of archives.
After this operation, 24.7 MB disk space will be freed.
Do you want to continue? [Y/n] n
Abort.

好吧,这行不通。显然,尝试“降级”任何相关软件包组合都会导致同样的“持有损坏的软件包”错误。

至此我已经没有主意了。

答案1

没关系,我缺少一个强制将所有内容强制为候选版本的软件包libdecoration0 (= 1:0.9.11+14.04.20140423-0ubuntu1ppa2)。谢谢aptitude

相关内容