在 Ubuntu 18.04.5 上安装 motd-news-config 和升级基础文件时出错

在 Ubuntu 18.04.5 上安装 motd-news-config 和升级基础文件时出错

我正在尝试apt upgrade我的系统,但是它失败了:

You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 ubuntu-server : Depends: motd-news-config but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

因此我尝试apt --fix-broken install显示:

The following additional packages will be installed:
  base-files motd-news-config
The following NEW packages will be installed:
  motd-news-config
The following packages will be upgraded:
  base-files

但它失败了:

Preparing to unpack .../base-files_10.1ubuntu2.10_amd64.deb ...
Warning: Stopping motd-news.service, but it can still be activated by:
  motd-news.timer
Unpacking base-files (10.1ubuntu2.10) over (10.1ubuntu2.9) ...
dpkg: error processing archive /var/cache/apt/archives/base-files_10.1ubuntu2.10_amd64.deb (--unpack):
 unable to create '/usr/bin/locale-check.dpkg-new' (while processing './usr/bin/locale-check'): Operation not permitted
Reinstalling /etc/default/motd-news that was backed-up
motd-news.service is a disabled or a static unit, not starting it.
Errors were encountered while processing:
 /var/cache/apt/archives/base-files_10.1ubuntu2.10_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

所以我终于尝试了apt install motd-news-config但失败了:

The following packages have unmet dependencies:
 motd-news-config : Breaks: base-files (< 10.1ubuntu2.10) but 10.1ubuntu2.9 is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

我不明白这是怎么回事。似乎升级需要与 motd-news-config 不兼容的 base-files 版本,而更新也需要 motd-news-config。我也尝试搜索可能unable to create '/usr/bin/locale-check.dpkg-new'是错误的实际来源,但我找不到任何相关信息。有什么帮助吗?

更新:PPA 列表来自grep ^ /etc/apt/sources.list /etc/apt/sources.list.d/*

deb http://mirrors.digitalocean.com/ubuntu/ bionic main restricted
deb http://mirrors.digitalocean.com/ubuntu/ bionic-updates main restricted
deb http://mirrors.digitalocean.com/ubuntu/ bionic universe
deb http://mirrors.digitalocean.com/ubuntu/ bionic-updates universe
deb http://mirrors.digitalocean.com/ubuntu/ bionic multiverse
deb http://mirrors.digitalocean.com/ubuntu/ bionic-updates multiverse
deb http://mirrors.digitalocean.com/ubuntu/ bionic-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu bionic-security main restricted
deb http://security.ubuntu.com/ubuntu bionic-security universe
deb http://security.ubuntu.com/ubuntu bionic-security multiverse

答案1

对我来说真正有效的解决方案是强制安装:

sudo dpkg -i --force-all /var/cache/apt/archives/base-files_10.1ubuntu2.2_amd64.deb

相关内容