dpkg / apt-get 想要安裝並覆蓋不同的套件

dpkg / apt-get 想要安裝並覆蓋不同的套件

我想安裝磅。這樣做:

apt-get install pound

產生這個:

root@myhost:~# apt-get install pound
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-3.2.0-23-generic linux-headers-3.2.0-23
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed:
  pound
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
Need to get 98.3 kB of archives.
After this operation, 226 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ precise/universe pound amd64 2.5-1.1 [98.3 kB]
Fetched 98.3 kB in 0s (418 kB/s)
Selecting previously unselected package pound.
(Reading database ... 102644 files and directories currently installed.)
Unpacking pound (from .../pound_2.5-1.1_amd64.deb) ...
Processing triggers for ureadahead ...
ureadahead will be reprofiled on next reboot
Processing triggers for man-db ...
Setting up mysql-server-5.5 (5.5.32-0ubuntu0.12.04.1) ...

Configuration file `/etc/apparmor.d/usr.sbin.mysqld'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.

mysql-server 已安裝並正在運作。我不想嘗試重新安裝這個。

Pound 套件不需要 mysql-server 作為任何依賴項。

我該如何解決?

我不想升級它,因為這會導致生產系統崩潰。似乎有東西卡住了dpkg,強制安裝任何軟體包來強制 mysql 伺服器重新安裝或升級。

答案1

聽起來您會升級 mysql-server-5.5 軟體包。此版本與中給出的版本相符USN-1909-1,看來您還沒有安裝安全性更新。

您應該查看設定檔的各個版本中的不同之處(D例如,透過按提示)。然後,如同提示所示,您可以使用 保留(該檔案的)目前版本N,使用 接受 Ubuntu 的版本Y,或使用 啟動 shell 自己處理它(例如,合併變更)Z

響應您的更新:

在過去的某個時刻,某人(您或此機器上的其他管理員)可能沒有註意到就開始了 MySQL 升級。或者係統可能配置為自動應用安全性更新,但 MySQL 由於某種原因發生故障。您可以在apt-get輸出中看到這一點:

0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.

毫無疑問,如果您檢查過dpkg -s mysql-server-5.5,狀態行不會是install ok installed

不管怎樣,第一次發生的事情是 dpkg 實際上從新套件中解壓縮了檔案(可能也停止了 MySQL,也許這就是它被中止的原因)。它嘗試“配置”MySQL,但要么在此期間出錯,要么被中止。

apt正在嘗試透過配置包來解決這個問題。您也許可以dpkg -i直接使用來繞過它(儘管dpkg也可以嘗試配置它,我不確定)

真正的解決方法是您需要安排一些停機時間並完成 MySQL 升級(並注意可能存在設定錯誤)。特別是因為您正在運行的版本有(根據甲骨文)可能損害機密性和完整性的遠端漏洞。

答案2

2 not fully installed or removed在你開始 apt 運行之前你就已經收到了這則訊息。這是不是普通的。這通常意味著您的套件資料庫處於損壞或不一致的狀態。如果你曾經看過這個,立即中止。你應該先嘗試跑步apt-get -f install來解決這個問題。如果這不起作用,您可以執行其他操作,但如果您看到訊息包含諸如 之類的單詞,則切勿繼續執行涉及包資料庫的其他操作not fully installed or removed。先解決問題。

實際上,我有點驚訝 apt 讓你在這種情況下繼續。我不經常遇到這種情況,但我記得 apt 不會讓你繼續,直到你解決了問題。

無論如何,正如您所看到的,當您安裝時pound,apt 嘗試完成 mysql 軟體包的安裝,這些軟體包是 apt 首先警告您的軟體包,並帶有上述2 not fully installed or removed訊息。

注意:@derobert 在他的回答中從稍微不同的角度涵蓋了相同的基礎。既然你顯然不理解他,我想我應該補充兩分錢。

相關內容