
我正在使用 Debian 9.5,最近卸載了一個軟體包 ( mariadb
),現在當我嘗試安裝新軟體包時,我不斷收到以下訊息:
E: Unable to correct problems, you have held broken packages.
我已經嘗試過這些命令但沒有結果:
sudo dpkg --configure -a
sudo apt-get install -f
apt-get install --fix-broken
我還運行了此命令來顯示損壞的包,但它沒有顯示任何內容:
apt-mark showhold
即使當我嘗試運行 sudo 時apt-get upgrade
我也會得到這個:
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
然後我能夠安裝 aptitude 套件管理器(不知道如何),並嘗試安裝新套件,sudo aptitude install mysql-server
它顯示了一些內容:
The following packages have unmet dependencies:
libdbi-perl : Depends: perlapi-5.24.1 which is a virtual package, provided by:
- perl-base (5.24.1-3+deb9u4), but 5.26.2-7 is installed
libfcgi-perl : Depends: perlapi-5.24.1 which is a virtual package, provided by:
- perl-base (5.24.1-3+deb9u4), but 5.26.2-7 is installed
libterm-readkey-perl : Depends: perlapi-5.24.1 which is a virtual package, provided by:
- perl-base (5.24.1-3+deb9u4), but 5.26.2-7 is installed
libdbd-mysql-perl : Depends: perlapi-5.24.1 which is a virtual package, provided by:
- perl-base (5.24.1-3+deb9u4), but 5.26.2-7 is installed
The following actions will resolve these dependencies:
Keep the following packages at their current version:
1) default-mysql-server [Not Installed]
2) libcgi-fast-perl [Not Installed]
3) libdbd-mysql-perl [Not Installed]
4) libdbi-perl [Not Installed]
5) libfcgi-perl [Not Installed]
6) libterm-readkey-perl [Not Installed]
7) mariadb-server-10.1 [Not Installed]
8) mysql-server [Not Installed]
Leave the following dependencies unresolved:
9) libcgi-pm-perl recommends libcgi-fast-perl (>= 1:2.01)
10) mariadb-client-10.1 recommends libdbd-mysql-perl (>= 1.2202)
11) mariadb-client-10.1 recommends libdbi-perl
12) mariadb-client-10.1 recommends libterm-readkey-perl
這是的輸出apt policy pearl-base
:
perl-base:
Installed: 5.26.2-7
Candidate: 5.26.2-7
Version table:
*** 5.26.2-7 500
500 http://ftp.us.debian.org/debian testing/main amd64 Packages
100 /var/lib/dpkg/status
5.24.1-3+deb9u4 500
500 http://httpredir.debian.org/debian stretch/main amd64 Packages
500 http://ftp.de.debian.org/debian stretch/main amd64 Packages
500 http://deb.debian.org/debian stretch/main amd64 Packages
答案1
您的儲存庫中有測試,優先權為 500,與穩定儲存庫相同;這實際上意味著您正在運行 Debian 測試,而不是 Debian 9.5。 (感謝您幫助測試 Debian 的下一個版本!)
mysql-server
目前在測試中不可用,因此apt install mysql-server
(或其變體)嘗試在 Debian stable 中安裝該版本;但這需要 Perl 的 Debian 穩定版,而不是 Debian 測試版,因此安裝無法繼續。
為了解決這個問題,我建議恢復到 Debian 穩定版。如果你想繼續測試,你必須等待 MySQL 遷移到那裡,或切換到混合測試/不穩定設定.