From cd77785af602fcd581cda46ff06c4b8501caa148 Mon Sep 17 00:00:00 2001 From: Nicklaus McClendon Date: Sat, 21 May 2016 16:42:05 -0500 Subject: [PATCH 1/5] Added documentation for upgrade Debian 8 to Debian 9 --- managing-os/debian-template-upgrade-8.md | 122 +++++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 managing-os/debian-template-upgrade-8.md diff --git a/managing-os/debian-template-upgrade-8.md b/managing-os/debian-template-upgrade-8.md new file mode 100644 index 00000000..11a69714 --- /dev/null +++ b/managing-os/debian-template-upgrade-8.md @@ -0,0 +1,122 @@ +--- +layout: doc +title: Upgrading the Debian 8 Template +permalink: /doc/debian-template-upgrade-8/ +redirect_from: +- /en/doc/debian-template-upgrade-8/ +- /doc/DebianTemplateUpgrade8/ +- /wiki/DebianTemplateUpgrade8/ +--- + +Upgrading the Debian 8 Template +=============================== + +Disclaimer: Debian 9 (Stretch) is marked testing for a reason. You may notice stability problems when using it. + +Summary: Upgrading the Standard Debian 8 Template to Debian 9 +------------------------------------------------------------- + + [user@dom0 ~]$ qvm-clone debian-8 debian-9 + [user@dom0 ~]$ qvm-run -a debian-9 gnome-terminal + [user@debian-9 ~]$ sudo sed -i.backup 's/jessie/stretch/g' /etc/apt/sources.list + [user@debian-9 ~]$ sudo sed -i.backup 's/jessie/stretch/g' /etc/apt/sources.list.d/qubes-r3.list + [user@debian-9 ~]$ sudo apt-get update && sudo apt-get dist-upgrade -y + [user@debian-9 ~]$ sudo apt-get autoremove + + (Shut down TemplateVM by any normal means.) + + [user@dom0 ~]$ qvm-trim-template debian-9 + + (Done.) + +Detailed: Upgrading the Standard Debian 8 Template to Debian 9 +-------------------------------------------------------------- + +These instructions will show you how to upgrade the standard Debian 8 +TemplateVM to Debian 9. The same general procedure may be used to upgrade +any template based on the standard Debian 8 template. + + 1. Ensure the existing template is not running. + + [user@dom0 ~]$ qvm-shutdown debian-8 + + 2. Clone the existing template and start a terminal in the new template. + + [user@dom0 ~]$ qvm-clone debian-8 debian-9 + [user@dom0 ~]$ qvm-run -a debian-9 gnome-terminal + + 3. Update your apt repositories to use stretch instead of jessie + (This can be done manully with a text editor, but sed can be used to + automatically update the files and back them up.) + + [user@debian-9 ~]$ sudo sed -i.backup 's/jessie/stretch/g' /etc/apt/sources.list + [user@debian-9 ~]$ sudo sed -i.backup 's/jessie/stretch/g' /etc/apt/sources.list.d/qubes-r3.list + + 4. Update the package lists and upgrade to Debian 9 + + [user@debian-9 ~]$ sudo apt-get update && sudo apt-get dist-upgrade -y + + 5. Remove unneccessary packages that were previously installed + + [user@debian-9 ~]$ sudo apt-get autoremove + + 6. Shutdown the new TemplateVM via dom0 command line or Qubes VM Manager; + + [user@dom0 ~]$ qvm-shutdown debian-9 + + 7. Trim the new template (see **Compacting the Upgraded Template** for details + and other options). + + [user@dom0 ~]$ qvm-trim-template debian-9 + + 8. (Optional) Remove the old default template. + + [user@dom0 ~]$ sudo yum remove qubes-template-debian-8 + + +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 debian-9 + +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@debian-9 ~]$ dd if=/dev/zero of=/var/tmp/zero + + 2. Wait for the "No space left on device" error. Then: + + [user@debian-9 ~]$ 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/debian-9 + [user@dom0 ~]$ cp --sparse=always root.img root.img.new + [user@dom0 ~]$ mv root.img.new root.img + +Additional Information +====================== + +It should be noted that Debian 9 (Stretch) is currently marked testing and +should be treat as such. For projects that need absolute stability, upgrading +may not be the best option. + +Debian Stretch packages were first made available in the Qubes R3.1 repositories. + +Relevant Mailing List Discussions +--------------------------------- + * [Stretch Template Installation][https://groups.google.com/forum/#!topicsearchin/qubes-devel/debian$20stretch/qubes-devel/4rdayBF_UTc] + * [Stretch availability in 3.2][https://groups.google.com/forum/#!topicsearchin/qubes-devel/debian$20stretch/qubes-devel/cekPfBqQMOI] + \ No newline at end of file From 681f7cbd9a2b48c15a2ad5551031f4669b0c329d Mon Sep 17 00:00:00 2001 From: Nicklaus McClendon Date: Sat, 21 May 2016 16:46:16 -0500 Subject: [PATCH 2/5] Style fixes --- managing-os/debian-template-upgrade-8.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/managing-os/debian-template-upgrade-8.md b/managing-os/debian-template-upgrade-8.md index 11a69714..58695460 100644 --- a/managing-os/debian-template-upgrade-8.md +++ b/managing-os/debian-template-upgrade-8.md @@ -21,7 +21,7 @@ Summary: Upgrading the Standard Debian 8 Template to Debian 9 [user@debian-9 ~]$ sudo sed -i.backup 's/jessie/stretch/g' /etc/apt/sources.list [user@debian-9 ~]$ sudo sed -i.backup 's/jessie/stretch/g' /etc/apt/sources.list.d/qubes-r3.list [user@debian-9 ~]$ sudo apt-get update && sudo apt-get dist-upgrade -y - [user@debian-9 ~]$ sudo apt-get autoremove + [user@debian-9 ~]$ sudo apt-get autoremove (Shut down TemplateVM by any normal means.) @@ -117,6 +117,6 @@ Debian Stretch packages were first made available in the Qubes R3.1 repositories Relevant Mailing List Discussions --------------------------------- - * [Stretch Template Installation][https://groups.google.com/forum/#!topicsearchin/qubes-devel/debian$20stretch/qubes-devel/4rdayBF_UTc] - * [Stretch availability in 3.2][https://groups.google.com/forum/#!topicsearchin/qubes-devel/debian$20stretch/qubes-devel/cekPfBqQMOI] + * [Stretch Template Installation](https://groups.google.com/forum/#!topicsearchin/qubes-devel/debian$20stretch/qubes-devel/4rdayBF_UTc) + * [Stretch availability in 3.2](https://groups.google.com/forum/#!topicsearchin/qubes-devel/debian$20stretch/qubes-devel/cekPfBqQMOI) \ No newline at end of file From a95c6707c2ac5c43008ed34248479dc30d40c32a Mon Sep 17 00:00:00 2001 From: Nicklaus McClendon Date: Sat, 21 May 2016 16:49:48 -0500 Subject: [PATCH 3/5] Spelling fixes --- managing-os/debian-template-upgrade-8.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/managing-os/debian-template-upgrade-8.md b/managing-os/debian-template-upgrade-8.md index 58695460..e4da40a7 100644 --- a/managing-os/debian-template-upgrade-8.md +++ b/managing-os/debian-template-upgrade-8.md @@ -46,7 +46,7 @@ any template based on the standard Debian 8 template. [user@dom0 ~]$ qvm-run -a debian-9 gnome-terminal 3. Update your apt repositories to use stretch instead of jessie - (This can be done manully with a text editor, but sed can be used to + (This can be done manually with a text editor, but sed can be used to automatically update the files and back them up.) [user@debian-9 ~]$ sudo sed -i.backup 's/jessie/stretch/g' /etc/apt/sources.list @@ -56,7 +56,7 @@ any template based on the standard Debian 8 template. [user@debian-9 ~]$ sudo apt-get update && sudo apt-get dist-upgrade -y - 5. Remove unneccessary packages that were previously installed + 5. Remove unnecessary packages that were previously installed [user@debian-9 ~]$ sudo apt-get autoremove From b983d8913d4877e04e1161051392e2de11129631 Mon Sep 17 00:00:00 2001 From: Nicklaus McClendon Date: Sat, 21 May 2016 17:01:08 -0500 Subject: [PATCH 4/5] Added configuration file information --- managing-os/debian-template-upgrade-8.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/managing-os/debian-template-upgrade-8.md b/managing-os/debian-template-upgrade-8.md index e4da40a7..34334211 100644 --- a/managing-os/debian-template-upgrade-8.md +++ b/managing-os/debian-template-upgrade-8.md @@ -52,8 +52,11 @@ any template based on the standard Debian 8 template. [user@debian-9 ~]$ sudo sed -i.backup 's/jessie/stretch/g' /etc/apt/sources.list [user@debian-9 ~]$ sudo sed -i.backup 's/jessie/stretch/g' /etc/apt/sources.list.d/qubes-r3.list - 4. Update the package lists and upgrade to Debian 9 - + 4. Update the package lists and upgrade to Debian 9. During the process, + it will likely prompt to overwrite two files, qubes-r3.list and + pulse/client.conf. qubes-r3.list can be overwritten, while pulse/client.conf + need to left as the currently installed version. + [user@debian-9 ~]$ sudo apt-get update && sudo apt-get dist-upgrade -y 5. Remove unnecessary packages that were previously installed From 856e4db9f98ccf55b33c624bdac043b567845b3e Mon Sep 17 00:00:00 2001 From: Nicklaus McClendon Date: Sat, 21 May 2016 19:55:23 -0500 Subject: [PATCH 5/5] Updated main page --- doc.md | 1 + managing-os/debian-template-upgrade-8.md | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/doc.md b/doc.md index 25e08527..72fd148d 100644 --- a/doc.md +++ b/doc.md @@ -71,6 +71,7 @@ Managing Operating Systems within Qubes * [Upgrading the Fedora 21 Template](/doc/fedora-template-upgrade-21/) * [Upgrading the Fedora 20 Template](/doc/fedora-template-upgrade-20/) * [Upgrading the Fedora 18 Template](/doc/fedora-template-upgrade-18/) + * [Upgrading the Debian 8 Template](/doc/debian-template-upgrade-8/) * [Tips for Using Linux in an HVM](/doc/linux-hvm-tips/) * [Creating a NetBSD VM](/doc/netbsd/) diff --git a/managing-os/debian-template-upgrade-8.md b/managing-os/debian-template-upgrade-8.md index 34334211..b07793b9 100644 --- a/managing-os/debian-template-upgrade-8.md +++ b/managing-os/debian-template-upgrade-8.md @@ -18,8 +18,8 @@ Summary: Upgrading the Standard Debian 8 Template to Debian 9 [user@dom0 ~]$ qvm-clone debian-8 debian-9 [user@dom0 ~]$ qvm-run -a debian-9 gnome-terminal - [user@debian-9 ~]$ sudo sed -i.backup 's/jessie/stretch/g' /etc/apt/sources.list - [user@debian-9 ~]$ sudo sed -i.backup 's/jessie/stretch/g' /etc/apt/sources.list.d/qubes-r3.list + [user@debian-9 ~]$ sudo sed -i 's/jessie/stretch/g' /etc/apt/sources.list + [user@debian-9 ~]$ sudo sed -i 's/jessie/stretch/g' /etc/apt/sources.list.d/qubes-r3.list [user@debian-9 ~]$ sudo apt-get update && sudo apt-get dist-upgrade -y [user@debian-9 ~]$ sudo apt-get autoremove @@ -47,10 +47,10 @@ any template based on the standard Debian 8 template. 3. Update your apt repositories to use stretch instead of jessie (This can be done manually with a text editor, but sed can be used to - automatically update the files and back them up.) + automatically update the files.) - [user@debian-9 ~]$ sudo sed -i.backup 's/jessie/stretch/g' /etc/apt/sources.list - [user@debian-9 ~]$ sudo sed -i.backup 's/jessie/stretch/g' /etc/apt/sources.list.d/qubes-r3.list + [user@debian-9 ~]$ sudo sed -i 's/jessie/stretch/g' /etc/apt/sources.list + [user@debian-9 ~]$ sudo sed -i 's/jessie/stretch/g' /etc/apt/sources.list.d/qubes-r3.list 4. Update the package lists and upgrade to Debian 9. During the process, it will likely prompt to overwrite two files, qubes-r3.list and