3

I'm running Debian 7.3 and I built Python 2.7.6 from source and it was installed in /usr/local/lib/python2.7 I used checkinstall to create a .deb package so I can easily uninstall it later, the problem is that I named the package python, but if I try to remove it it'll remove all the other packages that depend on python, so now I removed the installed files manually but the package is still showing in Synaptic package manager and also if I run:

apt-cache show python

I can see the 2 descriptions, the one I installed and the default one, also in Synaptic I can see it under Status > Installed (local or obsolete).

So how can remove this package without removing the original python package ? it's showing 2 versions 2.7.6 (my own version) and 2.7.3 (the system's version), can I remove 1 version and keep the other ?

1
  • You replaced the distribution's package by yours. To go in the other direction, replace your package by the distribution's. Jan 23, 2014 at 0:53

1 Answer 1

4

You should just install the python version from the repositories. Lets assume the following:

apt-cache policy python
python:
  Installed: 2.7.6
  Candidate: 2.7.6
  Version table:
 *** 2.7.6 0
        100 /var/lib/dpkg/status
     2.7.3 0
        500 http://ftp.us.debian.org/debian/ stable/main i386 Packages

In this case, the package installed isn't available in any of the repositories. Then what we should do is downgrade the package using apt-get:

sudo apt-get install python/stable

or

sudo apt-get install python=2.7.3

or

sudo apt-get -t stable install python

This will downgrade the package seamlessly. Next time append to the package some version name like this python2.7.6 to prevent this.

2
  • python2.7.6 is way to close to python2.7, which is an actual package in Debian. If you name it local-python or something like that, you will make it very clear its your locally-built version, and won't have to worry about accidentally replacing a distro package.
    – derobert
    Jan 22, 2014 at 15:38
  • I would not recommend sticking a package built checkinstall into a debian system. chances it won't play nice with the rest of the system. Use standard Debian utilities to build such a package. Bear in mind you can't have a file which has the same name as that in another package, so two files both called /usr/bin/python or /usr/bin/python2,7 won't work. Jan 22, 2014 at 15:41

You must log in to answer this question.

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