What is `swupd`'s equivalent for `apt/yum autoremove`?

swupd does not remove deps on removing bundles, and there is no options for bundle-remove to do that, but it seems that swupd does not have a autoremove either.

Besides, does swupd mark bundles as manually installed or deps ?

Hi @yw662!

According to the swupd documentation:

Bundles provide a particular functionality, or stack, which include all associated runtime dependencies.

Therefore, as far as I understand, running swupd bundle-remove should also remove the runtime dependencies contained in that particular bundle. However, I would expect the opinion of someone more experienced than me on this.

Weren’t they removed on your system?

swupd bundle-remove remove exactly 1 bundle.

Exp, if you run swupd bundle-add akonadi, it will also install libstdcpp, libgstd, lib-opengl, find-utils, p11-kit, python3-basic, font-basic, lib-openssl, libX11client, qt-core, qt-basic, lib-qt5webengine, and kde-framework5, if they are not installed.

After that, if you run swupd bundle-remove akonadi, it will exactly remove and only remove akonadi, even if, exp, kde-framework5 is no longer required by any other bundles.

That is when apt/yum autoremove should be useful. It will remove all packages(bundles) that is not required by any “manually installed” packages(bundles).

Information on installed bundles are under /usr/share/clear/bundles/. Available bundles, installed and not installed, are available in the manifest file at /var/tmp/swupd/Manifest.MoM. To see this,

sed '/^[^M]/d' "/var/tmp/swupd/Manifest.MoM" | cut -f4

swupd does store information on dependencies in spec files, you can check this with

cat /usr/share/clr-bundles/BUNDLE

Take desktop-autostart bundle as an example, it directly includes two packages gdm-autostart and gnome-initial-setup, but also relies on desktop bundle.

# [TITLE]: desktop-autostart
# [DESCRIPTION]: Bundle to automatically launch the GUI upon boot.
# [STATUS]: Active
# [TAGS]: Other
# [MAINTAINER]: Marcos Simental <marcos.simental.magana@intel.com>



This can also be found in /usr/share/clear/allbundles/desktop-autostart, where it says

 "DirectIncludes": [
 "DirectPackages": {
     "gdm-autostart": true,
     "gnome-initial-setup": true
1 Like

This has nothing to do with autoremove feature. You would always have to manually remove desktop after remove desktop-autostart.

1 Like

I was answering the question.

Actually you are not. By “mark”, it means, the package management system knows whether a particular package is “manually installed by the user” or “automatically installed by the package manager”. That spec file can do nothing about the mark.

Anything not in the spec files are not installed by swupd.

So that does mean,

  • swupd do not know which bundles are “explicitly installed”,
  • as a result, swupd cannot provide a bundle list in which “bundles are neither explicitly installed, nor required by any explicitly installed package”,
  • as a result, autoremove is impossible for swupd.

is it right ?

1 Like

Suppose you invoke swupd to add bundle A, which includes bundle B.

  • swupd doesn’t remember whether a bundle is added by user explicitly, or added due to dependency requirements, at least as far as I know
  • Suppose after a while you removed bundle A, then indeed bundle B is not removed automatically.

This is inconvenient but the reasoning is this, bundles are not packages but functionalities, which is a higher level abstraction of underlying packages.

For this reason, though we call bundle B as A’s dependency, it’s be more proper to think A as B’s superset in terms of the functionality.

Normally for other distros, if you removed a package then naturally it’s dependencies are not likely to be needed. But from a functionality point of view, removing one functionality doesn’s mean you want to remove it’s superset. For example, say you don’t want a refrigerator that also makes carbonated water, but it doesn’t necessarily mean you don’t want a fridge.

So there’s no equivalent thing as autoremove, because whether to remove another functionality, i.e bundle, should be determined by users.


Currently, yes, this is the state. However, we intend to soon introduce features that would make this possible (most of the code is already in place, we just need to finish the last changes that would make this doable and rewrite many of the bundles).