在Ubuntu 16.04中安装python3-apport_2.20.1时出错

在Ubuntu 16.04中安装python3-apport_2.20.1时出错

我正在使用 Ubuntu 16.04 并使用sudo apt-get upgrade。之后,我使用sudo apt-get -f install并收到以下错误。你能告诉我该如何修复它吗?谢谢

Do you want to continue? [Y/n] y
dpkg: warning: files list file for package 'apport-symptoms' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'apport' missing; assuming package has no files currently installed
(Reading database ... 290080 files and directories currently installed.)
Preparing to unpack .../python3-apport_2.20.1-0ubuntu2.14_all.deb ...
/var/lib/dpkg/info/python3-apport.prerm: 6: /var/lib/dpkg/info/python3-apport.prerm: py3clean: not found
dpkg: warning: subprocess old pre-removal script returned error exit status 127
dpkg: trying script from the new package instead ...
/var/lib/dpkg/tmp.ci/prerm: 6: /var/lib/dpkg/tmp.ci/prerm: py3clean: not found
dpkg: error processing archive /var/cache/apt/archives/python3-apport_2.20.1-0ubuntu2.14_all.deb (--unpack):
 subprocess new pre-removal script returned error exit status 127
Errors were encountered while processing:
 /var/cache/apt/archives/python3-apport_2.20.1-0ubuntu2.14_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

更新:运行 Starnet 的第一个命令时出现此错误

Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 apport : Depends: python3-apport (>= 2.20.1-0ubuntu2.14) but 2.20.1-0ubuntu2.13 is to be installed
 apport-gtk : Depends: python3-apport (>= 2.20.1-0ubuntu2.14) but 2.20.1-0ubuntu2.13 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

然后我跑sudo apt-get -f install

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  python3-apport
Suggested packages:
  python3-launchpadlib
The following packages will be upgraded:
  python3-apport
1 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
4 not fully installed or removed.
Need to get 0 B/79.5 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] 

当我选择“是”时,它仍然显示如上的错误

答案1

重新安装python3-minimal(提供py3clean)可能会使该过程完成。dist-upgrade如果在执行前四个命令后问题仍然存在,则可能需要执行 。请参阅为什么使用 apt-get upgrade 而不是 apt-get dist-upgrade?

sudo apt-get install --reinstall python3-minimal
sudo apt-get update
sudo apt-get upgrade
sudo apt-get -f install

考虑到其他持续性错误,可能需要更积极的修复。使用apt-get 的镜像:方法, 或者使用 netselect 的命令行 foo切换到另一个镜像。 局域网镜子是一个可能的候选者,但看到Ubuntu 官方存档镜像以获得更多选项。如果后续步骤出现问题,此mv命令将把您当前的 apt 列表和当前源移动到可以恢复的位置。命令将清除所有下载的软件包档案。将根据您的源文件重新填充您的 apt 列表。除了执行升级功能外,还可以智能地处理新版本软件包的依赖关系变化。/tmpapt-get cleanapt-get updateapt-get dist-upgrade

mkdir -p /tmp/apt/lists
mkdir -p /tmp/etc/apt/source.list.d
sudo mv /var/lib/apt/lists/* /tmp/apt/lists/
cp /etc/apt/source.list.d/* /tmp/etc/apt/source.list.d/
cp /etc/apt/source.list /tmp/etc/apt/
# change mirrors with one of the method mentioned above then continue.
sudo apt-get clean
sudo apt-get update
sudo apt-get dist-upgrade

相关内容