apt-get “下列套件將會維持其原有版本”?

如何解決 apt-get 出現”下列套件將會維持其原有版本”? 或是英文 “The following packages have been kept back”?

下面以mysql-server-5.7、mysql-server-core-5.7為例。
~$ sudo apt-get upgrade
正在讀取套件清單... 完成
正在重建相依關係
正在讀取狀態資料... 完成
籌備升級中... 完成
下列套件將會維持其原有版本:
mysql-server-5.7 mysql-server-core-5.7
升級 0 個,新安裝 0 個,移除 0 個,有 2 個未被升級。

可以用 apt-cachce 觀察一下,明明有新版。
~$ apt-cache policy mysql-server-5.7
mysql-server-5.7:
Installed: 5.7.13-0ubuntu0.16.04.2
Candidate: 5.7.15-0ubuntu0.16.04.1
Version table:
5.7.15-0ubuntu0.16.04.1 500
500 http://tw.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
500 http://tw.archive.ubuntu.com/ubuntu xenial-security/main amd64 Packages
*** 5.7.13-0ubuntu0.16.04.2 100
100 /var/lib/dpkg/status
5.7.11-0ubuntu6 500
500 http://tw.archive.ubuntu.com/ubuntu xenial/main amd64 Packages

方法1:先前為避免被升級 hold 住版本(apt-mark hold),把它解開
sudo apt-mark unhold mysql-server-5.7 mysql-server-core-5.7
後再 sudo apt-get upgrade 一次。

方法2:重裝一次
~$ sudo apt-get install mysql-server-5.7 mysql-server-core-5.7
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libevent-core-2.0-5
Suggested packages:
tinyca
The following NEW packages will be installed:
libevent-core-2.0-5
The following packages will be upgraded:
mysql-server-5.7 mysql-server-core-5.7
2 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 10.2 MB of archives.
After this operation, 163 kB of additional disk space will be used.
Do you want to continue? [Y/n]

(Visited 1,006 times, 1 visits today)

發佈留言