[Aptitude-devel] Bug#137771: aptitude's vs dpkg's hold state

Axel Beckert abe at debian.org
Fri Oct 5 10:06:18 UTC 2012


Hi Daniel,

thanks for your reply. It definitely brings light into the issue!

Daniel Hartwig wrote:
> Basically there are two kinds of package holds:
> - dselect, stored in /var/lib/dpkg/status; and
> - aptitude, stored in /var/lib/aptitude/pkgstates.

Hmm. While you definitely can set and query holds without dselect
being installed, I wonder if dpkg works any different with them. At
least when I stumbled upon it, dpkg seems to let aptitude
happily override dpkg's hold, despite dpkg's man-page says:

       hold   A package marked to be on hold is not handled by dpkg,
       	      unless forced to do that with option --force-hold.

> When aptitude starts it attempts to divine which dselect holds have
> changed and updates its database accordingly (not perfect). At no
> point does aptitude update the dselect holds when it's own have
> changed.

Real life confirms that:

Thanks to tons of iceweasel versions on mozilla.debian.net, I played
around a little bit (on Squeeze) with downgrading, upgrading and
holding packages and then doing it again. ;-)

# dpkg --get-selections | fgrep iceweasel; dpkg-query -l iceweasel | egrep '^[ih]'; aptitude search '^iceweasel$'
iceweasel                                       install
ii  iceweasel      16.0~b6-1~bpo6 Web browser based on Firefox
i A iceweasel                   - Web browser based on Firefox
# echo iceweasel hold | dpkg --set-selections
# dpkg --get-selections | fgrep iceweasel; dpkg-query -l iceweasel | egrep '^[ih]'; aptitude search '^iceweasel$'
iceweasel                                       hold
hi  iceweasel      16.0~b6-1~bpo6 Web browser based on Firefox
ihA iceweasel                   - Web browser based on Firefox
# echo iceweasel install | dpkg --set-selections
# dpkg --get-selections | fgrep iceweasel; dpkg-query -l iceweasel | egrep '^[ih]'; aptitude search '^iceweasel$'
iceweasel                                       install
ii  iceweasel      16.0~b6-1~bpo6 Web browser based on Firefox
i A iceweasel                   - Web browser based on Firefox                                                    

dpkg's holds are handled like hold flags set by aptitude -- but only
until I change something in aptitude. From there on it ignores dpkg's
hold flag:

# dpkg --get-selections | fgrep iceweasel; dpkg-query -l iceweasel | egrep '^[ih]'; aptitude search '^iceweasel$'
iceweasel                                       install
ii  iceweasel      15.0.1-1~bpo60 Web browser based on Firefox
i A iceweasel                   - Web browser based on Firefox
# echo iceweasel hold | dpkg --set-selections
# dpkg --get-selections | fgrep iceweasel; dpkg-query -l iceweasel | egrep '^[ih]'; aptitude search '^iceweasel$'
iceweasel                                       hold
hi  iceweasel      15.0.1-1~bpo60 Web browser based on Firefox
ihA iceweasel                   - Web browser based on Firefox
# aptitude full-upgrade
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.
# aptitude unhold iceweasel
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.
# dpkg --get-selections | fgrep iceweasel; dpkg-query -l iceweasel | egrep '^[ih]'; aptitude search '^iceweasel$'
iceweasel                                       hold
hi  iceweasel      15.0.1-1~bpo60 Web browser based on Firefox
i A iceweasel                   - Web browser based on Firefox
# aptitude safe-upgrade
The following packages will be upgraded: 
  iceweasel 
1 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 2,067 kB of archives. After unpacking 379 kB will be used.
Do you want to continue? [Y/n/?] 
Get:1 http://mozilla.debian.net/ squeeze-backports/iceweasel-beta iceweasel amd64 16.0~b6-1~bpo60+1 [2,067 kB]
Fetched 2,067 kB in 0s (4,688 kB/s)
(Reading database ... 486708 files and directories currently installed.)
Preparing to replace iceweasel 15.0.1-1~bpo60+1 (using .../iceweasel_16.0~b6-1~bpo60+1_amd64.deb) ...
Leaving 'diversion of /usr/bin/firefox to /usr/bin/firefox.real by iceweasel'
Unpacking replacement iceweasel ...
Processing triggers for gnome-menus ...
Processing triggers for desktop-file-utils ...
Processing triggers for man-db ...
Processing triggers for hicolor-icon-theme ...
Processing triggers for menu ...
Setting up iceweasel (16.0~b6-1~bpo60+1) ...
Installing new version of config file /etc/iceweasel/searchplugins/locale/en-US/twitter.xml ...
Processing triggers for menu ...
                                         
Current status: 0 updates [-1].
# dpkg --get-selections | fgrep iceweasel; dpkg-query -l iceweasel | egrep '^[ih]'; aptitude search '^iceweasel$'
iceweasel                                       hold
hi  iceweasel      16.0~b6-1~bpo6 Web browser based on Firefox
i A iceweasel                   - Web browser based on Firefox
#

Either dpkg doesn't complain about having its holds overridden,
aptitude suppresses dpkg's complaints or aptitude passes options to
dpkg to not complain, i.e. --force-hold.

> > So I would be happy if you could post some more details to #137771
> > about where you could need or would like to have help. Do you think
> > it's rather a technical or a conceptual issue?
> 
> At this point I think that the reasons which gave rise to aptitude
> holds have mostly disappeared.  Though I have not determined yet
> precisely what they were or whether any remain, I think the best move
> going forward is to simple drop the concept of an aptitude hold and
> completely integrate the dselect-/APT-style used by all other
> frontends.

As long as you can still set holds via aptitude using "=" (as
keybinding as well as package suffix on the commandline), that sounds
fine and the right way for me -- mostly because I don't see any
conceptual differences from the user point of view, except that it
will cause fewer bug-reports in the long run. ;-)

> An extensive knowledge of aptitude is *not* required :-)

:-)

> > P.S.: http://bugs.debian.org/328616 looks to me like a different issue
> > than http://bugs.debian.org/137771 -- maybe related, but not
> > specifically related to syncing hold states.
> 
> Ah, you are correct.  #328616 is more related to the “aptitude
> installs (removes) package removed (installed) by apt-get, etc.”  The
> hold-bugs are currently entangled as blocking an archived bug.  I have
> been preparing some more BTS maintenance on them to fix that and merge
> some others so I'll unmerge this one at the same time.

Great, thanks!

And thanks again for the insight.

		Regards, Axel
-- 
 ,''`.  |  Axel Beckert <abe at debian.org>, http://people.debian.org/~abe/
: :' :  |  Debian Developer, ftp.ch.debian.org Admin
`. `'   |  1024D: F067 EA27 26B9 C3FC 1486  202E C09E 1D89 9593 0EDE
  `-    |  4096R: 2517 B724 C5F6 CA99 5329  6E61 2FF9 CD59 6126 16B5



More information about the Aptitude-devel mailing list