AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1406192
Accepted
Jags
Jags
Asked: 2022-05-03 10:21:13 +0800 CST2022-05-03 10:21:13 +0800 CST 2022-05-03 10:21:13 +0800 CST

lsb_release 错误:bash:/usr/bin/lsb_release:/usr/bin/python3:错误的解释器:没有这样的文件或目录

  • 772

从 Ubuntu MATE 21.10 Impish 升级到 Ubuntu MATE 22.04 Jammy 后,当我运行时出现lsb_release此错误:

$ lsb_release

bash: /usr/bin/lsb_release: /usr/bin/python3: bad interpreter: No such file or directory

相关命令:

$ whereis lsb_release
lsb_release: /usr/bin/lsb_release /usr/share/man/man1/lsb_release.1.gz

$ python -V
bash: python: command not found
$ python3 -V
bash: python3: command not found

$ python3.10 -V
Python 3.10.4

$ which python3 or $ which python
Nothing.

$ which python3.10
/usr/bin/python3.10

$ whereis python
python: /usr/bin/python /usr/share/python /usr/share/man/man1/python.1.gz

$ whereis python3
python3: /usr/lib/python3 /etc/python3 /usr/share/python3 /usr/share/man/man1/python3.1.gz

$ whereis python3.10
python3.10: /usr/bin/python3.10 /usr/lib/python3.10 /etc/python3.10 /usr/local/lib/python3.10 /usr/include/python3.10 /usr/share/man/man1/python3.10.1.gz
ls -lsh /usr/bin/python*
   0 lrwxrwxrwx 1 root root    7 Oct 11  2021 /usr/bin/python -> python3
   0 lrwxrwxrwx 1 root root    9 Jul 28  2021 /usr/bin/python2 -> python2.7
3.5M -rwxr-xr-x 1 root root 3.5M Mar 12 11:54 /usr/bin/python2.7
5.7M -rwxr-xr-x 1 root root 5.7M Apr  2 14:34 /usr/bin/python3.10
   0 lrwxrwxrwx 1 root root   34 Apr  2 14:34 /usr/bin/python3.10-config -> x86_64-linux-gnu-python3.10-config
   0 lrwxrwxrwx 1 root root   17 Mar 25 18:11 /usr/bin/python3-config -> python3.10-config
4.0K -rwxr-xr-x 1 root root 1.8K Aug  6  2019 /usr/bin/python3-unidiff
$ sudo ln -s /usr/bin/python3 /usr/bin/python3.10
ln: failed to create symbolic link '/usr/bin/python3.10': File exists
$ sudo update-alternatives --config python3
update-alternatives: error: no alternatives for python3

$ sudo update-alternatives --config python
update-alternatives: error: no alternatives for python

我发现lsb_release错误的方式是因为mate-menu(Advanced MATE Menu)停止工作(从任务栏中消失),当我尝试重新安装它(使用 Synaptic)时,我收到了这个错误:

E: mate-menu: package is in a very bad inconsistent state; you should  reinstall it before attempting configuration

Can't exec "lsb_release": No such file or directory at /usr/share/perl5/Debconf/FrontEnd/Gnome.pm line 184, <> line 1.
Use of uninitialized value in lc at /usr/share/perl5/Debconf/FrontEnd/Gnome.pm line 184, <> line 1.
(Reading database ... 378043 files and directories currently installed.)

Preparing to unpack .../lsb-release_11.1.0ubuntu4_all.deb ...
Unpacking lsb-release (11.1.0ubuntu4) over (11.1.0ubuntu4) ...
dpkg: error processing package mate-menu (--configure):

 package is in a very bad inconsistent state; you should
 reinstall it before attempting configuration

Setting up lsb-release (11.1.0ubuntu4) ...
Processing triggers for man-db (2.10.2-1) ...
Errors were encountered while processing:
 mate-menu

虽然我找到了这些类似的线程,但它们对我不起作用。谢谢你。

https://askubuntu.com/a/919416/928088

https://stackoverflow.com/q/62329393/11855487

apt
  • 1 1 个回答
  • 2712 Views

1 个回答

  • Voted
  1. Best Answer
    Jags
    2022-05-03T12:52:31+08:002022-05-03T12:52:31+08:00

    正如@steeldriver 评论中所建议的,我在ln -s命令中切换了参数。扭转它解决了这个问题:

    sudo ln -s /usr/bin/python3.10 /usr/bin/python3
    
    • 2

相关问题

  • 如何编写 shell 脚本来安装应用程序列表?

  • 如何查看存档中可用的软件包的所有版本?

  • 是否可以说出我安装的哪些软件包不在原版安装中?

  • 如何删除 PPA?

  • 使用 apt-get upgrade 时如何强制安装内核更新?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve