Removing Templates

How to remove obsolete Qubes templates like fedora-32?

I think you are looking for:

qvm-template remove ...

or

qvm-template-gui

(change ā€œinstalledā€ to ā€œremoveā€ and click ā€œapplyā€). :slight_smile:

qvm-template remove fedora-32:

error: VM installed by package manager: fedora-32

qvm-template-gui:

fedora-32 showing as ā€œavailableā€ but not ā€œinstalledā€

What do you get with:

qvm-template list --installed

ā€“ does that list fedora-32?

From:

it sounds as you donā€™t have fedora-32 installed (as a template)

No its not listed, but its definitely taking up disk space, in addition to all the other obsolete templates.

There must be some other qvm command to remove them or a dnf command

sudo rpm -e qubes-template-xxx

1 Like

That worked perfectly; Xen hypervisor is just a minimal Fedora distro I guess; qvm commands didnā€™t work but rpm did

1 Like

Glad it worked. Please mark the post as a solution so it could help other users with the same issue.

Glad you asked (and got an answer).

Iā€™ve never tried to remove one of the ā€œoff the shelfā€ templatesā€“i.e., the ones they distribute (though Iā€™ve removed plenty of templates I created, ultimately by cloning one of theirs). Hopefully when the time comes to remove debian-11 and debian-11-minimal in favor of the next version of debian, I will remember this.

Also see:

https://www.qubes-os.org/doc/templates/#uninstalling

No. Rather, dom0 is based on Fedora.

You neednā€™t unless it is not installed by package manager, which error here was self-explanatory:

Why not?:
In the Qube Manager, right-click on the template and select Delete qube .

(Templates | Qubes OS)

that doesnā€™t work with templates, the option is greyed out. The template VMs are installed by Fedora

package manager from the Qubes repo so I guess that means they are rpmā€™s

that doesnā€™t work with templates, the option is greyed out.

It works fine with templates. At least it does if the template is one you yourself cloned from one of theā€¦I donā€™t know what to call themā€¦ā€˜distributedā€™ templates. The distributed template (which had to be installed from the prompt in dom0) might be another story; Iā€™m assuming youā€™re right about them.

In other words, if itā€™s an installed template like debian-11-minimal I canā€™t do it; but if I cloned deb11m-sys-root from debian-11-minimal, I can delete deb11m-sys-root from qube manager with the right click as described by Mol. (Which is a good thing because Iā€™d probably have a mol of them to delete by now, otherwise.)

It is not greyed out on my machine and did work for templates for me before. In fact I deleted all templates except fedora minimal, whonix gs & ws successfully with the Qube Manager (I confirmed this with ā€œqvm-template list --installedā€). Naturally nothing should depend on that template any more before deleting, but that gives an error message any how.

I recall trying that also but it returned a similar error message regarding it having been installed by the

rpm package manager.

I do not know which answer has been marked as the solution here, but I
fear that it will be misleading.

  1. The correct way to install and delete templates in 4.1 is by using
    qvm-template or qvm-template-gui.
    If you use qubes-dom0-update to install templates, then it will fall
    back to using qvm-template.
    Templates installed using qvm-template will not feature in the rpm
    databases and cannot be listed or deleted using rpmor dnf.

qvm-template will only list templates that were actually installed
using that tool.
If you clone a template it will not be listed using qvm-template, but it
can be removed using it. Such clones can also be removed using
qvm-remove.

  1. If you install a template using rpm or dnf, (perhaps you have downloaded
    it), then it will not appear in qvm-template, and you will have to
    use rpm or dnf to delete it.
    The correct method for dealing with downloaded templates, is to use
    qvm-template install PATH_TO_TEMPLATE

If you install a template from a 4.0 backup then it will almost
certainly need to be deleted using rpm or dnf.

  1. There are other methods to install templates, but if you use them you
    would not need to ask for help.
I never presume to speak for the Qubes team. When I comment in the Forum or in the mailing lists I speak for myself.
2 Likes

I wouldnā€™t fear, because the error was self explanatory.

Thatā€™s the problem with interacting via email - I donā€™t see any edits.

But, unless the original post was edited - it didnā€™t refer to any ā€œerrorā€
in its original form - or the ā€œsolutionā€ was edited to make it clear that
there are 2 mechanisms depending on how the template was installed, then
none of the posts are solutions to the question as asked, and marking
one as the solution will lead other users to confusion.

this was a solution with a few conditional branches