From 48d10b0280b659c938d384512c6986864cf72df6 Mon Sep 17 00:00:00 2001 From: xn0px90 Date: Mon, 3 Oct 2016 13:51:18 -0400 Subject: [PATCH 1/4] Create managing-o --- managing-o | 215 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 215 insertions(+) create mode 100644 managing-o diff --git a/managing-o b/managing-o new file mode 100644 index 00000000..c908ea43 --- /dev/null +++ b/managing-o @@ -0,0 +1,215 @@ +--- +layout: doc +title: Upgrading the Fedora 21 Template +permalink: /doc/fedora-template-upgrade-21/ +redirect_from: +- /en/doc/fedora-template-upgrade-21/ +- /doc/FedoraTemplateUpgrade21/ +- /wiki/FedoraTemplateUpgrade21/ +--- + +Upgrading the Fedora 21 Template +================================ + +Summary: Upgrading the Standard Fedora 21 Template to Fedora 23 +--------------------------------------------------------------- + + [user@dom0 ~]$ qvm-clone fedora-21 fedora-23 + [user@dom0 ~]$ truncate -s 5GB /var/tmp/template-upgrade-cache.img + [user@dom0 ~]$ qvm-run -a fedora-23 gnome-terminal + [user@dom0 ~]$ qvm-block -A fedora-23 dom0:/var/tmp/template-upgrade-cache.img + [user@fedora-23 ~]$ sudo mkfs.ext4 /dev/xvdi + [user@fedora-23 ~]$ sudo mount /dev/xvdi /mnt/removable + [user@fedora-23 ~]$ sudo mkdir /mnt/removable/modules + [user@fedora-23 ~]$ sudo cp -rp /usr/lib/modules /mnt/removable/modules + [user@fedora-23 ~]$ sudo mount --bind /mnt/removable/modules /usr/lib/modules + [user@fedora-23 ~]$ sudo yum clean all + [user@fedora-23 ~]$ sudo yum --releasever=23 --enablerepo=qubes*current-testing --setopt=cachedir=/mnt/removable distro-sync + + (Shut down TemplateVM by any normal means.) + + [user@dom0 ~]$ rm /var/tmp/template-upgrade-cache.img + [user@dom0 ~]$ qvm-trim-template fedora-23 + + (Done.) + +Detailed: Upgrading the Standard Fedora 21 Template to Fedora 23 +---------------------------------------------------------------- + +These instructions will show you how to upgrade the standard Fedora 21 +TemplateVM to Fedora 23. The same general procedure may be used to upgrade any +template based on the standard Fedora 21 template. + + 1. Ensure the existing template is not running. + + [user@dom0 ~]$ qvm-shutdown fedora-21 + + 2. Clone the existing template and start a terminal in the new template. + + [user@dom0 ~]$ qvm-clone fedora-21 fedora-23 + [user@dom0 ~]$ qvm-run -a fedora-23 gnome-terminal + + 2. Attempt the upgrade process in the new template. For now you need to enable testing repository to do that. + + [user@fedora-23 ~]$ sudo yum clean all + [user@fedora-23 ~]$ sudo yum --releasever=23 --enablerepo=qubes*current-testing distro-sync + + 3. Shutdown the new TemplateVM via dom0 command line or Qubes VM Manager; + + [user@dom0 ~]$ qvm-shutdown fedora-23 + + If you encounter no errors, proceed to step 7. + + 4. If `yum` reports that you do not have enough free disk space to proceed with + the upgrade process, create an empty file in dom0 to use as a cache and + attach it to the template as a virtual disk. + + [user@dom0 ~]$ truncate -s 5GB /var/tmp/template-upgrade-cache.img + [user@dom0 ~]$ qvm-block -A fedora-23 dom0:/var/tmp/template-upgrade-cache.img + + Then reattempt the upgrade process, but this time using the virtual disk as + a cache. + + [user@fedora-23 ~]$ sudo mkfs.ext4 /dev/xvdi + [user@fedora-23 ~]$ sudo mount /dev/xvdi /mnt/removable + [user@fedora-23 ~]$ sudo yum clean all + [user@fedora-23 ~]$ sudo yum --releasever=23 --enablerepo=qubes*current-testing --setopt=cachedir=/mnt/removable distro-sync + + (Poweroff via Qubes VM Manager. May need to be killed.) + + 5. If `yum` complains that there is not enough free space in `/usr/lib/modules`, + do this before reattempting the upgrade: + + [user@fedora-23 ~]$ sudo mkdir /mnt/removable/modules + [user@fedora-23 ~]$ sudo cp -rp /usr/lib/modules /mnt/removable/modules + [user@fedora-23 ~]$ sudo mount --bind /mnt/removable/modules /usr/lib/modules + + 6. `yum` may complain: + + At least X MB more space needed on the / filesystem. + + In this case, one option is to [resize the TemplateVM's disk + image](/doc/ResizeDiskImage/) before reattempting the upgrade process. + (See **Additional Information** below for other options.) + + 7. After the upgrade process is finished, remove the cache file, if you + created one. + + [user@dom0 ~]$ rm /var/tmp/template-upgrade-cache.img + + 8. Trim the new template (see **Compacting the Upgraded Template** for details + and other options). + + [user@dom0 ~]$ qvm-trim-template fedora-23 + + 9. (Optional) Remove the old default template. + + [user@dom0 ~]$ sudo yum remove qubes-template-fedora-21 + + +Summary: Upgrading the Minimal Fedora 21 Template to Fedora 23 +-------------------------------------------------------------- + + [user@dom0 ~]$ qvm-clone fedora-21-minimal fedora-23-minimal + [user@dom0 ~]$ qvm-run -a fedora-23-minimal xterm + [user@fedora-23-minimal ~]$ su - + [root@fedora-23-minimal ~]# yum clean all + [user@fedora-23-minimal ~]# yum --releasever=23 --enablerepo=qubes*current-testing distro-sync + + (Shut down TemplateVM by any normal means.) + + [user@dom0 ~]$ qvm-trim-template fedora-23-minimal + +(If you encounter insufficient space issues, you may need to use the methods +described for the standard template above.) + + +Differences Between the Standard and Minimal Upgrade Procedures +--------------------------------------------------------------- + +The procedure for upgrading the minimal template (or any template based on the +minimal template) is the same as the procedure for the standard template above, +**with the following exceptions**: + + 1. `gnome-terminal` is not installed by default. Unless you've installed it + (or another terminal emulator), use `xterm`. (Of course, you can also use + `xterm` for the standard template, if you prefer.) + 2. `sudo` is not installed by default. Unless you've installed it, use `su` as + demonstrated above. (Of course, you can also use `su` for the standard + template, if you prefer.) + + +Compacting the Upgraded Template +================================ + +Neither `fstrim` nor the `discard` mount option works on the TemplateVM's root +filesystem, so when a file is removed in the template, space is not freed in +dom0. This means that the template will use about twice as much space as is +really necessary after upgrading. + +If you have at least `qubes-core-dom0-2.1.68` installed or are on Qubes R3.0, +you can use the `qvm-trim-template` tool: + + [user@dom0 ~]$ qvm-trim-template fedora-23 + +If you do not have `qubes-core-dom0-2.1.68` or are on older Qubes version, you can +compact the `root.img` manually. To do this, you will need about 15GB (the +TemplateVM's max size + the actually used space there) free space in dom0. + + 1. Start the template and fill all the free space with zeros, for example + with: + + [user@fedora-23 ~]$ dd if=/dev/zero of=/var/tmp/zero + + 2. Wait for the "No space left on device" error. Then: + + [user@fedora-23 ~]$ rm -f /var/tmp/zero + + 3. Shut down the template and all VMs based on it. Then: + + [user@dom0 ~]$ cd /var/lib/qubes/vm-templates/fedora-23 + [user@dom0 ~]$ cp --sparse=always root.img root.img.new + [user@dom0 ~]$ mv root.img.new root.img + + +Additional Information +====================== + +As mentioned above, you may encounter the following `yum` error: + + At least X MB more space needed on the / filesystem. + +In this case, you have several options: + + 1. [Increase the TemplateVM's disk image size](/doc/resize-disk-image/). + This is the solution mentioned in the main instructions above. + 2. Delete files in order to free up space. One way to do this is by + uninstalling packages. You may then reinstalling them again after you + finish the upgrade process, if desired). However, you may end up having to + increase the disk image size anyway (see previous option). + 3. Increase the `root.img` size with `qvm-grow-root`. It should be easy to + extend the `qvm-grow-root` tool in order to support PV (and not only HVM) + VMs. This is already done in R3.1. + 4. Do the upgrade in parts, e.g., by using package groups. (First upgrade + `@core` packages, then the rest.) + 5. Do not perform an in-place upgrade. Instead, simply download and install a + new template package, then redo all desired template modifications. + +With regard to the last option, here are some useful messages from the mailing +list which also apply to TemplateVM management and migration in general: + + * [Marek](https://groups.google.com/d/msg/qubes-users/mCXkxlACILQ/dS1jbLRP9n8J) + * [Jason M](https://groups.google.com/d/msg/qubes-users/mCXkxlACILQ/5PxDfI-RKAsJ) + +Upgrading to Fedora 22 +====================== + +You may choose to upgrade to Fedora 22 instead of Fedora 23. In that case, +simply replace version "23" with "22" in all above commands. + +Known issues with Fedora 23 +=========================== + +* [Graphical update tools (using PackageKit) does not work](https://github.com/QubesOS/qubes-issues/issues/982). +* [Dnf (new Fedora package manager) needs a lot of time to process repository metadata](https://bugzilla.redhat.com/show_bug.cgi?id=1227014), you may want to use `yum-deprecated` for now +* ["Terminal" shortcuts do not work because the desktop file in the VM has been renamed](https://github.com/QubesOS/qubes-issues/issues/1428). See the issue report for how to update your configuration to match. From d3c8a82d12bd38f41d24a308f8b03768d7822dda Mon Sep 17 00:00:00 2001 From: xn0px90 Date: Wed, 14 Nov 2018 16:28:16 -0500 Subject: [PATCH 2/4] upgrade-28-to-29 --- .../templates/fedora/upgrade-28-to-29.md | 390 ++++++++++++++++++ 1 file changed, 390 insertions(+) create mode 100644 managing-os/templates/fedora/upgrade-28-to-29.md diff --git a/managing-os/templates/fedora/upgrade-28-to-29.md b/managing-os/templates/fedora/upgrade-28-to-29.md new file mode 100644 index 00000000..bec5dff8 --- /dev/null +++ b/managing-os/templates/fedora/upgrade-28-to-29.md @@ -0,0 +1,390 @@ +--- +layout: doc +title: Upgrading the Fedora 28 Template to Fedora 29 +permalink: /doc/template/fedora/upgrade-28-to-29/ +redirect_from: +- /doc/fedora-template-upgrade-28/ +- /en/doc/fedora-template-upgrade-28/ +- /doc/FedoraTemplateUpgrade28/ +- /wiki/FedoraTemplateUpgrade28/ +--- + +Upgrading the Fedora 28 Template to Fedora 29 +============================================= + +This page provides instructions for performing an in-place upgrade of an +installed Fedora 28 [TemplateVM] to Fedora 29. If you wish to install a new, +unmodified Fedora 29 template instead of upgrading a template that is already +installed in your system, please see the [Fedora TemplateVM] page instead. + +These instructions can also be used to upgrade a Fedora 26 TemplateVM to +Fedora 29. Simply start by cloning `fedora-26` instead of `fedora-28` in the +instructions below. + + +Important information regarding RPM Fusion repos +------------------------------------------------ + +If your RPM Fusion repositories are **disabled** when you upgrade a TemplateVM from Fedora 28 to 29, all RPM Fusion packages and RPM Fusion repo definitions will be removed from that TemplateVM. +If your RPM Fusion repositories are **enabled** when upgrading, all RPM Fusion packages and repo definitions will be retained and updated as expected. +For most users, this behavior should not cause a problem, since a TemplateVM in which the RPM Fusion repos are disabled is probably a TemplateVM in which you never wish to use them. +However, if you wish to have the RPM Fusion repo definitions after upgrading in a TemplateVM in which they are currently disabled, you may wish to temporarily enable them prior to upgrading or manually create, copy, or download them after upgrading. + + +Workaround for `python2-xcffib` upgrade error +--------------------------------------------- + +When attempting to upgrade from Fedora 26 or 28 to Fedora 29, you may encounter an error similar to this: + + Error: Transaction check error: + file /usr/lib/python2.7/site-packages/xcffib-0.5.1-py2.7.egg-info/PKG-INFO from install of python2-xcffib-0.5.1-5.fc29.noarch conflicts with file from package python-xcffib-0.5.1-1.fc26.noarch + file /usr/lib/python2.7/site-packages/xcffib/_ffi.pyc from install of python2-xcffib-0.5.1-5.fc29.noarch conflicts with file from package python-xcffib-0.5.1-1.fc26.noarch + file /usr/lib/python2.7/site-packages/xcffib/_ffi.pyo from install of python2-xcffib-0.5.1-5.fc29.noarch conflicts with file from package python-xcffib-0.5.1-1.fc26.noarch + file /usr/lib/python2.7/site-packages/xcffib/xinput.pyc from install of python2-xcffib-0.5.1-5.fc29.noarch conflicts with file from package python-xcffib-0.5.1-1.fc26.noarch + file /usr/lib/python2.7/site-packages/xcffib/xinput.pyo from install of python2-xcffib-0.5.1-5.fc29.noarch conflicts with file from package python-xcffib-0.5.1-1.fc26.noarch + +To work around this error: + +1. Upgrade while excluding the problematic packages by using `-x python2-xcffib -x qubes-gui-vm -x qubes-gui-agent`. +2. Upgrade `python2-xcffib` using `sudo dnf swap python-xcffib python2-xcffib`. + (This should automatically upgrade the other excluded packages too.) + + +Qubes 3.2 Instructions +---------------------- + +### Summary: Upgrading the Standard Fedora 28 Template to Fedora 29 ### + +**Note:** The prompt on each line indicates where each command should be entered +(`@dom0` or `@fedora-29`). + + [user@dom0 ~]$ qvm-clone fedora-28 fedora-29 + [user@dom0 ~]$ truncate -s 5GB /var/tmp/template-upgrade-cache.img + [user@dom0 ~]$ qvm-run -a fedora-29 gnome-terminal + [user@dom0 ~]$ qvm-block -A fedora-29 dom0:/var/tmp/template-upgrade-cache.img + [user@fedora-29 ~]$ sudo mkfs.ext4 /dev/xvdi + [user@fedora-29 ~]$ sudo mount /dev/xvdi /mnt/removable + [user@fedora-29 ~]$ sudo dnf clean all + [user@fedora-29 ~]$ sudo dnf --releasever=29 --setopt=cachedir=/mnt/removable --best --allowerasing -x python2-tornado distro-sync + + (Shut down TemplateVM by any normal means.) + + [user@dom0 ~]$ rm /var/tmp/template-upgrade-cache.img + [user@dom0 ~]$ qvm-trim-template fedora-29 + +(Optional cleanup: Switch everything over to the new template and delete the old +one. See instructions below for details.) + + +### Detailed: Upgrading the Standard Fedora 28 Template to Fedora 29 ### + +These instructions will show you how to upgrade the standard Fedora 28 +TemplateVM to Fedora 29. The same general procedure may be used to upgrade any +template based on the standard Fedora 28 template. + +**Note:** The command-line prompt on each line indicates where each command +should be entered (`@dom0` or `@fedora-29`). + + 1. Ensure the existing template is not running. + + [user@dom0 ~]$ qvm-shutdown fedora-28 + + 2. Clone the existing template and start a terminal in the new template. + + [user@dom0 ~]$ qvm-clone fedora-28 fedora-29 + [user@dom0 ~]$ qvm-run -a fedora-29 gnome-terminal + + 3. Attempt the upgrade process in the new template. + + [user@fedora-29 ~]$ sudo dnf clean all + [user@fedora-29 ~]$ sudo dnf --releasever=29 distro-sync --best --allowerasing + + **Note:** `dnf` might ask you to approve importing a new package signing + key. For example, you might see a prompt like this one: + + warning: /mnt/removable/updates-0b4cc238d1aa4ffe/packages/kernel-4.18.17-300.fc29.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 429476b4: NOKEY + Importing GPG key 0x429476B4: + Userid : "Fedora 29 (29) " + Fingerprint: 5A03 B4DD 8254 ECA0 2FDA 1637 A20A A56B 4294 76B4 + From : /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-29-x86_64 + Is this ok [y/N]: y + + + This key was already checked when it was installed (notice that the "From" + line refers to a location on your local disk), so you can safely say yes to + this prompt. + + **Note:** If you encounter no errors, proceed to step 4. If you do encounter + errors, see the next two points first. + + * If `dnf` reports that you do not have enough free disk space to proceed + with the upgrade process, create an empty file in dom0 to use as a cache + and attach it to the template as a virtual disk. + + [user@dom0 ~]$ truncate -s 5GB /var/tmp/template-upgrade-cache.img + [user@dom0 ~]$ qvm-block -A fedora-29 dom0:/var/tmp/template-upgrade-cache.img + + Then reattempt the upgrade process, but this time use the virtual disk + as a cache. + + [user@fedora-29 ~]$ sudo mkfs.ext4 /dev/xvdi + [user@fedora-29 ~]$ sudo mount /dev/xvdi /mnt/removable + [user@fedora-29 ~]$ sudo dnf clean all + [user@fedora-29 ~]$ sudo dnf --releasever=29 --setopt=cachedir=/mnt/removable --best --allowerasing distro-sync + + If this attempt is successful, proceed to step 4. + + * `dnf` may complain: + + At least X MB more space needed on the / filesystem. + + In this case, one option is to [resize the TemplateVM's disk + image][resize-disk-image] before reattempting the upgrade process. + (See [Additional Information] below for other options.) + + 4. Check that you are on the correct (new) fedora release. + + [user@fedora-29 ~]$ cat /etc/fedora-release + + 5. Shut down the new TemplateVM (from the command-line or Qubes VM Manager). + + [user@dom0 ~]$ qvm-shutdown fedora-29 + + 6. Remove the cache file, if you created one. + + [user@dom0 ~]$ rm /var/tmp/template-upgrade-cache.img + + 7. Trim the new template (see [Compacting the Upgraded Template] for details + and other options). + + [user@dom0 ~]$ qvm-trim-template fedora-29 + + 8. (Recommended) [Switch everything that was set to the old template to the new + template.][switching-3.2] + + 9. (Optional) Remove the old template. (Make sure to type `fedora-28`, not + `fedora-29`.) + + [user@dom0 ~]$ sudo dnf remove qubes-template-fedora-28 + + +### Compacting the Upgraded Template ### + +Neither `fstrim` nor the `discard` mount option works on the TemplateVM's root +filesystem, so when a file is removed in the template, space is not freed in +dom0. This means that the template will use about twice as much space as is +really necessary after upgrading. + +You can use the `qvm-trim-template` tool: + + [user@dom0 ~]$ qvm-trim-template fedora-29 + + +### Upgrading StandaloneVMs ### + +The procedure for upgrading a StandaloneVM from Fedora 28 to Fedora 29 is the +same as for a TemplateVM, except that `qvm-trim-template` does not work on +StandaloneVMs. Instead, you should run the following command inside the +StandaloneVM in order to compact it: + + $ sudo fstrim -v -a + + +### Summary: Upgrading the Minimal Fedora 28 Template to Fedora 29 ### + +**Note:** The prompt on each line indicates where each command should be entered +(`@dom0` or `@fedora-29`). + + [user@dom0 ~]$ qvm-clone fedora-28-minimal fedora-29-minimal + [user@dom0 ~]$ qvm-run -u root -a fedora-29-minimal xterm + [root@fedora-29-minimal ~]# dnf clean all + [user@fedora-29-minimal ~]# dnf --releasever=29 --best --allowerasing distro-sync + + (Shut down TemplateVM by any normal means.) + + [user@dom0 ~]$ qvm-trim-template fedora-29-minimal + +(If you encounter insufficient space issues, you may need to use the methods +described for the standard template above.) + + +Qubes 4.0 Instructions +---------------------- + +### Summary: Upgrading the Standard Fedora 28 Template to Fedora 29 ### + +**Note:** The prompt on each line indicates where each command should be entered +(`@dom0` or `@fedora-29`). + + [user@dom0 ~]$ qvm-clone fedora-28 fedora-29 + [user@dom0 ~]$ truncate -s 5GB /var/tmp/template-upgrade-cache.img + [user@dom0 ~]$ qvm-run -a fedora-29 gnome-terminal + [user@dom0 ~]$ dev=$(sudo losetup -f --show /var/tmp/template-upgrade-cache.img) + [user@dom0 ~]$ qvm-block attach fedora-29 dom0:${dev##*/} + [user@fedora-29 ~]$ sudo mkfs.ext4 /dev/xvdi + [user@fedora-29 ~]$ sudo mount /dev/xvdi /mnt/removable + [user@fedora-29 ~]$ sudo dnf clean all + [user@fedora-29 ~]$ sudo dnf --releasever=29 --setopt=cachedir=/mnt/removable --best --allowerasing distro-sync + [user@fedora-29 ~]$ sudo fstrim -v / + + (Shut down TemplateVM by any normal means.) + + [user@dom0 ~]$ sudo losetup -d $dev + [user@dom0 ~]$ rm /var/tmp/template-upgrade-cache.img + +(Optional cleanup: Switch everything over to the new template and delete the old +one. See instructions below for details.) + + +### Detailed: Upgrading the Standard Fedora 28 Template to Fedora 29 ### + +These instructions will show you how to upgrade the standard Fedora 28 +TemplateVM to Fedora 29. The same general procedure may be used to upgrade any +template based on the standard Fedora 28 template. + +**Note:** The command-line prompt on each line indicates where each command +should be entered (`@dom0` or `@fedora-29`). + + 1. Ensure the existing template is not running. + + [user@dom0 ~]$ qvm-shutdown fedora-28 + + 2. Clone the existing template and start a terminal in the new template. + + [user@dom0 ~]$ qvm-clone fedora-28 fedora-29 + [user@dom0 ~]$ qvm-run -a fedora-29 gnome-terminal + + 3. Attempt the upgrade process in the new template. + + [user@fedora-29 ~]$ sudo dnf clean all + [user@fedora-29 ~]$ sudo dnf --releasever=29 distro-sync --best --allowerasing + + **Note:** `dnf` might ask you to approve importing a new package signing + key. For example, you might see a prompt like this one: + + warning: /mnt/removable/updates-0b4cc238d1aa4ffe/packages/kernel-4.18.17-300.fc29.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 429476b4: NOKEY + Importing GPG key 0x429476B4: + Userid : "Fedora 29 (29) " + Fingerprint: 5A03 B4DD 8254 ECA0 2FDA 1637 A20A A56B 4294 76B4 + From : /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-29-x86_64 + Is this ok [y/N]: y + + This key was already checked when it was installed (notice that the "From" + line refers to a location on your local disk), so you can safely say yes to + this prompt. + + **Note:** If you encounter no errors, proceed to step 4. If you do encounter + errors, see the next two points first. + + * If `dnf` reports that you do not have enough free disk space to proceed + with the upgrade process, create an empty file in dom0 to use as a cache + and attach it to the template as a virtual disk. + + [user@dom0 ~]$ truncate -s 5GB /var/tmp/template-upgrade-cache.img + [user@dom0 ~]$ dev=$(sudo losetup -f --show /var/tmp/template-upgrade-cache.img) + [user@dom0 ~]$ qvm-block attach fedora-29 dom0:${dev##*/} + + Then reattempt the upgrade process, but this time use the virtual disk + as a cache. + + [user@fedora-29 ~]$ sudo mkfs.ext4 /dev/xvdi + [user@fedora-29 ~]$ sudo mount /dev/xvdi /mnt/removable + [user@fedora-29 ~]$ sudo dnf clean all + [user@fedora-29 ~]$ sudo dnf --releasever=29 --setopt=cachedir=/mnt/removable --best --allowerasing distro-sync + + If this attempt is successful, proceed to step 4. + + * `dnf` may complain: + + At least X MB more space needed on the / filesystem. + + In this case, one option is to [resize the TemplateVM's disk + image][resize-disk-image] before reattempting the upgrade process. + (See [Additional Information] below for other options.) + + 4. Check that you are on the correct (new) fedora release. + + [user@fedora-29 ~]$ cat /etc/fedora-release + + 5. Trim the new template. + + [user@fedora-29 ~]$ sudo fstrim -v / + + 6. Shut down the new TemplateVM (from the command-line or Qubes VM Manager). + + [user@dom0 ~]$ qvm-shutdown fedora-29 + + 7. Remove the cache file, if you created one. + + [user@dom0 ~]$ sudo losetup -d $dev + [user@dom0 ~]$ rm /var/tmp/template-upgrade-cache.img + + 8. (Recommended) [Switch everything that was set to the old template to the new + template.][switching-4.0] + + 9. (Optional) Remove the old template. (Make sure to type `fedora-28`, not + `fedora-29`.) + + [user@dom0 ~]$ sudo dnf remove qubes-template-fedora-28 + + +### Upgrading StandaloneVMs ### + +The procedure for upgrading a StandaloneVM from Fedora 28 to Fedora 29 is the +same as for a TemplateVM. + + +### Summary: Upgrading the Minimal Fedora 28 Template to Fedora 29 ### + +**Note:** The prompt on each line indicates where each command should be entered +(`@dom0` or `@fedora-29`). + + [user@dom0 ~]$ qvm-clone fedora-28-minimal fedora-29-minimal + [user@dom0 ~]$ qvm-run -u root -a fedora-29-minimal xterm + [root@fedora-29-minimal ~]# dnf clean all + [user@fedora-29-minimal ~]# dnf --releasever=29 --best --allowerasing distro-sync + [user@fedora-29-minimal ~]# fstrim -v / + + (Shut down TemplateVM by any normal means.) + +(If you encounter insufficient space issues, you may need to use the methods +described for the standard template above.) + + +Additional Information +---------------------- + +As mentioned above, you may encounter the following `dnf` error: + + At least X MB more space needed on the / filesystem. + +In this case, you have several options: + + 1. [Increase the TemplateVM's disk image size][resize-disk-image]. + This is the solution mentioned in the main instructions above. + 2. Delete files in order to free up space. One way to do this is by + uninstalling packages. You may then reinstalling them again after you + finish the upgrade process, if desired). However, you may end up having to + increase the disk image size anyway (see previous option). + 3. Do the upgrade in parts, e.g., by using package groups. (First upgrade + `@core` packages, then the rest.) + 4. Do not perform an in-place upgrade. Instead, simply download and install a + new template package, then redo all desired template modifications. + + With regard to the last option, here are some useful messages from the + mailing list which also apply to TemplateVM management and migration in + general: + + * [Marek](https://groups.google.com/d/msg/qubes-users/mCXkxlACILQ/dS1jbLRP9n8J) + * [Jason M](https://groups.google.com/d/msg/qubes-users/mCXkxlACILQ/5PxDfI-RKAsJ) + + +[TemplateVM]: /doc/templates/ +[Fedora TemplateVM]: /doc/templates/fedora/ +[resize-disk-image]: /doc/resize-disk-image/ +[Additional Information]: #additional-information +[Compacting the Upgraded Template]: #compacting-the-upgraded-template +[switching-3.2]: /doc/templates/#how-to-switch-templates-32 +[switching-4.0]: /doc/templates/#how-to-switch-templates-40 +[DispVM]: /doc/dispvm/ + From 2fdce93774dcfeaee33ad0b33d381007027b72e9 Mon Sep 17 00:00:00 2001 From: xn0px90 Date: Wed, 14 Nov 2018 16:30:39 -0500 Subject: [PATCH 3/4] error = nil --- managing-o | 215 ----------------------------------------------------- 1 file changed, 215 deletions(-) delete mode 100644 managing-o diff --git a/managing-o b/managing-o deleted file mode 100644 index c908ea43..00000000 --- a/managing-o +++ /dev/null @@ -1,215 +0,0 @@ ---- -layout: doc -title: Upgrading the Fedora 21 Template -permalink: /doc/fedora-template-upgrade-21/ -redirect_from: -- /en/doc/fedora-template-upgrade-21/ -- /doc/FedoraTemplateUpgrade21/ -- /wiki/FedoraTemplateUpgrade21/ ---- - -Upgrading the Fedora 21 Template -================================ - -Summary: Upgrading the Standard Fedora 21 Template to Fedora 23 ---------------------------------------------------------------- - - [user@dom0 ~]$ qvm-clone fedora-21 fedora-23 - [user@dom0 ~]$ truncate -s 5GB /var/tmp/template-upgrade-cache.img - [user@dom0 ~]$ qvm-run -a fedora-23 gnome-terminal - [user@dom0 ~]$ qvm-block -A fedora-23 dom0:/var/tmp/template-upgrade-cache.img - [user@fedora-23 ~]$ sudo mkfs.ext4 /dev/xvdi - [user@fedora-23 ~]$ sudo mount /dev/xvdi /mnt/removable - [user@fedora-23 ~]$ sudo mkdir /mnt/removable/modules - [user@fedora-23 ~]$ sudo cp -rp /usr/lib/modules /mnt/removable/modules - [user@fedora-23 ~]$ sudo mount --bind /mnt/removable/modules /usr/lib/modules - [user@fedora-23 ~]$ sudo yum clean all - [user@fedora-23 ~]$ sudo yum --releasever=23 --enablerepo=qubes*current-testing --setopt=cachedir=/mnt/removable distro-sync - - (Shut down TemplateVM by any normal means.) - - [user@dom0 ~]$ rm /var/tmp/template-upgrade-cache.img - [user@dom0 ~]$ qvm-trim-template fedora-23 - - (Done.) - -Detailed: Upgrading the Standard Fedora 21 Template to Fedora 23 ----------------------------------------------------------------- - -These instructions will show you how to upgrade the standard Fedora 21 -TemplateVM to Fedora 23. The same general procedure may be used to upgrade any -template based on the standard Fedora 21 template. - - 1. Ensure the existing template is not running. - - [user@dom0 ~]$ qvm-shutdown fedora-21 - - 2. Clone the existing template and start a terminal in the new template. - - [user@dom0 ~]$ qvm-clone fedora-21 fedora-23 - [user@dom0 ~]$ qvm-run -a fedora-23 gnome-terminal - - 2. Attempt the upgrade process in the new template. For now you need to enable testing repository to do that. - - [user@fedora-23 ~]$ sudo yum clean all - [user@fedora-23 ~]$ sudo yum --releasever=23 --enablerepo=qubes*current-testing distro-sync - - 3. Shutdown the new TemplateVM via dom0 command line or Qubes VM Manager; - - [user@dom0 ~]$ qvm-shutdown fedora-23 - - If you encounter no errors, proceed to step 7. - - 4. If `yum` reports that you do not have enough free disk space to proceed with - the upgrade process, create an empty file in dom0 to use as a cache and - attach it to the template as a virtual disk. - - [user@dom0 ~]$ truncate -s 5GB /var/tmp/template-upgrade-cache.img - [user@dom0 ~]$ qvm-block -A fedora-23 dom0:/var/tmp/template-upgrade-cache.img - - Then reattempt the upgrade process, but this time using the virtual disk as - a cache. - - [user@fedora-23 ~]$ sudo mkfs.ext4 /dev/xvdi - [user@fedora-23 ~]$ sudo mount /dev/xvdi /mnt/removable - [user@fedora-23 ~]$ sudo yum clean all - [user@fedora-23 ~]$ sudo yum --releasever=23 --enablerepo=qubes*current-testing --setopt=cachedir=/mnt/removable distro-sync - - (Poweroff via Qubes VM Manager. May need to be killed.) - - 5. If `yum` complains that there is not enough free space in `/usr/lib/modules`, - do this before reattempting the upgrade: - - [user@fedora-23 ~]$ sudo mkdir /mnt/removable/modules - [user@fedora-23 ~]$ sudo cp -rp /usr/lib/modules /mnt/removable/modules - [user@fedora-23 ~]$ sudo mount --bind /mnt/removable/modules /usr/lib/modules - - 6. `yum` may complain: - - At least X MB more space needed on the / filesystem. - - In this case, one option is to [resize the TemplateVM's disk - image](/doc/ResizeDiskImage/) before reattempting the upgrade process. - (See **Additional Information** below for other options.) - - 7. After the upgrade process is finished, remove the cache file, if you - created one. - - [user@dom0 ~]$ rm /var/tmp/template-upgrade-cache.img - - 8. Trim the new template (see **Compacting the Upgraded Template** for details - and other options). - - [user@dom0 ~]$ qvm-trim-template fedora-23 - - 9. (Optional) Remove the old default template. - - [user@dom0 ~]$ sudo yum remove qubes-template-fedora-21 - - -Summary: Upgrading the Minimal Fedora 21 Template to Fedora 23 --------------------------------------------------------------- - - [user@dom0 ~]$ qvm-clone fedora-21-minimal fedora-23-minimal - [user@dom0 ~]$ qvm-run -a fedora-23-minimal xterm - [user@fedora-23-minimal ~]$ su - - [root@fedora-23-minimal ~]# yum clean all - [user@fedora-23-minimal ~]# yum --releasever=23 --enablerepo=qubes*current-testing distro-sync - - (Shut down TemplateVM by any normal means.) - - [user@dom0 ~]$ qvm-trim-template fedora-23-minimal - -(If you encounter insufficient space issues, you may need to use the methods -described for the standard template above.) - - -Differences Between the Standard and Minimal Upgrade Procedures ---------------------------------------------------------------- - -The procedure for upgrading the minimal template (or any template based on the -minimal template) is the same as the procedure for the standard template above, -**with the following exceptions**: - - 1. `gnome-terminal` is not installed by default. Unless you've installed it - (or another terminal emulator), use `xterm`. (Of course, you can also use - `xterm` for the standard template, if you prefer.) - 2. `sudo` is not installed by default. Unless you've installed it, use `su` as - demonstrated above. (Of course, you can also use `su` for the standard - template, if you prefer.) - - -Compacting the Upgraded Template -================================ - -Neither `fstrim` nor the `discard` mount option works on the TemplateVM's root -filesystem, so when a file is removed in the template, space is not freed in -dom0. This means that the template will use about twice as much space as is -really necessary after upgrading. - -If you have at least `qubes-core-dom0-2.1.68` installed or are on Qubes R3.0, -you can use the `qvm-trim-template` tool: - - [user@dom0 ~]$ qvm-trim-template fedora-23 - -If you do not have `qubes-core-dom0-2.1.68` or are on older Qubes version, you can -compact the `root.img` manually. To do this, you will need about 15GB (the -TemplateVM's max size + the actually used space there) free space in dom0. - - 1. Start the template and fill all the free space with zeros, for example - with: - - [user@fedora-23 ~]$ dd if=/dev/zero of=/var/tmp/zero - - 2. Wait for the "No space left on device" error. Then: - - [user@fedora-23 ~]$ rm -f /var/tmp/zero - - 3. Shut down the template and all VMs based on it. Then: - - [user@dom0 ~]$ cd /var/lib/qubes/vm-templates/fedora-23 - [user@dom0 ~]$ cp --sparse=always root.img root.img.new - [user@dom0 ~]$ mv root.img.new root.img - - -Additional Information -====================== - -As mentioned above, you may encounter the following `yum` error: - - At least X MB more space needed on the / filesystem. - -In this case, you have several options: - - 1. [Increase the TemplateVM's disk image size](/doc/resize-disk-image/). - This is the solution mentioned in the main instructions above. - 2. Delete files in order to free up space. One way to do this is by - uninstalling packages. You may then reinstalling them again after you - finish the upgrade process, if desired). However, you may end up having to - increase the disk image size anyway (see previous option). - 3. Increase the `root.img` size with `qvm-grow-root`. It should be easy to - extend the `qvm-grow-root` tool in order to support PV (and not only HVM) - VMs. This is already done in R3.1. - 4. Do the upgrade in parts, e.g., by using package groups. (First upgrade - `@core` packages, then the rest.) - 5. Do not perform an in-place upgrade. Instead, simply download and install a - new template package, then redo all desired template modifications. - -With regard to the last option, here are some useful messages from the mailing -list which also apply to TemplateVM management and migration in general: - - * [Marek](https://groups.google.com/d/msg/qubes-users/mCXkxlACILQ/dS1jbLRP9n8J) - * [Jason M](https://groups.google.com/d/msg/qubes-users/mCXkxlACILQ/5PxDfI-RKAsJ) - -Upgrading to Fedora 22 -====================== - -You may choose to upgrade to Fedora 22 instead of Fedora 23. In that case, -simply replace version "23" with "22" in all above commands. - -Known issues with Fedora 23 -=========================== - -* [Graphical update tools (using PackageKit) does not work](https://github.com/QubesOS/qubes-issues/issues/982). -* [Dnf (new Fedora package manager) needs a lot of time to process repository metadata](https://bugzilla.redhat.com/show_bug.cgi?id=1227014), you may want to use `yum-deprecated` for now -* ["Terminal" shortcuts do not work because the desktop file in the VM has been renamed](https://github.com/QubesOS/qubes-issues/issues/1428). See the issue report for how to update your configuration to match. From f23d1e22b647c79b4142f5bd99f32423cfd1306e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Mon, 7 Jan 2019 22:57:09 +0100 Subject: [PATCH 4/4] upgrade-28-to-29: drop parts not applicable anymore - there is no Fedora 29 for R3.2 - workaround for python2-xcffib isn't needed anymore --- .../templates/fedora/upgrade-28-to-29.md | 182 +----------------- 1 file changed, 5 insertions(+), 177 deletions(-) diff --git a/managing-os/templates/fedora/upgrade-28-to-29.md b/managing-os/templates/fedora/upgrade-28-to-29.md index bec5dff8..73d1581f 100644 --- a/managing-os/templates/fedora/upgrade-28-to-29.md +++ b/managing-os/templates/fedora/upgrade-28-to-29.md @@ -31,183 +31,6 @@ For most users, this behavior should not cause a problem, since a TemplateVM in However, if you wish to have the RPM Fusion repo definitions after upgrading in a TemplateVM in which they are currently disabled, you may wish to temporarily enable them prior to upgrading or manually create, copy, or download them after upgrading. -Workaround for `python2-xcffib` upgrade error ---------------------------------------------- - -When attempting to upgrade from Fedora 26 or 28 to Fedora 29, you may encounter an error similar to this: - - Error: Transaction check error: - file /usr/lib/python2.7/site-packages/xcffib-0.5.1-py2.7.egg-info/PKG-INFO from install of python2-xcffib-0.5.1-5.fc29.noarch conflicts with file from package python-xcffib-0.5.1-1.fc26.noarch - file /usr/lib/python2.7/site-packages/xcffib/_ffi.pyc from install of python2-xcffib-0.5.1-5.fc29.noarch conflicts with file from package python-xcffib-0.5.1-1.fc26.noarch - file /usr/lib/python2.7/site-packages/xcffib/_ffi.pyo from install of python2-xcffib-0.5.1-5.fc29.noarch conflicts with file from package python-xcffib-0.5.1-1.fc26.noarch - file /usr/lib/python2.7/site-packages/xcffib/xinput.pyc from install of python2-xcffib-0.5.1-5.fc29.noarch conflicts with file from package python-xcffib-0.5.1-1.fc26.noarch - file /usr/lib/python2.7/site-packages/xcffib/xinput.pyo from install of python2-xcffib-0.5.1-5.fc29.noarch conflicts with file from package python-xcffib-0.5.1-1.fc26.noarch - -To work around this error: - -1. Upgrade while excluding the problematic packages by using `-x python2-xcffib -x qubes-gui-vm -x qubes-gui-agent`. -2. Upgrade `python2-xcffib` using `sudo dnf swap python-xcffib python2-xcffib`. - (This should automatically upgrade the other excluded packages too.) - - -Qubes 3.2 Instructions ----------------------- - -### Summary: Upgrading the Standard Fedora 28 Template to Fedora 29 ### - -**Note:** The prompt on each line indicates where each command should be entered -(`@dom0` or `@fedora-29`). - - [user@dom0 ~]$ qvm-clone fedora-28 fedora-29 - [user@dom0 ~]$ truncate -s 5GB /var/tmp/template-upgrade-cache.img - [user@dom0 ~]$ qvm-run -a fedora-29 gnome-terminal - [user@dom0 ~]$ qvm-block -A fedora-29 dom0:/var/tmp/template-upgrade-cache.img - [user@fedora-29 ~]$ sudo mkfs.ext4 /dev/xvdi - [user@fedora-29 ~]$ sudo mount /dev/xvdi /mnt/removable - [user@fedora-29 ~]$ sudo dnf clean all - [user@fedora-29 ~]$ sudo dnf --releasever=29 --setopt=cachedir=/mnt/removable --best --allowerasing -x python2-tornado distro-sync - - (Shut down TemplateVM by any normal means.) - - [user@dom0 ~]$ rm /var/tmp/template-upgrade-cache.img - [user@dom0 ~]$ qvm-trim-template fedora-29 - -(Optional cleanup: Switch everything over to the new template and delete the old -one. See instructions below for details.) - - -### Detailed: Upgrading the Standard Fedora 28 Template to Fedora 29 ### - -These instructions will show you how to upgrade the standard Fedora 28 -TemplateVM to Fedora 29. The same general procedure may be used to upgrade any -template based on the standard Fedora 28 template. - -**Note:** The command-line prompt on each line indicates where each command -should be entered (`@dom0` or `@fedora-29`). - - 1. Ensure the existing template is not running. - - [user@dom0 ~]$ qvm-shutdown fedora-28 - - 2. Clone the existing template and start a terminal in the new template. - - [user@dom0 ~]$ qvm-clone fedora-28 fedora-29 - [user@dom0 ~]$ qvm-run -a fedora-29 gnome-terminal - - 3. Attempt the upgrade process in the new template. - - [user@fedora-29 ~]$ sudo dnf clean all - [user@fedora-29 ~]$ sudo dnf --releasever=29 distro-sync --best --allowerasing - - **Note:** `dnf` might ask you to approve importing a new package signing - key. For example, you might see a prompt like this one: - - warning: /mnt/removable/updates-0b4cc238d1aa4ffe/packages/kernel-4.18.17-300.fc29.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 429476b4: NOKEY - Importing GPG key 0x429476B4: - Userid : "Fedora 29 (29) " - Fingerprint: 5A03 B4DD 8254 ECA0 2FDA 1637 A20A A56B 4294 76B4 - From : /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-29-x86_64 - Is this ok [y/N]: y - - - This key was already checked when it was installed (notice that the "From" - line refers to a location on your local disk), so you can safely say yes to - this prompt. - - **Note:** If you encounter no errors, proceed to step 4. If you do encounter - errors, see the next two points first. - - * If `dnf` reports that you do not have enough free disk space to proceed - with the upgrade process, create an empty file in dom0 to use as a cache - and attach it to the template as a virtual disk. - - [user@dom0 ~]$ truncate -s 5GB /var/tmp/template-upgrade-cache.img - [user@dom0 ~]$ qvm-block -A fedora-29 dom0:/var/tmp/template-upgrade-cache.img - - Then reattempt the upgrade process, but this time use the virtual disk - as a cache. - - [user@fedora-29 ~]$ sudo mkfs.ext4 /dev/xvdi - [user@fedora-29 ~]$ sudo mount /dev/xvdi /mnt/removable - [user@fedora-29 ~]$ sudo dnf clean all - [user@fedora-29 ~]$ sudo dnf --releasever=29 --setopt=cachedir=/mnt/removable --best --allowerasing distro-sync - - If this attempt is successful, proceed to step 4. - - * `dnf` may complain: - - At least X MB more space needed on the / filesystem. - - In this case, one option is to [resize the TemplateVM's disk - image][resize-disk-image] before reattempting the upgrade process. - (See [Additional Information] below for other options.) - - 4. Check that you are on the correct (new) fedora release. - - [user@fedora-29 ~]$ cat /etc/fedora-release - - 5. Shut down the new TemplateVM (from the command-line or Qubes VM Manager). - - [user@dom0 ~]$ qvm-shutdown fedora-29 - - 6. Remove the cache file, if you created one. - - [user@dom0 ~]$ rm /var/tmp/template-upgrade-cache.img - - 7. Trim the new template (see [Compacting the Upgraded Template] for details - and other options). - - [user@dom0 ~]$ qvm-trim-template fedora-29 - - 8. (Recommended) [Switch everything that was set to the old template to the new - template.][switching-3.2] - - 9. (Optional) Remove the old template. (Make sure to type `fedora-28`, not - `fedora-29`.) - - [user@dom0 ~]$ sudo dnf remove qubes-template-fedora-28 - - -### Compacting the Upgraded Template ### - -Neither `fstrim` nor the `discard` mount option works on the TemplateVM's root -filesystem, so when a file is removed in the template, space is not freed in -dom0. This means that the template will use about twice as much space as is -really necessary after upgrading. - -You can use the `qvm-trim-template` tool: - - [user@dom0 ~]$ qvm-trim-template fedora-29 - - -### Upgrading StandaloneVMs ### - -The procedure for upgrading a StandaloneVM from Fedora 28 to Fedora 29 is the -same as for a TemplateVM, except that `qvm-trim-template` does not work on -StandaloneVMs. Instead, you should run the following command inside the -StandaloneVM in order to compact it: - - $ sudo fstrim -v -a - - -### Summary: Upgrading the Minimal Fedora 28 Template to Fedora 29 ### - -**Note:** The prompt on each line indicates where each command should be entered -(`@dom0` or `@fedora-29`). - - [user@dom0 ~]$ qvm-clone fedora-28-minimal fedora-29-minimal - [user@dom0 ~]$ qvm-run -u root -a fedora-29-minimal xterm - [root@fedora-29-minimal ~]# dnf clean all - [user@fedora-29-minimal ~]# dnf --releasever=29 --best --allowerasing distro-sync - - (Shut down TemplateVM by any normal means.) - - [user@dom0 ~]$ qvm-trim-template fedora-29-minimal - -(If you encounter insufficient space issues, you may need to use the methods -described for the standard template above.) - - Qubes 4.0 Instructions ---------------------- @@ -351,6 +174,11 @@ same as for a TemplateVM. described for the standard template above.) +Qubes 3.2 +--------- + +Fedora 29 is currently not supported on Qubes 3.2. Since official support for Qubes 3.2 ends (2019-03-28) before end of support for Fedora 28 (not earlier than 2019-05-30), Qubes team does not plan to add support for Fedora 29 to Qubes 3.2. + Additional Information ----------------------