1

Yes, I'm a moron, and I tried to manually install a higher point release of python 2.7.16 to /usr/bin/ (i did ./configure --prefix=/usr) on my Ubuntu 16.04 machine. It seems to work fine EXCEPT for packages that depended on python, like apt-listchanges, which fails with messages like ImportError: No module named apt_pkg

there's no make uninstall available, I've tried manually removing files, and still when I try apt --reinstall install python, Nothing gets overwritten and the python executable still gives the new 2.7.16 version...

Any idea how to get the official repository version back??

  • Try apt install --reinstall python2.7-minimal, that should bring back python 2.7.12 – mook765 Aug 25 at 23:22
  • Dude thank you so much, you are a lifesaver. I had already tried reinstalling python-minimal and python, but this did the trick! For anyone else that sees this, to be safe what I did was apt --reinstall install libpython-stdlib libpython2.7-minimal libpython2.7-stdlib python python-minimal python2.7 python2.7-minimal – Mohamed Hafez Aug 26 at 0:35
4

To find out which package installed a file you can use apt-file, you can install it with

sudo apt install apt-file

and find the package with

apt-file search /path/to/file

so in this case

apt-file search /usr/bin/python

which revealed python2.7-minimal, reinstalling this package solved the problem, in this case OP reinstalled some other packages as well to be sure everything works fine:

apt --reinstall install libpython-stdlib libpython2.7-minimal libpython2.7-stdlib python python-minimal python2.7 python2.7-minimal  

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.