76 votes
Accepted

ModuleNotFoundError: No module named 'apt_pkg' error

Its very late but could be helpful for others. > cd /usr/lib/python3/dist-packages > sudo cp apt_pkg.cpython-35m-x86_64-linux-gnu.so apt_pkg.so
saranjeet singh's user avatar
49 votes

How can I get a list of all repositories and PPAs from the command line into an install script?

I am surprised that the simplest but most effective way to get all enabled binary software sources together with the file they're specified in hasn't been posted yet: grep -r --include '*.list' '^deb ...
Byte Commander's user avatar
  • 108k
41 votes

gpgkeys: key F60F4B3D7FA2AF80 not found on keyserver

The solution is: wget -qO - https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub | sudo apt-key add - as documented here: https://developer.nvidia.com/cuda-...
vskubriev's user avatar
  • 905
36 votes

How can I get a list of all repositories and PPAs from the command line into an install script?

Run the following command: apt-cache policy | grep http | awk '{print $2" "$3}' | sort -u Source
KeyC0de's user avatar
  • 841
29 votes

sudo add-apt-repository hangs

I have followed this instructions, and it worked great for me (Ubuntu 20.04). In command line, type this sudo gedit /etc/gai.conf Then, edit this line by removing the # precedence ::ffff:0:0/96 100
Zato's user avatar
  • 801
22 votes

ModuleNotFoundError: No module named 'apt_pkg' error

There was a similar question on 2014 (Problem with update-manager: No module named 'apt_pkg' in Ubuntu 13.10, having installed Python 3.4 on /usr/local/lib). The solution worked for me. sudo ...
Felix Schiegg's user avatar
22 votes

Adding opencpn repository - AttributeError: 'NoneType' object has no attribute 'people'

Install python3-launchpadlib launchpadlib is an open-source Python library that lets you treat the HTTP resources published by Launchpad's web service as Python objects responding to a standard set ...
Rinzwind's user avatar
  • 300k
20 votes

ModuleNotFoundError: No module named 'apt_pkg' error

If you updated with a NEW python (e.g. dist had 3.5 but you installed 3.7), then your /usr/bin/python3 points to a python that does not have apt_pkg. edit /usr/bin/add-apt-repository where it says #! /...
user6273920's user avatar
18 votes
Accepted

apt-add-repository: Command not found

The application add-apt-repository is not in the /usr/bin folder where it needs to be thus causing apt-add-repository to fail since it is a link file. ls -al /usr/bin/apt-add-repository lrwxrwxrwx 1 ...
Terrance's user avatar
  • 41.7k
10 votes

Python can't find module named apt_pkg

In my case because I have 2 versions of python installed, python3.5 and python3.6 , the module wasn't found on the python3.6 version so what I did thanks to @Emmet suggestions was: nano /usr/bin/add-...
Sebastian's user avatar
  • 151
9 votes

How can I get a list of all repositories and PPAs from the command line into an install script?

Here is my script, "list-apt-repositories", which lists all repositories in "/etc/sources.list" and "/etc/sources.list.d/*.list". You can add --ppa-only to show only the ...
ejm's user avatar
  • 203
8 votes

ModuleNotFoundError: No module named 'apt_pkg' error

Create a symbolic link at apt_pkg.so which references to file apt_pkg.cpython-35m-x86_64-linux-gnu.so. cd /usr/lib/python3/dist-packages sudo ln -s apt_pkg.cpython-35m-x86_64-linux-gnu.so apt_pkg.so
karel's user avatar
  • 115k
8 votes

sudo add-apt-repository hangs

In my case I was having problems handling ipv6 from the responses. I was getting a blinking cursor and had to wait, sometimes, for one minute so it would work, although the requests which were handled ...
Iván Darío Ramos Vacca's user avatar
7 votes

How can I get a list of all repositories and PPAs from the command line into an install script?

Using add-apt-repository from software-properties-common, it is as simple as: add-apt-repository --list The output can easily be supplied back to add-apt-repository command to recreate the sources. ...
smac89's user avatar
  • 854
7 votes

Unable to Add ppa in my newly installed ubuntu 16.04 LTS

A bit late but someone might find it helpful: I had this problem when I set HTTP_PROXY= but forgot to set HTTPS_PROXY=.
longtimelistner's user avatar
7 votes

add-apt-repository command is suddenly very slow

