我已经设法陷入了 lsb-release 和 python3 之间存在循环依赖关系的情况。当我尝试时,sudo apt install python3 --reinstall
我得到以下信息(只是粘贴关键行)
(Reading database ... 470097 files and directories currently installed.)
Preparing to unpack .../python3_3.6.7-1~18.04_amd64.deb ...
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'
[~] lsb_release
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'
Current thread 0x00007fa905a81740 (most recent call first):
Aborted (core dumped)
显然我的 lsb_release 坏了。但是如果我跑sudo apt-get install lsb-release
我会得到
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 lsb-release:
lsb-release depends on python3:any (>= 3.4~); however:
Package python3 is not configured yet.
所以我不能在不修复 lsb-release 的情况下修复我的 python3 安装,反之亦然。