Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I would like to install the most recent version of boto, which I do via python setup.py install

Yet when I try to remove the old version the following packages also get removed:

apt-get remove python-boto
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  cloud-init cloud-utils euca2ools python-boto

How can I tell the package manager to remove boto, and them mark it as installed externally (or something like that) so that apt won't try to fix the missing dependency?

Thank you,
Maxim.

share|improve this question

5 Answers 5

up vote 8 down vote accepted

You can create a dummy .deb package using the equivs utility, it will provide the dependency without installing any files. Then just replace the currently installed package to the dummy version using dpkg -i fake.deb.

share|improve this answer

I know this is an old post, but since I recently had a similar problem I would like to share my solution in the hopes that someone in the future finds it useful.

If you installed a package via aptitude it automatically assigns flags to the dependencies (auto) and when you try to remove your package again it tries to remove all its dependencies that have the auto flag still set.

As you can see in my case it's zabbix that i want to remove:

uman@mango:~$ sudo aptitude purge zabbix-server-mysql zabbix-frontend-php
The following packages will be REMOVED:  
  apache2{u} dbconfig-common{u} fping{u} javascript-common{u} libhtml-template-perl{u} libiksemel3{u} libjs-prototype{u} 
  libjs-scriptaculous{u} libopenipmi0{u} libt1-5{u} mysql-server{u} mysql-server-5.1{u} mysql-server-core-5.1{u} php5{u} php5-gd{u} 
  php5-mysql{u} snmpd{u} wwwconfig-common{u} zabbix-frontend-php{p} zabbix-server-mysql{p} 
0 packages upgraded, 0 newly installed, 20 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 44.9 MB will be freed.
Do you want to continue? [Y/n/?]

And if we look up the apache package it looks like this

uman@mango:~$ aptitude search ^apache2
i A apache2        - Apache HTTP Server metapackage
<snip>

the first flag "i" tells us that apache is installed
The next flag "A" stands for automatically installed

So in order to fix this and not having to apache, mysql and php uninstalled, we can just remove the auto flag with aptitude like this:

uman@mango:~$ sudo aptitude unmarkauto apache2 mysql-server php5
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.

Now it looks like this when removing the zabbix package:

uman@mango:~$ sudo aptitude purge zabbix-server-mysql zabbix-frontend-php
The following packages will be REMOVED:  
  dbconfig-common{u} fping{u} javascript-common{u} libiksemel3{u} libjs-prototype{u} libjs-scriptaculous{u} libopenipmi0{u} libt1-5{u} 
  php5-gd{u} wwwconfig-common{u} zabbix-frontend-php{p} zabbix-server-mysql{p} 
0 packages upgraded, 0 newly installed, 12 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 16.6 MB will be freed.
Do you want to continue? [Y/n/?] 

Please check out the man page for aptitude for more details

share|improve this answer

Use dpkg directly, not apt-get or aptitude:

sudo dpkg -r --force-depends "package"
share|improve this answer
    
Right but when I will try to use apt to install something it will detected that the package I've removed with dpkg is missing and will reinstall it. The question how do I make apt not want to reinstall it / ignore it's consistency state? –  Maxim Veksler Apr 1 '11 at 10:44

AFAIK there is no way to remove a package using APT without also removing those packages that depend on it.

Reference: http://www.debian.org/doc/manuals/apt-howto/ch-apt-get.en.html

share|improve this answer
    
no, this is the one of many purposes for meta-packages –  hbdgaf Dec 30 '10 at 1:07

Have you tried sudo dpkg --remove python-boto?

share|improve this answer
1  
This is really a comment, not an answer to the question. Please use "add comment" to leave feedback for the author. –  Mitch Aug 21 '12 at 6:05
1  
@Mitch In his defense, I'm pretty sure Stackexchange had no comment system in 2010. –  ACK_stoverflow May 8 '13 at 1:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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