Sepero
10-08-2005, 10:58 AM
[apt-get dist-upgrade] uninstalls packages on you, when upgrading others.
Or at least, it uninstalls ten tons of packages on one system I run (originally a Knoppix hdinstall, but I changed the sources.list to point only to Debian repositories) every time the C compiler tries to upgrade. It seems to have something to do with the way that gcc and cpp's versions have to match, and the fact that the versions I have are from unstable (the default repository is testing). Trying to dist-upgrade gcc will uninstall cpp instead of upgrading both of them, and tons of stuff depends on cpp (most X fonts, most of KDE, xawtv, a few Gnome libs, and some other packages I've forgotten now). So all that stuff is either removed, or the dependencies are broken.
I'm sure there's a better solution than what I came up with (don't dist-upgrade, just upgrade, watch for "these packages have been held back", and try to install each of those packages to figure out why they've been held back), but I don't know what it would be.
I don't want an upgrade to remove anything (except replaced packages).
Having good programs removed can be a serious point of problem for a Debian user. Personally, I always use dist-upgrade. I know that it will be the absolute best upgrade that Debian has to offer.
But what if apt-get says, "remove packages X, Y, and Z"???
Well I can live without Y and Z, but I REALLY want to keep X!!!
Take a deep breath. Do this:
dpkg --get-selections | sort -ik2 > packages.txt
Now open that file, packages.txt with a text editor. "nano packages.txt"
You will see all the packages installed(and removed) from your system. Find package X in this file. When you find it, change the text beside it from "install" to "hold". Do this with as many packages as you like. Save the file.
Do this: dpkg --set-selections < packages.txt
You're done. Unless you change package X back to "install", apt-get should never touch it again.
PS.
You can delete the file packages.txt after you "dpkg --set-selections < packages.txt".
Or at least, it uninstalls ten tons of packages on one system I run (originally a Knoppix hdinstall, but I changed the sources.list to point only to Debian repositories) every time the C compiler tries to upgrade. It seems to have something to do with the way that gcc and cpp's versions have to match, and the fact that the versions I have are from unstable (the default repository is testing). Trying to dist-upgrade gcc will uninstall cpp instead of upgrading both of them, and tons of stuff depends on cpp (most X fonts, most of KDE, xawtv, a few Gnome libs, and some other packages I've forgotten now). So all that stuff is either removed, or the dependencies are broken.
I'm sure there's a better solution than what I came up with (don't dist-upgrade, just upgrade, watch for "these packages have been held back", and try to install each of those packages to figure out why they've been held back), but I don't know what it would be.
I don't want an upgrade to remove anything (except replaced packages).
Having good programs removed can be a serious point of problem for a Debian user. Personally, I always use dist-upgrade. I know that it will be the absolute best upgrade that Debian has to offer.
But what if apt-get says, "remove packages X, Y, and Z"???
Well I can live without Y and Z, but I REALLY want to keep X!!!
Take a deep breath. Do this:
dpkg --get-selections | sort -ik2 > packages.txt
Now open that file, packages.txt with a text editor. "nano packages.txt"
You will see all the packages installed(and removed) from your system. Find package X in this file. When you find it, change the text beside it from "install" to "hold". Do this with as many packages as you like. Save the file.
Do this: dpkg --set-selections < packages.txt
You're done. Unless you change package X back to "install", apt-get should never touch it again.
PS.
You can delete the file packages.txt after you "dpkg --set-selections < packages.txt".