sudo apt-get install 错误代码 01

sudo apt-get install 错误代码 01

在我的系统上,sudo apt-get install(更新、升级等)都停止工作了。我按照网上的一些建议操作,但似乎情况变得更糟了!

现在, sudo apt-get upgrade

返回消息:

dpkg: error processing package software-properties-common (--configure):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting configuration
Errors were encountered while processing:
 software-properties-common
E: Sub-process /usr/bin/dpkg returned an error code (1)

尽管

sudo apt-get install --reinstall software-properties-common

返回消息:

/var/lib/dpkg/info/software-properties-common.prerm: 6: /var/lib/dpkg/info/software-properties-common.prerm: py3clean: not found
dpkg: warning: old software-properties-common package pre-removal script subprocess 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/software-properties-common_0.97.11_all.deb (--unpack):
 new software-properties-common package pre-removal script subprocess returned error exit status 127

有任何想法吗?

@Raffa:

sudo apt-get install --reinstall pythin3-minimal

返回以下错误:

dpkg: error processing package python3 (--configure):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting configuration
dpkg: dependency problems prevent configuration of software-properties-common:
 software-properties-common depends on python3:any; however:
  Package python3 is not configured yet.
 software-properties-common depends on python3; however:
  Package python3 is not configured yet.

dpkg: error processing package software-properties-common (--configure):
 dependency problems - leaving unconfigured
Processing triggers for man-db (2.8.5-2) ...
dpkg: dependency problems prevent processing triggers for gnome-menus:
 gnome-menus depends on python3:any; however:
  Package python3 is not configured yet.

dpkg: error processing package gnome-menus (--configure):
 dependency problems - leaving triggers unprocessed
Errors were encountered while processing:
 python3
 software-properties-common
 gnome-menus
E: Sub-process /usr/bin/dpkg returned an error code (1)

新鲜玩意: sudo dpkg --configure -a && sudo apt update --fix-missing && sudo apt install -f && sudo apt full-upgrade

告诉我: Package python3 is not configured yet.

答案1

根据@Raffa (感谢 Raffa!) 提供的线索,我完成了以下操作后成功让事情正常运转:

首先,手动重新安装 Python:

apt-get download python3 python3.7 python3.7-minimal libpython3.7-minimal
sudo dpkg -i *python3*.deb
sudo apt install -f

然后手动重新安装software-properties-common:

apt-get download software-properties-common
sudo dpkg -i *software-properties-common*.deb
sudo apt install -f

我认为那只是将我的系统重置为开始时的状态。我从 Reddit 帖子中找到了修复方法: https://www.reddit.com/r/pop_os/comments/aduzbg/upgrading_1804_to_1810_python3_install_is/

apt-get remove --purge python2.7-minimal
sudo apt-get autoremove

此后,一切又恢复正常!

相关内容