I was trying to add a ppa using the command
sudo add-apt-repository ppa:nathan-renniewaldock/flux
I got the following error.
panda123@panda123:~$ sudo add-apt-repository ppa:nathan-renniewaldock/flux
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'
When I ran ls -l /usr/lib/python3/dist-packages/apt_pkg*
, I got the following output.
panda123@panda123:~$ ls -l /usr/lib/python3/dist-packages/apt_pkg*
lrwxrwxrwx 1 root root 39 Jul 27 18:47 /usr/lib/python3/dist-packages/apt_pkg.cpython-34m-x86_64-linux-gnu.so -> apt_pkg.cpython-35m-x86_64-linux-gnu.so
-rw-r--r-- 1 root root 310268 May 21 19:50 /usr/lib/python3/dist-packages/apt_pkg.cpython-35m-i386-linux-gnu.so
lrwxrwxrwx 1 root root 39 Jul 27 18:49 /usr/lib/python3/dist-packages/apt_pkg.so -> apt_pkg.cpython-36m-x86_64-linux-gnu.so
running python -V
gives me the following output
panda123@panda123:~$ python -V
Python 2.7.12
python3 -V
– guiverc Jul 28 '20 at 01:46update-alternatives
) FYI: Python3 is installed by default in Ubuntu 16.04 LTS; it didn't need to be installed – guiverc Jul 28 '20 at 01:53history
will show your commands, andapt
logs (/var/log/apt/history.log
) will show package changes made via apt/dpkg & like commands. However you'll find many higher-level tools (those that use the default python3) may not work so you'll need to use lower level (non-python) tools, but I'd start by refreshing your memory of what you did via history & logs. – guiverc Jul 28 '20 at 02:22