Why can't we remove packages with unmet installation dependencies?

Asked by matti salminen

- User installs a package.
- Say, the installation is only partially complete with unmet dependencies. (package needs xxx but xxx is not going to be installed, for example.)
- User attempts to back out of the installation and remove the original package.
- User can not remove the package, the message returned asks the user to "try apt-get install -f", which fails because the dependencies are not available.

If the prerequisites needed for installation are not there when a user attempts to remove an incomplete package, they should be just tagged as "done" by the uninstall process rather than making successful installation a prerequisite for removal. Right?

I would expect apt-get remove --purge take out even a partially installed package and consider and tag missing prereqs equal to "already removed".

Would like to know why it can't be done, please.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

If you run :

sudo apt-get -f install

Does it help?

Thanks

Revision history for this message
matti salminen (salmiset) said :
#2

No. As I wrote, it failed too.

Note that I am not trying to complete an installation of a package but rather I am trying to uninstall partially installed package without having to wait for and later install the dependencies just so that I can remove it.

In the current state, with an incomplete installation, any attempt to install anything else using apt-get will abend because of lack of those "already unwanted" dependencies.

It's the process I am considering deficient and most curious about. Why can I not simply uninstall what is there and ignore the already missing parts?

Revision history for this message
daniel CURTIS (anoda) said :
#3

Hi Matti. I think, that You should show us the error. Anyway you can check e.g.

sudo dpkg --configure -a
sudo apt-get install "package which needs xxx" && sudo apt-get -f install

If this error contain something like this: "The following packages have unmet dependencies.", you could try to run:

sudo dpkg --force-depends --purge "file which have unmet dependencies"
sudo apt-get -f install

By the way. I think that you should show us your '/etc/apt/sources.list file'. Or search for any errors in links which are provided in this file. Make sure that restriced and universe repositories are enabled (e.g. software-properties-gtk command). Have you tried apt-get clean and apt-get autoclean commands? There is one more command to find and repair the conflicts: sudo apt-get -o Debug::pkgProblemResolver=yes dist-upgrade.

Best regards.

Revision history for this message
Manfred Hampl (m-hampl) said :
#4

The command

sudo dpkg --audit

should show the packages with unmet dependencies, and with the command

sudo dpkg --remove package --force-all

you should be able to remove (almost) any package, but you have to be aware that this might create new dependency problems!

I think for the supperters it would be better, if you show your full error message. Knowing the real details makes finding the solution much easier than just talking on theoretical base.

Can you help with this problem?

Provide an answer of your own, or ask matti salminen for more information if necessary.

To post a message you must log in.