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.
1 Like

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