我正在对我的系统进行 dist-upgrade,但有些事情没有按预期工作,而且我也在做一些其他工作的同时运行升级。
结果 python 3 搞砸了,我无法运行 apt 更新,也无法升级系统
错误信息:
dpkg: error processing package python3 (--configure):
package is in a very bad inconsistent state; you should
reinstall it before attempting configuration
Käsittelyssä tapahtui liian monta virhettä:
python3
E: Sub-process /usr/bin/dpkg returned an error code (1)
我的命令行历史:
276 sudo apt-get update && sudo apt-get dist-upgrade
277 sudo apt-get dist-upgrade
278 sudo apt autoremove
279 sudo apt-get dist-upgrade
280 man apt
281 man dist-upgrade
282 sudo do-release-upgrade
283 /usr/bin/python3
284 sudo do-release-upgrade
285 sudo rm /usr/bin/python
286 sudo ln -s /usr/bin/python2.7 /usr/bin/python
287 sudo do-release-upgrade
288 sudo ln -sf /usr/bin/python2.7 /usr/bin/python
289 sudo do-release-upgrade
290 sudo update-alternatives --remove-all python
291 sudo update-alternatives --remove-all python3
292 sudo ln -sf /usr/bin/python3.6 /usr/bin/python3
293 sudo do-release-upgrade
294 sudo apt-get install --reinstall python3
295 sudo do-release-upgrade
296 sudo dpkg --remove --force-remove-reinstreq --force-depends python3
297 sudo apt-get -f install
298 sudo do-release-upgrade
299 sudo apt-get update
300 sudo apt-get upgrade
301 sudo apt-get reinstall python3
302 man apt-get
303 sudo apt-get install python3 --reinstall
304 sudo ln -sf /usr/bin/python2.7 /usr/bin/python
305 sudo apt-get install python3 --reinstall
306 sudo do-release-upgrade
307 history
308 update-manager
309 sudo apt-get update && sudo apt-get upgrade
310 sudo apt-get install python3
311 sudo apt-get reinstall python3
312* sudo dpkg --remove --force-remove-reinstr
313 sudo dpkg --remove --force-remove-reinstreq python3 && sudo apt-get install python3
现在我不再记得我实际上在做什么,因为这发生在我假期之前,现在三周后我不再记得导致这种情况的实际发生了什么。
我应该在这里做什么?
我通过运行修复了它
sudo apt install --reinstall python3 python python3-minimal --fix-broken
结果
sudo apt install --reinstall python3 python python3-minimal --fix-broken
:现在一切都按预期工作。