Apt

無法在 raspbian 設備上將 systemd 從 232-25+deb9u2 更新到 232-25+deb9u4

  • October 11, 2018

我的真正目標是執行 systemd-journal-remote,以便我可以將日誌從該設備發送到遠端日誌接收器。apt-get update/upgrade顯示沒有需要升級的包

$ sudo apt-get install systemd-journal-remote
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:
systemd-journal-remote : Depends: systemd (= 232-25+deb9u4) but 232-25+deb9u2 is to be installed
E: Unable to correct problems, you have held broken packages.

$ sudo apt-get install systemd
Reading package lists... Done
Building dependency tree
Reading state information... Done
systemd is already the newest version (232-25+deb9u2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

$ cat /etc/issue
Raspbian GNU/Linux 9 \n \l

$ cat /etc/debian_version
9.4

我找到了原因。檢查 /etc/apt/preferences.d 中以“.pref”結尾的文件。就我而言,我有一個名為 10-somefilename.pref 的文件,它將我所有的包保存到它們的初始版本。

引用自:https://serverfault.com/questions/934931