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ā).
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
That worked perfectly; Xen hypervisor is just a minimal Fedora distro I guess; qvm commands didnāt work but rpm did
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.
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 .
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.
- The correct way to install and delete templates in 4.1 is by using
qvm-template
orqvm-template-gui
.
If you usequbes-dom0-update
to install templates, then it will fall
back to usingqvm-template
.
Templates installed using qvm-template will not feature in the rpm
databases and cannot be listed or deleted usingrpm
ordnf
.
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
.
- If you install a template using rpm or dnf, (perhaps you have downloaded
it), then it will not appear inqvm-template
, and you will have to
userpm
ordnf
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
.
- There are other methods to install templates, but if you use them you
would not need to ask for help.
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