What is the right way to uninstall templates?

Greetings to the users and developers of the great OS.

The real situation: being a user of 4.2, instead of installing fedora-39-xfce I proceeded with fedora-39.
Then I did eventually install the right one (xfce).
However now I am somewhat puzzled with how I should uninstall the unnecessary fedora-39.

How I installed it:
sudo qubes-dom0-update qubes-template-fedora-39
(redirected to qvm-template-install).

I had updated the template before I realized it should have been the “-xfce” one.

Following the official documentation, the right way to uninstall it would be:
sudo dnf remove qubes-template-fedora-39

But dnf finds no match for this argument…

Uninstalling it using the GUI Qube Manager may be wrong.

Any suggestions?

You should be able to delete it directly from the Qubes Manager or with qvm-template (qvm-template remove fedora-39) from a dom0 terminal.

1 Like

Thanks for your reply!
Will it be treated equally being done in the Qube Manager and using the CLI command?
The documentation mentions the following:

The procedure for uninstalling a template depends on how it was created.

If the template was originaly created by cloning another template, then you can delete it the same way as you would any other qube. In the Qube Manager, right-click on the template and select Delete qube. (If you’re not sure, you can safely try this method first to see if it works.)

If, on the other hand, the template came pre-installed or was installed by installing a template package in dom0, per the instructions above, then you must execute the following type of command in dom0 in order to uninstall it:

Followed by dnf remove.

I will also need to delete the fedora-38-xfce template soon.

I think that’s outdated. Templates no longer depend on the package manager (which is why you saw the qvm-template redirect), so you can safely delete it with the Qubes manager or qvm-template (they will do the same thing).

OK. I’ll try that.
Thank you!

1 Like

To be exact, I did try that before, in 4.1. I upgraded the main template and then switched all the service qubes to the new one uninstalling the old one using the Qube Manager. I don’t know if this was related, but I ended up having problems with connectivity for qubes updates when sys-firewall was based on the new template. So I had to restore the old one and keep having it.
Now I suspect this could be caused by wrong uninstalling method.

This would be related to the Fedora version, not the fact that you deleted an older template. If sys-firewall works with the new template, you won’t have any problems after the old one is gone.

Another option available on 4.2 is the Qubes Template Manager GUI.
I think this can be a more straightforward way.

P.S. This is the way I eventually used in my case.