autoremoving metapackages doesn't remove dependencies... can we create hybrid-metapackages that do?
Chris McClimans
ubuntu-devel-discuss at hippiehacker.org
Wed Jun 27 16:44:55 UTC 2012
Why does autoremoving the ubuntu-virt-mgmt metapackage fail to remove any
dependencies, while autoremoving the virt-manager package works as expected?
Is there a difference in the way that metapackages are processed vs normal
packages?
I looked at the debian/control on the source for both of them but didn't
see anything out of the ordinary.
If they are treated differently, I'd like to know how to create a
hybrid-metapackage.
When a hybrid-metapackage is autoremoved, it's dependencies should be
removed with it.
>From https://gist.github.com/3004812 :
## We have a the ubuntu-virt-mgmt metapackage:
```
# apt-cache showpkg ubuntu-virt-mgmt | grep -A1 Dependencies
Dependencies:
1.3 - virt-manager (0 (null)) python-vm-builder (0 (null)) virt-viewer (0
(null))
```
## Which depends on the virt-manager package:
```
# apt-cache showpkg virt-manager | grep -A1 Dependencies
Dependencies:
0.9.1-1ubuntu5.1 - gconf2 (2 2.28.1-2) python (2 2.7.1-0ubuntu2)
python-gtk2 (0 (null)) python-glade2 (0 (null)) python-gnome2 (0 (null))
python-dbus (0 (null)) python-urlgrabber (0 (null)) python-vte (0 (null))
librsvg2-common (0 (null)) python-libvirt (2 0.7.1) virtinst (2 0.600.1)
python-gtk-vnc (2 0.3.8) python-appindicator (0 (null)) libvirt-bin (2
0.4.6) virt-viewer (0 (null)) ssh-askpass (0 (null)) gnome-keyring (0
(null)) python-gnomekeyring (0 (null)) hal (0 (null)) python-guestfs (0
(null)) python-spice-client-gtk (0 (null)) gnome-icon-theme (0 (null))
```
## If we install ubuntu-virt-mgmt metapackage, it installs all it's
dependencies, including virt-manager
```
# apt-get install -y ubuntu-virt-mgmt
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libgtk-vnc-1.0-0 libgtk-vnc-2.0-0 libgvnc-1.0-0 python-gtk-vnc
python-vm-builder virt-manager virt-viewer
Suggested packages:
libvirt-bin hal python-guestfs python-spice-client-gtk
The following NEW packages will be installed:
libgtk-vnc-1.0-0 libgtk-vnc-2.0-0 libgvnc-1.0-0 python-gtk-vnc
python-vm-builder ubuntu-virt-mgmt virt-manager virt-viewer
0 upgraded, 8 newly installed, 0 to remove and 20 not upgraded.
Need to get 0 B/976 kB of archives.
After this operation, 8,321 kB of additional disk space will be used.
Selecting previously unselected package libgvnc-1.0-0.
(Reading database ... 271875 files and directories currently installed.)
Unpacking libgvnc-1.0-0 (from .../libgvnc-1.0-0_0.5.0-1ubuntu1_amd64.deb)
...
Selecting previously unselected package libgtk-vnc-1.0-0.
Unpacking libgtk-vnc-1.0-0 (from
.../libgtk-vnc-1.0-0_0.5.0-1ubuntu1_amd64.deb) ...
Selecting previously unselected package libgtk-vnc-2.0-0.
Unpacking libgtk-vnc-2.0-0 (from
.../libgtk-vnc-2.0-0_0.5.0-1ubuntu1_amd64.deb) ...
Selecting previously unselected package python-gtk-vnc.
Unpacking python-gtk-vnc (from .../python-gtk-vnc_0.5.0-1ubuntu1_amd64.deb)
...
Selecting previously unselected package virt-manager.
Unpacking virt-manager (from .../virt-manager_0.9.1-1ubuntu5.1_all.deb) ...
Selecting previously unselected package python-vm-builder.
Unpacking python-vm-builder (from
.../python-vm-builder_0.12.4+bzr477-0ubuntu1_all.deb) ...
Selecting previously unselected package virt-viewer.
Unpacking virt-viewer (from .../virt-viewer_0.4.2-1_amd64.deb) ...
Selecting previously unselected package ubuntu-virt-mgmt.
Unpacking ubuntu-virt-mgmt (from .../ubuntu-virt-mgmt_1.3_all.deb) ...
Processing triggers for gconf2 ...
Processing triggers for man-db ...
Processing triggers for hicolor-icon-theme ...
Processing triggers for bamfdaemon ...
Rebuilding /usr/share/applications/bamf.index...
Processing triggers for desktop-file-utils ...
Processing triggers for gnome-menus ...
Setting up libgvnc-1.0-0 (0.5.0-1ubuntu1) ...
Setting up libgtk-vnc-1.0-0 (0.5.0-1ubuntu1) ...
Setting up libgtk-vnc-2.0-0 (0.5.0-1ubuntu1) ...
Setting up python-gtk-vnc (0.5.0-1ubuntu1) ...
Setting up virt-manager (0.9.1-1ubuntu5.1) ...
Setting up python-vm-builder (0.12.4+bzr477-0ubuntu1) ...
Setting up virt-viewer (0.4.2-1) ...
Processing triggers for python-central ...
Setting up ubuntu-virt-mgmt (1.3) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
```
## And then autoremove ubuntu-virt-mgmr... it leaves behind all it's
dependencies:
```
# apt-get autoremove -y ubuntu-virt-mgmt
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
ubuntu-virt-mgmt
0 upgraded, 0 newly installed, 1 to remove and 20 not upgraded.
After this operation, 32.8 kB disk space will be freed.
(Reading database ... 272353 files and directories currently installed.)
Removing ubuntu-virt-mgmt ...
```
## However if we autoremove virt-manager it removes it's dependencies:
```
# apt-get autoremove -y virt-manager
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
libgtk-vnc-1.0-0 python-gtk-vnc virt-manager
0 upgraded, 0 newly installed, 3 to remove and 20 not upgraded.
After this operation, 3,248 kB disk space will be freed.
(Reading database ... 272350 files and directories currently installed.)
Removing virt-manager ...
Removing python-gtk-vnc ...
Removing libgtk-vnc-1.0-0 ...
Processing triggers for bamfdaemon ...
Rebuilding /usr/share/applications/bamf.index...
Processing triggers for desktop-file-utils ...
Processing triggers for gnome-menus ...
Processing triggers for hicolor-icon-theme ...
Processing triggers for man-db ...
Processing triggers for gconf2 ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
```
# What is the difference between the way metapackage and real package
dependencies are processed?
# Why does autoremoving the ubuntu-virt-mgmt metapackage fail to remove any
dependencies, while autoremoving the virt-manager package works as expected?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-devel-discuss/attachments/20120627/f7bc77d0/attachment.html>
More information about the Ubuntu-devel-discuss
mailing list