更新 14.04 後 ubuntu-sdk 破壞了依賴

更新 14.04 後 ubuntu-sdk 破壞了依賴

sudo apt-get dist-upgrade今天剛嘗試做;我來到了這個狀態:

$ sudo apt-get upgrade 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  phablet-tools ubuntu-sdk
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

好的,ubuntu-sdk已被保留/保留,可能由於依賴關係有新的軟體包需要安裝;所以我嘗試dist-upgrade

$ sudo apt-get dist-upgrade 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
  intltool
The following packages have been kept back:
  ubuntu-sdk
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 52.0 kB of archives.
After this operation, 245 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://dk.archive.ubuntu.com/ubuntu/ trusty/main intltool all 0.50.2-2 [52.0 kB]
Fetched 52.0 kB in 0s (872 kB/s)  
Selecting previously unselected package intltool.
(Reading database ... 343935 files and directories currently installed.)
Preparing to unpack .../intltool_0.50.2-2_all.deb ...
Unpacking intltool (0.50.2-2) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up intltool (0.50.2-2) ...

嗯...所以只是intltool安裝在那裡,而不是ubuntu-sdk;讓我們再試一次:

$ sudo apt-get upgrade 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  phablet-tools ubuntu-sdk
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

嗯……dist-upgrade再來一次?

$ sudo apt-get dist-upgrade 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  ubuntu-sdk
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

仍然保留......讓我們嘗試用更多的力量sudo apt-get install...

$ sudo apt-get install phablet-tools ubuntu-sdk
Reading package lists... Done
Building dependency tree       
Reading state information... Done
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:
 ubuntu-sdk : Depends: ubuntu-device-flash but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

那我們來嘗試一下ubuntu-device-flash

$ sudo apt-get install ubuntu-device-flash
Reading package lists... Done
Building dependency tree       
Reading state information... Done
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:
 ubuntu-device-flash : Depends: click-ubuntu-policy but it is not installable
                       Depends: ubuntu-snappy-cli but it is not installable
E: Unable to correct problems, you have held broken packages.

讓我們嘗試一下click-ubuntu-policy,儘管現在我不抱太大希望:

$ sudo apt-get install click-ubuntu-policy
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package click-ubuntu-policy 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 'click-ubuntu-policy' has no installation candidate

太好了,顯然click-ubuntu-policy它不再在存儲庫中,但它在ubuntu-device-flash包中仍然有一個懸而未決的依賴項。

在這種情況下我可以採取什麼建議的行動方案?

答案1

來自apt-get手冊頁

dist-upgrade 除了執行升級功能外,還可以智慧地處理新版本軟體包的依賴關係變化; apt-get 有一個「智慧」衝突解決系統,如有必要,它會嘗試升級最重要的軟體包,而犧牲不太重要的軟體包。因此,dist-upgrade 命令可能會刪除一些軟體包。 /etc/apt/sources.list 檔案包含從中檢索所需包檔案的位置列表

dist-upgrade嘗試安裝新的軟體包進行升級(與所做的相反),但只有在文件upgrade中列出的任何位置找到可用的軟體包時,它才能這樣做。/etc/apt/sources.list如果儲存庫遺失了某個包,如何找到它?如果找不到該包,則不會對其進行升級,而是保留該包。

這就是你的案例中發生的情況。click-ubuntu-policy包在可信賴的官方存儲庫中不可用(並且從未)可用(在packages.ubuntu.com 中查看)。ubuntu-device-flash不會升級,因為它的較新版本依賴於click-ubuntu-policy,而它在任何已知的存儲庫中都不可用apt

click-ubuntu-policy但是,如果您新增具有for 的PPA 或儲存庫來源trusty,則可以升級ubuntu-device-flash套件。但不建議這樣做。

我的建議是,由於 Ubuntu 包含了較新版本的ubuntu-device-flash,我認為click-ubuntu-policy很快就會在存儲庫中提供。

相關內容