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
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 ...
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-...
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
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
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 ...
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 ...
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
#! /...
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 ...
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-...
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 ...
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
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 ...
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.
...
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=.
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 ...
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
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:...
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 ...
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/...
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/...
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(...
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 ...
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 ...
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 ...
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 ...
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-...
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 ...
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 ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
add-apt-repository × 161apt × 59
ppa × 42
repository × 42
package-management × 16
command-line × 11
software-installation × 9
12.04 × 8
14.04 × 7
20.04 × 7
python × 7
proxy × 7
official-repositories × 7
18.04 × 6
22.04 × 6
16.04 × 5
software-sources × 5
gnupg × 5
installation × 4
updates × 4
dpkg × 4
bash × 3
upgrade × 3
scripts × 3
java × 3