I came here for the same reason that, apt-add-repository command does works but takes a lot of time to show any output -- now it takes more than 15 minutes. and I found the root cause and solution ...
xpt's user avatar
  • 1,045
6 votes

gpgkeys: key F60F4B3D7FA2AF80 not found on keyserver

Try the following commands which worked for me: curl -sL "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xF60F4B3D7FA2AF80" | sudo apt-key add - sudo apt-get update
Rajneesh Aggarwal's user avatar
6 votes
Accepted

Can't install Unetbootin in Ubuntu 18.04 Live Boot Session

Update: instructions below no longer needed Newer versions of Unetbootin no longer require the workarounds below. Just install using the official UNetbootin PPA: sudo add-apt-repository ppa:...
Eskander Bejaoui's user avatar
6 votes

Remove apt repository?

If you are using ubuntu 20, you can go to /etc/apt/sources.list.d/ There you'll find the repositories that you add. Then just remove a file that cotains the name of the repository and run apt update ...
Ibanêz's user avatar
  • 160
6 votes

do-release-upgrade disables third party software sources. Easy way to re-enable them?

You no longer need to get them disabled. 3 methods got added as of 18.10: An option to update-manager was added to keep PPAs enabled: AllowThirdParty = yes. Create a file ending in .cfg in /etc/...
Rinzwind's user avatar
  • 300k
6 votes
Accepted

How to get the gpg key for a repository?

Here's a procedure that essentially tries to replicate sudo add-apt-repository ppa:owner/name but lets you do all the steps (including downloading the GPG key) manually: Go to the page of the owner/...
mbdevpl's user avatar
  • 176
5 votes

"Signing key does not exist" after successful upload on Launchpad

PPA will create a new key(Launchpad PPA for YOUR NAME) for you and signed the related files with this new key. You may need to wait for a while, to get this new key uploaded to Ubuntu Keyserver(...
Quanlong's user avatar
  • 491
5 votes
Accepted

Can a local Ubuntu mirror host different Ubuntu releases on a single server

The same mirror can host two or more repositories. Check out http://mirrors.edge.kernel.org/ubuntu/ and poke around the directories to get a better idea of how this works. The package list downloaded ...
mchid's user avatar
  • 43.6k
5 votes

Does add-apt-repository not support globs in source list?

The * is not actually a glob, but just a *. However, that's not the problem here. A Python library that add-apt-repository uses, python-apt (maintained by the developers of apt), doesn't support ...
muru's user avatar
  • 198k
4 votes

installing ansible on ubuntu

I added the -E switch to my sudo command and it worked. Try: sudo -E apt-add-repository ppa:ansible/ansible This moves (or copies) your environment variables, including http_proxy into the sudo ...
Batandwa's user avatar
  • 153
4 votes

Can't install Unetbootin in Ubuntu 18.04 Live Boot Session

It seems Unetbootin is not yet tweaked to work in Ubuntu 18.04 LTS. I get the same errors as you. Unetbootin must not depend on program packages, that are no longer available. gksu and kdesudo are ...
sudodus's user avatar
  • 46.4k
4 votes

ModuleNotFoundError: No module named 'apt_pkg' error

This is the solution that worked for me for the latest apt_pkg_cpython package on Ubuntu 18.04: cd /usr/lib/python3/dist-packages/ sudo cp apt_pkg.cpython-36m-x86_64-linux-gnu.so apt_pkg.so sudo apt-...
loretoparisi's user avatar
4 votes

How do I fix apt-add-repository "no such option: --allow-unauthenticated"?

You may use the option --allow-unauthenticated with the commands apt or apt-get but not with the command add-apt-repository. Please take a look at https://wiki.winehq.org/Ubuntu where it is very well ...
mook765's user avatar
  • 16k
4 votes

Retrieving gpg Key timed out - What does this mean?

I had the exact same problem that you've described. I found that sometimes repositories can behave as if censored by your internet service provider (it's quite weird). I solved this problem by using a ...
StanfordRahl's user avatar
4 votes

add-apt-repository is throwing strange errors (18.03)

Get rid of the repository that is causing the problem. sudo add-apt-repository --remove ppa:wireshark-dev/stable # w in wireshark is case sensitive sudo apt update Install wireshark from the ...
karel's user avatar
  • 115k

Only top scored, non community-wiki answers of a minimum length are eligible