Re: How Do I Put a Package On Hold?
kmself@ix.netcom.com wrote:
>on Sat, Dec 30, 2000 at 08:41:45PM -0500, Mark Rahner
>(mark_rahner@sparta.com) wrote:
>> I'm trying to upgrade from a mixed potato/woody to a woody. I edited
>> my sources.list file, ran "apt-get update", then "apt-get
>> dist-upgrade". This procedure results in an attempt to remove
>> kernel-image-2.2.17. I don't want to do this because I'm running a
>> custom kernel to support Win4Lin.
kernel-image-2.2.17 sounds like a package from Debian, unless it's one
you compiled yourself with kernel-package. Are you sure that it will
actually be a problem? (It's safe to have no kernel-image package
installed.)
>> If I tell it not to remove the kernel image, the remainder of the
>> dist-upgrade is aborted. From what I can glean from the various man
>> pages, my problem would be avoided by placing the kernel-image
>> package "on hold"
Possibly. apt-get might want to remove it for one of these reasons:
(a) one of the dependencies of the upgraded version of the package is
missing;
(b) something else conflicts with the upgraded version;
(c) one of the dependencies of the current version of the package has
gone missing (and the package isn't to be upgraded);
(d) something else conflicts with the current version (and the package
isn't to be upgraded).
In cases (a) or (b), you could put kernel-image-2.2.17 on hold and stop
it being removed, as long as (c) or (d) didn't become true as a result.
In cases (c) or (d), you'd have to find out what had gone missing, or
what had appeared that was causing the conflict, respectively.
>> but I can't for the life of me figure out how to do this. The dpkg
>> man page implies that this should be possible using dselect but the
>> dselect man page mentions no such thing.
The dselect help screen, under 'k' for Keystrokes, however, does:
Mark packages for later processing:
+, Insert install or upgrade =, H hold in present state
Dependency conflicts are generally easier to resolve in dselect than in
command-line apt-get, once you get used to the former. In fact, apt-get
doesn't give you any fine-grained control over dependencies at all. If
you don't like dselect, you could try one of the apt front-ends, like
console-apt or aptitude.
>I *think* this works:
>
> $ dpkg --get-selections > selections.out
> $ cp selections.out selections.in
> $ vi selections.in # replace 'install' with 'hold' for desired pkgs.
> $ dpkg --set-selections < selections.in
>
>Just tried that w/o a subsequent update, it seems to have worked (didn't
>break anything, anyhow).
>
>...though corrections welcomed.
That should work fine, though 'dpkg --set-selections' doesn't actually
need you to give it a full list; it will only change the packages
mentioned in its input. Thus, this works just as well:
# echo 'packagename hold' | dpkg --set-selections
... where 'packagename' should be replaced by the name of the desired
package, of course.
--
Colin Watson [cjw44@flatline.org.uk]
Reply to: