升级 Ubuntu 时未满足的依赖问题

升级 Ubuntu 时未满足的依赖问题

我正在尝试将我的 Ubuntu 版本升级20.04.2 LTS到,20.10以便最终可以将其升级到21.04(Hirsute Hippo)

一旦运行升级命令,我就会收到此未满足的依赖项错误:

$ sudo apt-get upgrade

Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libsmbclient : Depends: samba-libs (= 2:4.11.6+dfsg-0ubuntu1.8) but 2:4.11.6+dfsg-0ubuntu1.6 is installed
 samba-libs : Depends: libwbclient0 (= 2:4.11.6+dfsg-0ubuntu1.6) but 2:4.11.6+dfsg-0ubuntu1.8 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

当我尝试时:

$ sudo apt --fix-broken install

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following package was automatically installed and is no longer required:
  libllvm10
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
  samba-libs
The following packages will be upgraded:
  samba-libs
1 upgraded, 0 newly installed, 0 to remove and 25 not upgraded.
1 not fully installed or removed.
Need to get 0 B/5,282 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] 
E: Invalid archive member header
E: Prior errors apply to /var/cache/apt/archives/samba-libs_2%3a4.11.6+dfsg-0ubuntu1.8_amd64.deb
debconf: apt-extracttemplates failed: No such file or directory
(Reading database ... 215241 files and directories currently installed.)
Preparing to unpack .../samba-libs_2%3a4.11.6+dfsg-0ubuntu1.8_amd64.deb ...
Unpacking libwbclient0:amd64 (2:4.11.6+dfsg-0ubuntu1.8) over (2:4.11.6+dfsg-0ubuntu1.8) ...
Setting up libwbclient0:amd64 (2:4.11.6+dfsg-0ubuntu1.8) ...
dpkg: dependency problems prevent configuration of libsmbclient:amd64:
 libsmbclient:amd64 depends on samba-libs (= 2:4.11.6+dfsg-0ubuntu1.8); however:
  Version of samba-libs:amd64 on system is 2:4.11.6+dfsg-0ubuntu1.6.

dpkg: error processing package libsmbclient:amd64 (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Processing triggers for 
libc-bin (2.31-0ubuntu9.2) ...
Errors were encountered while processing:
 libsmbclient:amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)

我最终想要运行sudo do-release-upgrade,但在此之前我必须安装该版本的所有可用更新。下一步该怎么做?

答案1

从你的输出来看:

E: Invalid archive member header
E: Prior errors apply to /var/cache/apt/archives/samba-libs_2%3a4.11.6+dfsg-0ubuntu1.8_amd64.deb

这意味着你的samba-libs软件包已损坏。从本地缓存中删除它,然后让 apt 下载新副本。

sudo rm /var/cache/apt/archives/samba-libs_2%3a4.11.6+dfsg-0ubuntu1.8_amd64.deb
    # The file path/name is provided by the error message.

sudo apt update
sudo apt upgrade
    # Apt will automatically detect that the package is missing and download it.

相关内容