From f24299be1ebdd81a5acb6af66967104955ae885a Mon Sep 17 00:00:00 2001 From: Oni Date: Wed, 7 Jun 2023 05:59:45 -0400 Subject: [PATCH 1/4] Use 'qvm-template' to uninstall templates The 'dnf remove' command no longer removes templates and mentions "No Match" when using . The 'qvm-template' command will remove templates from both package installation and cloning. 'qvm-template' also warns about qubes dependent on the template which reduces the need for the user to preemptively check that relationship. In its implementation, 'qvm-template' imports and calls 'qvm-remove' to remove the template. 'qvm-template' was selected as the command to present as it provides a more consistent interface when installing, listing, and removing among other commands. --- user/templates/templates.md | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/user/templates/templates.md b/user/templates/templates.md index f3740dec..30e40635 100644 --- a/user/templates/templates.md +++ b/user/templates/templates.md @@ -144,28 +144,19 @@ Please see [How to Install Software](/doc/how-to-install-software). ## Uninstalling -If you want to remove a template you must make sure that it is not being used. -You should check that the template is not being used by any qubes, -and also that it is not set as the default template. - -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](#installing), then you must execute the following type of command in -dom0 in order to uninstall it: +To remove a template, the graphical `Qube Manager` (Qubes Menu > Qubes Tools > Qube Manager) may be used. Right-click the template to be uninstalled and click "Delete qube" to begin removal. +Alternatively, to remove a template via the command line in dom0: ``` -$ sudo dnf remove qubes-template-- +$ qvm-template remove ``` -`qubes-template--` is the name of the desired -template package. +\ is the first column from the output of: +``` +$ qvm-template list --installed +``` + +In either case, if another qube is based on the template, the template will remain installed and a list of the dependent qubes will be displayed. [Switch](#switching) the dependent qubes to another template before attempting the removal again. You may see warning messages like the following: From e1abb55e638ce29bf8ae17f504a83b4ba024e101 Mon Sep 17 00:00:00 2001 From: Oni Date: Mon, 19 Jun 2023 06:26:18 -0400 Subject: [PATCH 2/4] Retire template removal warning messages This section was added in response to: https://github.com/QubesOS/qubes-issues/issues/6432 Seven months later, 'qvm-template' became the installation redirection target: https://github.com/QubesOS/qubes-core-admin-linux/pull/80 Now that 'dnf remove' is not being called directly, these warnings should not be an issue. --- user/templates/templates.md | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/user/templates/templates.md b/user/templates/templates.md index 30e40635..a15bfc16 100644 --- a/user/templates/templates.md +++ b/user/templates/templates.md @@ -158,32 +158,6 @@ $ qvm-template list --installed In either case, if another qube is based on the template, the template will remain installed and a list of the dependent qubes will be displayed. [Switch](#switching) the dependent qubes to another template before attempting the removal again. -You may see warning messages like the following: - -``` -warning: file /var/lib/qubes/vm-templates/fedora-XX/whitelisted-appmenus.list: remove failed: No such file or directory -warning: file /var/lib/qubes/vm-templates/fedora-XX/vm-whitelisted-appmenus.list: remove failed: No such file or directory -warning: file /var/lib/qubes/vm-templates/fedora-XX/root.img.part.04: remove failed: No such file or directory -warning: file /var/lib/qubes/vm-templates/fedora-XX/root.img.part.03: remove failed: No such file or directory -warning: file /var/lib/qubes/vm-templates/fedora-XX/root.img.part.02: remove failed: No such file or directory -warning: file /var/lib/qubes/vm-templates/fedora-XX/root.img.part.01: remove failed: No such file or directory -warning: file /var/lib/qubes/vm-templates/fedora-XX/root.img.part.00: remove failed: No such file or directory -warning: file /var/lib/qubes/vm-templates/fedora-XX/netvm-whitelisted-appmenus.list: remove failed: No such file or directory -warning: file /var/lib/qubes/vm-templates/fedora-XX/icon.png: remove failed: No such file or directory -warning: file /var/lib/qubes/vm-templates/fedora-XX/clean-volatile.img.tar: remove failed: No such file or directory -warning: file /var/lib/qubes/vm-templates/fedora-XX/apps.templates: remove failed: No such file or directory -warning: file /var/lib/qubes/vm-templates/fedora-XX/apps.tempicons: remove failed: No such file or directory -warning: file /var/lib/qubes/vm-templates/fedora-XX/apps: remove failed: No such file or directory -warning: file /var/lib/qubes/vm-templates/fedora-XX: remove failed: No such file or directory -``` - -These are normal and expected. Nothing is wrong, and no action is required to -address these warnings. - -If the uninstallation command doesn't work, pay close attention to -any error message: it may tell you what qube is using the template, -or if the template is default. In other cases, please see [VM Troubleshooting](/doc/vm-troubleshooting/). - If the Applications Menu entry doesn't go away after you uninstall a template, execute the following type of command in dom0: From 781780f07e7bd24618bfef64e650f482fd914b16 Mon Sep 17 00:00:00 2001 From: Oni Date: Mon, 19 Jun 2023 06:59:06 -0400 Subject: [PATCH 3/4] Redirect Qubes Menu issues with template uninstallation Manually removing Qubes Menu entries is covered on the linked page. --- user/templates/templates.md | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/user/templates/templates.md b/user/templates/templates.md index a15bfc16..7bd6a9a3 100644 --- a/user/templates/templates.md +++ b/user/templates/templates.md @@ -158,19 +158,7 @@ $ qvm-template list --installed In either case, if another qube is based on the template, the template will remain installed and a list of the dependent qubes will be displayed. [Switch](#switching) the dependent qubes to another template before attempting the removal again. -If the Applications Menu entry doesn't go away after you uninstall a template, -execute the following type of command in dom0: - -``` -$ rm ~/.local/share/applications/ -``` - -Applications Menu entries for backups of removed qubes can also be found in -`/usr/local/share/applications/` of dom0. - -``` -$ rm /usr/local/share/applications/ -``` +If the template's entry in the Qubes Menu is not removed with its uninstallation, consult the [troubleshooting page](/doc/app-menu-shortcut-troubleshooting/#fixing-shortcuts). ## Reinstalling From 1e7a9f7437f6428e9fba97be3dea67de172a80b3 Mon Sep 17 00:00:00 2001 From: Oni Date: Mon, 19 Jun 2023 08:42:59 -0400 Subject: [PATCH 4/4] Address two potential issues raised when removing a template Mentioned the final confirmation step asked for by the `Qube Manager` to type the template's name. However, before this final confirmation is displayed, issues may be raised. Deleting templates may run afoul of dependent qubes and the "default_template" global property. Instructions to resolve via switching are linked. --- user/templates/templates.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user/templates/templates.md b/user/templates/templates.md index 7bd6a9a3..651c7a88 100644 --- a/user/templates/templates.md +++ b/user/templates/templates.md @@ -144,7 +144,7 @@ Please see [How to Install Software](/doc/how-to-install-software). ## Uninstalling -To remove a template, the graphical `Qube Manager` (Qubes Menu > Qubes Tools > Qube Manager) may be used. Right-click the template to be uninstalled and click "Delete qube" to begin removal. +To remove a template, the graphical `Qube Manager` (Qubes Menu > Qubes Tools > Qube Manager) may be used. Right-click the template to be uninstalled and click "Delete qube" to begin removal. If no issues are found, a dialog box will request the template's name be typed as a final confirmation. Upon completion, the template will be deleted. Alternatively, to remove a template via the command line in dom0: ``` @@ -156,7 +156,7 @@ $ qvm-template remove $ qvm-template list --installed ``` -In either case, if another qube is based on the template, the template will remain installed and a list of the dependent qubes will be displayed. [Switch](#switching) the dependent qubes to another template before attempting the removal again. +In either case, issues with template removal may be raised. If an issue is raised, the template will remain installed and a list of concerns displayed. "Global property default_template" requires [switching](#switching) the default_template property to another template. "Template for" can be resolved by [switching](#switching) the dependent qubes' template. Once the issues are addressed, attempt the removal again. If the template's entry in the Qubes Menu is not removed with its uninstallation, consult the [troubleshooting page](/doc/app-menu-shortcut-troubleshooting/#fixing-shortcuts).