处理时遇到错误:/var/cache/apt/archives/apport_2.20.1-0ubuntu2.6_all.deb

处理时遇到错误:/var/cache/apt/archives/apport_2.20.1-0ubuntu2.6_all.deb

当我尝试

sudo apt-get upgrade 

我得到以下信息:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  apport
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
28 not fully installed or removed.
Need to get 0 B/120 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 534975 files and directories currently installed.)
Preparing to unpack .../apport_2.20.1-0ubuntu2.6_all.deb ...
/var/lib/dpkg/info/apport.prerm: 19: /var/lib/dpkg/info/apport.prerm: pyclean: 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: 19: /var/lib/dpkg/tmp.ci/prerm: pyclean: not found
dpkg: error processing archive /var/cache/apt/archives/apport_2.20.1-0ubuntu2.6_all.deb (--unpack):
 subprocess new pre-removal script returned error exit status 127
/var/lib/dpkg/info/apport.postinst: 13: /var/lib/dpkg/info/apport.postinst: pycompile: not found
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
 /var/cache/apt/archives/apport_2.20.1-0ubuntu2.6_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

apport 和有什么问题

dpkg: error while cleaning up:

subprocess installed post-installation script returned error exit status 127
    Errors were encountered while processing:
     /var/cache/apt/archives/apport_2.20.1-0ubuntu2.6_all.deb
    E: Sub-process /usr/bin/dpkg returned an error code (1)

我试过了:

sudo dpkg --purge --force-all apport

然后我得到:

dpkg: warning: overriding problem because --force enabled:
dpkg: warning: package is in a very bad inconsistent state; you should
 reinstall it before attempting a removal
(Reading database ... 534968 files and directories currently installed.)
Removing apport (2.20.1-0ubuntu2.5) ...
/var/lib/dpkg/info/apport.prerm: 19: /var/lib/dpkg/info/apport.prerm: pyclean: not found
dpkg: error processing package apport (--purge):
 subprocess installed pre-removal script returned error exit status 127
/var/lib/dpkg/info/apport.postinst: 13: /var/lib/dpkg/info/apport.postinst: pycompile: not found
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
 apport

在那之后 :

我已经检查并确认/var/lib/dpkg/info/apport.postinst和都/var/lib/dpkg/info/apport.prerm存在于系统中。

以下所有命令对我来说都不起作用:

sudo apt-get install apport --reinstall
sudo dpkg --purge --force-all apport
sudo apt-get clean 
sudo apt purge apport
sudo apt install apport
sudo apt -f install
udo dpkg -i --force-overwrite apport
dpkg -i --force-overwrite /var/cache/apt/archives/apport_2.20.1-0ubuntu2.6_all.deb
sudo apt-get -o Dpkg::Options::="--force-overwrite" install apport-dev

编辑1 我也试过了

sudo dpkg -r man-db 但我被卡在这里:

    dpkg: error processing package man-db (--remove):
     dependency problems - not removing
    Errors were encountered while processing:
 man-db

那么下面的操作就无法运行

sudo dpkg -r apport 
sudo apt-get upgrade
sudo apt-get install -f

答案1

我有同样的错误,所以我用这个修复了它

sudo dpkg --purge path/package.deb
sudo apt-get -f install
sudo apt-get update && sudo apt-get upgrade

相关内容