1

i have tired adding this ruby repo for installing 2.4 version of ruby, the error message is shown bellow

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

but i got this error i have tried all this links

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'
Gautham Arcot
  • 17
  • 1
  • 8

1 Answers1

0

Try these methods and find if it works

apt-get remove --purge python-apt

and then

apt-get install python-apt
Jananath Banuka
  • 2,951
  • 8
  • 57
  • 105