尝试更新软件包时遇到 /var/cache/apt/archives/base-files_10.1ubuntu2.2_amd64.deb 错误

尝试更新软件包时遇到 /var/cache/apt/archives/base-files_10.1ubuntu2.2_amd64.deb 错误

我尝试了多种方法让它工作,但没有工作:

我正在运行sudo apt-get upgrade并出现以下错误:

Preparing to unpack .../base-files_10.1ubuntu2.2_amd64.deb ...
Unpacking base-files (10.1ubuntu2.2) over (9.4ubuntu4.13) ...
dpkg: error processing archive /var/cache/apt/archives/base-files_10.1ubuntu2.2_amd64.deb (--unpack):
 trying to overwrite '/etc/default/motd-news', which is also in package motd-news-config 9.4ubuntu4.13
Errors were encountered while processing:
 /var/cache/apt/archives/base-files_10.1ubuntu2.2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

我怎样才能解决这个问题?

答案1

然后强制安装基本文件

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

并通过以下方式恢复升级

sudo apt-get install -f
sudo apt-get dist-upgrade

相关内容