【问题标题】:Trying to update Python 3.9 giving errors尝试更新 Python 3.9 给出错误
【发布时间】:2021-03-29 05:23:04
【问题描述】:

我做了什么:

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.9
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 2

python --version

现在我有多个错误,无法启动终结器或更新。当我启动 mate 终端时,我收到此错误:

/usr/bin/screenfetch: /usr/bin/lsb_release : /usr/bin/python3 : mauvais interpréteur: Aucun fichier ou dossier de ce type

当我使用突触实现时,我收到此错误:

E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/lib/command-not-found/ -a -e /usr/lib/cnf-update-db; then /usr/lib/cnf-update-db > /dev/null; fi'
E: Sub-process returned an error code

正如我在开始时描述的那样,所有这些错误都是从安装 Python 开始的。

【问题讨论】:

  • 不建议将python3“替代”更新为新的python版本。许多系统工具使用它,它们将缺少仅为 Python 的系统版本安装的库。不要乱用系统 Python!

标签: python python-3.x ubuntu-20.04


【解决方案1】:

我找到了那个帖子:Problem with sudo apt update in Ubuntu 18.04: Post-Invoke-Success if /usr/bin/test -w /var/lib/command-not-found/

我通过这样做找到了答案:

apt download python3-minimal
sudo apt install --reinstall ./python3-minimal_*.deb
sudo apt install -f

在那几行之后我不得不重新安装一些应用程序,一切都恢复正常了。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-01-21
    • 2020-09-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-09-21
    • 2015-07-09
    相关资源
    最近更新 更多