Making Apt-get DUMB!

This isn't strictly Linode, but just in case somebody runs into it…

I need to install a package (in this case, SDL-image1.2-dev). I try "apt-get install SDL-image1.2-dev"

It gives back a list of a zillion packages that it wants to "remove" to install this package.

There's no reason in the world to remove those! They have no effect on the SDL-image1.2-dev package.

Is there any way to tell apt-get, "look, I know what I'm doing. Just install the package, but don't remove anything!"?

8 Replies

You could try the –force-yes option. I don't know if it will work in your case (I think it should, though) according to the man page:

--force-yes

Force yes; This is a dangerous option that will cause apt to continue without prompting if it is doing something potentially harmful. It should not be used except in very special situations. Using force-yes can potentially destroy your system! Configuration Item: APT::Get::force-yes.

I don't think –force-yes would be useful in this situation, as it would answer "yes" to the question about removing the zillion packages, further meaning that his system would be unusable.

> –no-remove

If any packages are to be removed apt-get immediately aborts without prompting. Configuration Item: APT::Get::Remove

I wouldn't force apt-get to do anything unless you're sure why its objecting. You'll only end up leaving your system in some weird state.

What packages is it trying to remove? Is this debian or ubuntu? Which version? Did you upgraded it (correctly) from a previous distribution?

I'm guessing you just want libsdl-image1.2-dev for building something? If you can't/don't want to work out what's going wrong with apt-get, maybe you could just grab what you need form libsdl.org and stick it in /usr/local ?

PS: If you really do just want to force the install neither of the previously suggested methods will work. I don't think it can be done with apt-get, because its too friendly. You'll need to meddle with dpkg:

apt-get -d install libsdl-image1.2-dev

(to download it into /var/cache/apt/archives, cd there and)

dpkg –force-conflicts -i (to install all the downloaded packages)

then be prepared for things to break….

The better question to ask is why does apt want to remove those packages? If you don't know, you might have a hosed system ALREADY.

run an "apt-get -f install" (with no suffix)

That forces apt to "fix" your dep tree …

@Jay:

The better question to ask is why does apt want to remove those packages? If you don't know, you might have a hosed system ALREADY.

run an "apt-get -f install" (with no suffix)

That forces apt to "fix" your dep tree …

The main packages that made me panic were GNOME and FGLRX. My Debian Apt-Get had become obsessed with destroying GNOME and FGLRX. And I didn't know why SDLImagedev should want to destroy FGLRX or GNOME. I saw no connection. (Not to mention that it took me three months to get FGLRX to work correctly, and I can't remimber where the tutorial I followed is, so anything that hints at breaking that again makes me want to scream in terror)

Over the weekend, I went through and upgraded all the packages by hand in Synaptic (Click on package. Upgrade. Check to make sure it wasn't nuking GNOME or FGLRX). I now have all the newest GNOME packages (in debian) and it works just fine, no more package nuking. I just don't know.

But, usually, when I run into stupid stuff like this, I'll get the RPM, alien it to a deb, and dpkg it in where it needs to be. And it works. But I'd rather just make apt-get just allow it, even if it felt it necessary to constantly point it out to me every time I used apt-get.

> But, usually, when I run into stupid stuff like this, I'll get the RPM, alien it to a deb, and dpkg it in where it needs to be. And it works. But I'd rather just make apt-get just allow it, even if it felt it necessary to constantly point it out to me every time I used apt-get.

That sounds like a great way to hose apt, and that sort of thing may well be what caused this problem for you.

@Xan:

> But, usually, when I run into stupid stuff like this, I'll get the RPM, alien it to a deb, and dpkg it in where it needs to be. And it works. But I'd rather just make apt-get just allow it, even if it felt it necessary to constantly point it out to me every time I used apt-get.

That sounds like a great way to hose apt, and that sort of thing may well be what caused this problem for you.

QFT

the apt system is alot better then any person will be keeping track of dependencies.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct