Pythonのバグが原因ですべてのDebianパッケージマネージャが破損する[閉じる]

Pythonのバグが原因ですべてのDebianパッケージマネージャが破損する[閉じる]

私は私の問題を修正しようとしています。簡単利用可能にしてください。パッケージリストのみを更新できます。パッケージを削除またはインストールできません。私が得るエラーは次のとおりです。

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
ImportError: No module named 'encodings'

Current thread 0x00007f1031850700 (most recent call first):
Aborted
E: Sub-process /usr/bin/apt-listchanges --apt || test $? -lt 10 returned an error code (1)
E: Failure running script /usr/bin/apt-listchanges --apt || test $? -lt 10

以下は私のPYTHONHOMEファイルです。PYTHONPATH/etc/environmentenvironment

JAVA_HOME="/usr/lib/jvm/java-8-oracle"
PYTHONHOME="/usr/lib/python3.5"
PYTHONPATH="/usr/local/lib/python3.5"

Python依存関係パッケージマネージャを使用せずにPythonとpipを再インストールする方法はありますか?いくつかのライブラリファイルが見つからないようですが、Python2.7も動作しないようです。

ベストアンサー1

エラーはaptそれ自体では発生しませんが、apt-listchanges無効にすると問題が回避されます(aptPythonベースではありません)。

sudo mv /etc/apt/apt.conf.d/20listchanges{,.bak}

これはPythonの問題を解決しないため、他のエラーが発生する可能性があります。PYTHONPATHandをPYTHONHOME設定する必要はありません/etc/environment。その行も削除することをお勧めします。

すべてが解決したら、apt-listchanges以下を実行して有効にできます。

sudo mv /etc/apt/apt.conf.d/20listchanges{.bak,}

おすすめ記事