1

I wanted to try out the new major version of a c++ library called gtsam. Since I'm currently using an older version of the library for several projects and I wasn't sure about dependency issues, I decided to install it using checkinstall:

mkdir build && cd build
make
sudo checkinstall

Since it came with a python wrapper which I also wanted to install, I did:

cd python
sudo checkinstall python setup.py install

Now I wanted to remove the version again, so I checked under which package name the library was installed.

The main library was called "build" which I already found strange, although I could remove it using:

sudo dkpg -r build

When I now tried to do the same with:

sudo dpkg -r python

it complained about dependency problems because it's interpreting "python" as the main ubuntu python package.

If I do dpkg -l python I get:

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                          Version                     Architecture                Description
 +++-=============================================-===========================-===========================-==================================================
ri  python                                        20160629-1                  amd64                       Python part of gtsam-4.0.0-alpha1.

At this point I'm actually a little bit scared and don't know what to do, to fix this issue. I want to uninstall the files installed by checkinstall python setup.py install without screwing up the configuration of my system python setup.

I actually used checkinstall because I did not want to worry about reverting the installation...

2
  • Note : Checkinstall cannot be used to create a python-module package. Jun 29, 2016 at 19:46
  • @KnudLarsen I stumbled upon some block entry link that recommends the usage of checkinstall with python and also other people seem to be using the tool for python packages...I understood the main thing checkinstall does is recording a history of file copies done by some install procedure, so it can be reverted. Am I wrong with that assumption?
    – Malefitz
    Jun 30, 2016 at 7:05

1 Answer 1

2

Ok, so I think I solved the problem.

I found out that with apt-cache showpkg python I can view all the different python versions available. I picked the latest one and installed it using:

sudo apt-get install python=2.7.5-5ubuntu3

It gave me a warning it couldn't delete some "old directories":

dpkg: warning: unable to delete old directory '/usr/local/lib/python2.7/dist-packages': Directory not empty
dpkg: warning: unable to delete old directory '/usr/local/lib/python2.7': Directory not empty
dpkg: warning: unable to delete old directory '/usr/local/lib': Directory not empty
dpkg: warning: unable to delete old directory '/usr/local': Directory not empty

But that's fine, since I actually tried to solve the problem without deleting these directories.

Now if I do a dpkg -l python I get the following, correct output:

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                          Version                     Architecture                Description
+++-=============================================-===========================-===========================-====================================================================
ii  python                                        2.7.5-5ubuntu3              amd64                       interactive high-level object-oriented language (default version)

I will monitor if I get any more strange behaviour from my system, but for now it seems this fixed the issue.

1
  • Thanks for this, it worked for me. The key line in the output is: The following packages will be DOWNGRADED: python
    – Tom Viner
    Jul 21, 2019 at 13:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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