【问题标题】:while adding this repo in ubuntu sudo apt-add-repository ppa:brightbox/ruby-ng error在 ubuntu 中添加这个 repo 时 sudo apt-add-repository ppa:brightbox/ruby-ng 错误
【发布时间】:2020-07-01 13:52:16
【问题描述】:

我已经厌倦了添加这个 ruby​​ repo 来安装 2.4 版本的 ruby​​,错误消息如下所示

sudo apt-add-repository ppa:brightbox/ruby-ng

但是我得到了这个错误我已经尝试了所有这些链接

python add-apt-repository: ImportError: No module named 'apt_pkg'

How to fix 'ModuleNotFoundError: No module named 'apt_pkg'?

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

【问题讨论】:

    标签: python ruby docker ubuntu


    【解决方案1】:

    试试这些方法,看看是否有效

    apt-get remove --purge python-apt
    

    然后

    apt-get install python-apt
    

    【讨论】:

    • 你是在Dockerfile中执行这个命令吗?
    猜你喜欢
    • 2014-12-10
    • 1970-01-01
    • 2020-07-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-09-04
    • 1970-01-01
    • 2016-07-11
    相关资源
    最近更新 更多