4

I manually installed python 2.7.5 using checkinstall. I downloaded and extracted the source tarball from python.org in /usr/local/src, then ran these commands

./configure
sudo make
sudo checkinstall

I wanted to upgrade from 2.7.4 to 2.7.5, I probably could have used apt-get to just install the next version, but now I want to uninstall it, I went to the ubuntu software center and tried to remove it, but it tells me that I need to remove all these other programs that depend on python even though I already have the python version that came with my installation. I'm not really sure how to uninstall it.

apt-cache policy python python2.7 outputs:

python:
  Installed: 2.7.5-1
  Candidate: 2.7.5-1
  Version table:
 *** 2.7.5-1 0
        100 /var/lib/dpkg/status
     2.7.4-0ubuntu1 0
        500 http://us.archive.ubuntu.com/ubuntu/ raring/main amd64 Packages
python2.7:
  Installed: 2.7.4-2ubuntu3
  Candidate: 2.7.4-2ubuntu3
  Version table:
 *** 2.7.4-2ubuntu3 0
        500 http://us.archive.ubuntu.com/ubuntu/ raring/main amd64 Packages
        100 /var/lib/dpkg/status

in /usr/local/src/Python2.7.5, there is a deb package called python_2.7.5-1_amd64.deb.

7
  • Did you create packages (.deb) using checkinstall - e.g. sudo checkinstall make install_package? Or did you install it directly?
    – gertvdijk
    Commented Jul 3, 2013 at 16:56
  • I downloaded and extracted the source tarball from python.org in /usr/local/src, ran ./configure then sudo make and sudo checkinstall. I'm not sure what you mean by if I created packages or installed it directly (sorry, I'm new to ubuntu, I got it yesterday).
    – Sophie
    Commented Jul 3, 2013 at 17:20
  • First of all, please edit your question to include new information - it's how this site works. Secondly, also explain why you did this in the first place as Ubuntu has Python 2.7 perfectly fine in the repositories for you. I.e. What were you trying to accomplish? Thirdly, since Python is a really fundamental piece of software for Ubuntu, you really cannot uninstall it and install a new version afterwards - you'll need to make sure there's a working Python installation at all times.
    – gertvdijk
    Commented Jul 3, 2013 at 17:24
  • I have two versions of python 2.7.x on my system, one that I manually installed in /usr/local/bin and the one that came installed in /usr/bin
    – Sophie
    Commented Jul 3, 2013 at 17:43
  • (I am just reading up on checkinstall by the way.) As far as I understand it, it will create .deb packages which you can install and remove. Are you sure this is the full sequence of events as to how you got Python in /usr/local? Do you still have the directory there and the .deb packages? Please provide a list of them and the output of apt-cache policy python python2.7
    – gertvdijk
    Commented Jul 3, 2013 at 17:49

1 Answer 1

2

In your case you were very lucky to have used checkinstall! Instead of installing it bluntly by overwriting/moving files it created a package which got installed. This makes the package management aware of the installation and how to undo it. So, this means you can tell APT that you now want to install the other version:

Run

sudo apt-get install python=2.7.4-0ubuntu1

to revert to the regular Ubuntu packaged version. Python 2.7.5 will probably only be available in Saucy, not in the current stable releases.

This is not the same as removing and reinstalling, as in this case it gets downgraded taking care a single version of Ubuntu is installed at all times.

6
  • sudo apt-get install python=2.7.4-0ubuntu1 Commented Jul 21, 2013 at 18:16
  • @VaidAbhishek What about it?
    – gertvdijk
    Commented Jul 21, 2013 at 18:35
  • I installed it manually. But how do I install modules to new version instead of default build Commented Jul 21, 2013 at 18:42
  • @VaidAbhishek If you have a NEW question, ask a new one by clicking the "Ask Question" button at the top of the page. Comments are not meant for new issues/questions not relevant the the OP.
    – gertvdijk
    Commented Jul 21, 2013 at 18:43
  • Why is 2.7.5 still unavailable in 12.04? 2.7.3 has a bad 64bit cPickle bug :(
    – Will
    Commented Aug 30, 2013 at 7:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .