gpt4 book ai didi

linux - 无法在 Debian : ModuleNotFoundError: No module named 'apt_pkg' 上安装 Telegram

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:44:26 31 4
gpt4 key购买 nike

我是 Debian 用户。

我以 root 身份在 shell 中运行代码:

我想用下面的命令安装 Telegram :

sudo add-apt-repository ppa:atareao/telegram

sudo apt-get update

sudo apt-get install telegram

我收到以下错误:

    Traceback (most recent call last):
File "/usr/bin/add-apt-repository", line 11, in <module>
from softwareproperties.SoftwareProperties import SoftwareProperties, shortcut_handler
File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 27, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 23, in <module>
import apt
File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

Original exception was:
Traceback (most recent call last):
File "/usr/bin/add-apt-repository", line 11, in <module>
from softwareproperties.SoftwareProperties import SoftwareProperties, shortcut_handler
File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 27, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

我该如何解决?

谢谢

最佳答案

在 debian 上安装 telegram 的两种方法:

1) telegram包可以通过snap安装。

# apt install snapd

查找包:

snap find telegram

示例输出:

Name                 Version     Developer       Notes  Summary
telegram-sergiusens 1.2.6 sergiusens - Telegram desktop client
telegram-cli 1.4.5 marius-quabeck - Command-line interface for Telegram. Uses the readline interface.
telegram-desktop 1.2.17 3v1n0 - Official desktop client for the Telegram messenger
ubuntu-social-kit 3 keshavnrj - Bring social media apps to Ubuntu Desktop
squirrelbot 1.1.2 xordspar0 - A Telegram bot that stashes away links that you send it
mup-plugins 2017.04.19 niemeyer - mup IRC and Telegram bot - plugins side
mup-accounts 2016.09.24 niemeyer - mup IRC and Telegram bot - account connection side
shell2telegram 1.7 msoap - Telegram bot constructor from command-line

安装telegram:

# snap install telegram-desktop

2) telegram-desktop 包在 stretch-backports 上可用.通过添加以下行来编辑您的 /etc/apt/sources.list:

deb http://deb.debian.org/debian/ stretch-backports main

保存然后运行:

# apt update
# apt install telegram-desktop

该软件包也适用于 debian Buster 和 Sid。

删除 ppa:atareao/telegram(在 /etc/apt/sources.list.d/ 下)并查看 the answer由@aicastell 链接以修复错误。

关于linux - 无法在 Debian : ModuleNotFoundError: No module named 'apt_pkg' 上安装 Telegram,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50502932/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com