How to be an idiot when removing templates

Step 1
Assume your touch-typing skills are infallible and type the following, ommitting a crucial hyphen

mess-up.01

Step 2
Don’t bother checking what you’ve typed and ignore legit warnings because you’re [ distracted | on another pc | drunk | falling asleep ]

Step 3
Come back some time later to find dom0 proudly anouncing that it has done exactly what you asked it to …

mess-up.03

Et voila! Now you too can waste hours re-installing your templates!

6 Likes

FWIW, a common practice is to immediately clone each template after installing the package, then remove the package and use the clones. A side effect of this practice is that such accidental uninstallation would no longer be possible, since the templates you use would be “disconnected” from the original installation packages.

5 Likes

Just so no one is mistaken, @MeetTheSimians is saying do not do this!

2 Likes

If this is recommended, why is this not made automatically by default? It takes additional work which not everybody is willing to do due to laziness/busyness.

1 Like

It gave me chuckle to think of someone actually following my helpful advice through to completion.

Omg… This is something I would do :frowning: But right now I still use use the gui qubes manager so this hasn’t happened yet.

So are you saying I’d take for instance my main debian-10 template, open terminal install the package I need using apt, then clone as debian-10-special app, then go back to my original debian-10 then do a uninstall package?

I’ve always done this right off the bat. I refuse to believe that people actually use the originals for anything other than reference templates, but in my heart I know this to be untrue.

No.

The way you get templates onto your machine is by installing them (or having them installed as part of your initial setup). As a result you cannot simply delete them by qvm-remove but have to uninstall them. This also leads often to issues when one somehow messed up ones template and has done all the modifications to the template that was installed by package/installer.

Hence it is recommended to clone the installed template and apply all modifications to it instead of the original. That way you always have a “clean” copy to start from / recover from in case you made a mistake.

Personally I go so far as to uninstall the original.

sudo qubes-dom0-update qubes-template-debian-10-minimal
qvm-clone debian-10-minimal deb-10-min
sudo dnf remove qubes-template-debian-10-minimal

Then I clone from deb-10-min to several templates for specific tasks.

1 Like

Oh okay I already do this, except for maybe vault where I use keepass and that’s already installed. And I don’t remove the original installed during the qubes os install. Why do you remove the original?

I like to keep the fresh template after the clone, and use it for the sys-x or maybe an email qube,
the power to clone as a backup, makes qubes one freer to not risk their whole system, usually, over time a lot of stuff accumulates in templates, that probably isn’t needed in my case, the config’s being in the AppQube, which are less bloated…

I don’t ever use it, so all it does is take up space.

What I do have is bash scripts that install, clone, uninstall, and further customize all of my templates (all based on Debian minimal) in addition to a nightly backup of everything.

So I can always do a fresh install and restore everything (since I cloned all my templates none will conflict with what’s there by default after install). When a newer version is released I either do an in-place upgrade or recreate from scratch using the bash scripts.

When I started using Qubes OS a lot of time and energy went into learning and customizing but now I have “my system” and an automated way to bootstrap it. It’s pretty sweet.

1 Like

Sounds nice. And now that I think about it, I’ve run into a few conflicts when restoring and certain appvms are forced to use the stock templates. I’ll think about your way in the future. Thanks.

Well, I just said that it’s a common practice, not that it’s recommended. I don’t know whether it’s recommended by the devs or, if it is, why it’s not the default. Perhaps there’s something about cloning templates and removing the RPM-installed original that’s unsuitable as a default, or perhaps having templates be system-managed is intended by the devs to be the default. There are a lot of potential complexities there.

Are those bash scripts on a repo anywhere (redacted of any personal info)? I think it would be a great asset to the community to have a starting point for automating debian minimal config / backup. As an aside, I really appreciate all the work that you put into this forum!