Re: autoremoving metapackages doesn't remove dependencies... can we create hybrid-metapackages that do?

2012-06-27 Thread Chris McClimans
The  APT::Never-MarkAuto-Sections  default
in /etc/apt/apt.conf.d/01autoremove
means that packages in the */metapackage sections do not set aptitude
markauto**.

**
http://algebraicthunk.net/~dburrows/projects/aptitude/doc/en/ch02s02s07.html

This seems to be the primary difference in the packages being treated
differently for autoremove.

I would expect that if I put custom metapackages in a local repo and made
sure the were NOT in the metapackages section, then markauto would be set
and autoremove would work.
My profile-meta-package-hybrids sound like they just need to avoid the
*/metapackage sections...

On Wed, Jun 27, 2012 at 12:28 PM, Jordon Bedwell wrote:

> Think of a meta-package as a grocery list.  Think of a normal package
> as the ingredients.  With the grocery list you can add and remove
> anything you want and some things aren't explicitly required and might
> even get removed later... but with the ingredients, everything is
> required and if you remove one ingredient you might as well remove the
> rest because it's just not going to taste right.  That doesn't mean
> there aren't optional ingredients though, those are just recommends ;)
>

I'm actually trying to create custom profile-meta-packages that when
removed, remove dependent packages if they are no longer used.
I didn't think profile-meta-packages would be any different than normal
meta-packages until I saw your response.
These 'profile-meta-packages' may need to avoid actual meta-packages (from
*/metapackage sections) as dependencies if markauto isn't set during
installation.

> 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.
>
> You can force apt (well I don't know if this is still the case though)
> by adjusting /etc/apt/apt.conf.d/*autoremove and removing
> meta-packages from the list of never auto-mark but that is pretty
> dangerous,


Commenting out the metapackages sections from Never-MarkAuto-Sections did
make it work as expected... but is dangerous as mentioned.

 grep -A4 Never-MarkAuto /etc/apt/apt.conf.d/01autoremove
  Never-MarkAuto-Sections
  {
// "metapackages";
// "restricted/metapackages";
// "universe/metapackages";

Since commenting these out works, I thought I might be able to override
APT::Never-MarkAuto-Sections on the command line.

However, it doesn't seem to zero out APT::Never-MarkAuto-Sections.

The apt.conf man page said something about using #clear on lists, but I'm
unsure how to call that on the command line.
Anyone know the correct way to zero out an APT list option on the command
line?

apt-get -o APT::Never-MarkAuto-Sections=" " install -y ubuntu-virt-mgmt
apt-get -o APT::Never-MarkAuto-Sections=" " autoremove -y ubuntu-virt-mgmt
-- 
Ubuntu-devel-discuss mailing list
Ubuntu-devel-discuss@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss


autoremoving metapackages doesn't remove dependencies... can we create hybrid-metapackages that do?

2012-06-27 Thread Chris McClimans
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-v