Click to See Complete Forum and Search --> : apt-get dist-upgrade: Don't touch my favorite packages!


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".

blackbelt_jones
10-08-2005, 11:26 AM
I touch MY favorite package much too often. I'm getting sore.

If apt-get removes packages, can't I just apt-get them back again? I know your solution is better, but I was just wondering.

XiaoKJ
10-08-2005, 11:58 AM
it may not be in the same reps, so how does it know to apt it back?

blackbelt_jones
10-08-2005, 12:10 PM
Different reps? Clearly, I have been living a sheltered existence in stable debian.

Sepero
10-08-2005, 12:21 PM
If apt-get removes packages, can't I just apt-get them back again? I know your solution is better, but I was just wondering.
Here are two examples of why you might not be able to re-apt-get a package back.

1. You might be running a Debian-based distro.
A good example is Desktop Small Linux(DSL). Many of it's programs are not in any debian repository. So if you do a harddrive install of DSL and begin removing packages, there is no way to get them back with apt-get.

2. You may want to keep the release you have.
Say you're on Debian Etch(testing) and Firefox is running better than ever. You run upgrade and there's a new version out. You remember the last release was really buggy and you don't want to experience that again... Placing a hold on the package will prevent it from upgrading.

bwkaz
10-10-2005, 06:24 PM
Ah, so you just mark them as held. (I've played with dpkg --set-selections some already, to un-mark some packages as wanting to be installed. I think that either aptitude or dselect or something like that did this for me (since that's how they work), but I don't know for sure; in any case, I didn't want any of those packages installed.)

However, I don't want to mark everything on the system as held. And I don't know what the next update to <insert package that I don't even know is installed> will want to remove. So I'm still in a bind with dist-upgrade wanting to remove packages that I want to keep.

But whatever. What I have works, although it requires manual intervention sometimes.

Sepero
10-11-2005, 02:48 PM
I manually check through this output, for apt's:

These packages have been held back:
cloop-utils gcc-4.0 cpp-4.0 (for example), then look into why gcc-4.0 and cpp-4.0 haven't been installed. (Knoppix put a hold on cloop-utils, and I don't know exactly why, so I'm not going to override that.)
~$ apt-cache show cloop-utils
Package: cloop-utils
Priority: optional
Section: misc
Installed-Size: 360
Maintainer: Eduard Bloch <blade@debian.org>
Architecture: i386
Source: cloop
Version: 2.02.1-1
Depends: libc6 (>= 2.3.5-1), libgcc1 (>= 1:4.0.1), libstdc++6 (>= 4.0.1), zlib1g (>= 1:1.2.1)
Filename: pool/main/c/cloop/cloop-utils_2.02.1-1_i386.deb
Size: 133380
MD5sum: c254de729b6920c53e368100d2e71745
Description: Tools for handling with cloop compressed volumes
Utilities for creating and unpacking compressed loopback files
for cloop.
In other words, you can delete cloop-utils now. It was only needed for the Knoppix compressed loopback CD filesystem. If you upgraded the kernel, you probably don't even have support for it anymore.
:)

bwkaz
10-11-2005, 07:19 PM
And I did update the kernel, so you're right, I probably have no support for it anymore anyway. Thanks, I'll get rid of it tomorrow!

(I was thinking it had something to do with cryptoloop, but apparently not -- apparently the "c" was for "compressed", not "crypto".)

frimann
10-11-2005, 09:11 PM
I installed knoppix to hd a few times ca 1,5 years ago and did apt-get dist-upgrade and i was left with almost nothing , white screen with console in the bottom corner and almost everything gone, so i have not trusted apt-get since then, it is probably mostly my own fault, i did not read what was going to happen, but it made my wary of the power of apt get.
Like in Ubuntu when you add new sources, will i kill my sistem?!

XiaoKJ
10-12-2005, 10:04 AM
so, bwkaz and sepero, does aptitude do it for us? if it did, then we needn't know this right...

EDIT: ay... If its true, I'd switch to aptitude immediately. those irritating broken packages...

What do you guys think of SMART and those related intelligent package management system?

EDIT AGAIN: I just realised apt is just a frontend to dpkg, and synaptic and so on are frontends to apt... its the never ending chain! We'll end at the zero button automatic installation with no configuration package manager! haha...

Sepero
10-12-2005, 12:34 PM
I think aptitude can put packages on hold. (Not 100% sure)

I mainly don't use aptitude anymore cause it does "extra" things sometimes, like installing packages I don't need or want.

With apt-get, I get what I need. No more, no less.

bwkaz
10-12-2005, 06:54 PM
Yeah, the first dist-upgrade removed KDE for me. If you were trying to run KDE when you did a dist-upgrade, I can see how that would have screwed stuff up. I shut it all down (including disabling whichever *dm they had running) before doing that, mostly because I like the console better. ;)

Then I figured out how to add KDE back in using "-t unstable".

As for SMART, I have no idea. :p

Sepero
10-12-2005, 09:12 PM
What do you guys think of SMART and those related intelligent package management system?
Intelligent Package Managers? Smart is first one I've seen. After reading over the smart website, it doesn't seem so great to me. In my opinion, most of problems with apt are human error (not just users, but developers too).

I think 0install (zero install) is the coolest package manager I've seen yet. I bet even slackware users would like it.
http://0install.net/

XiaoKJ
10-13-2005, 08:58 AM
Cool! I'll try it out when I have the time.... (considering A'levels are coming and I don't control my own time.... I'll probably wait more than 2 years before having any rael break...)

::sigh::