2019-07-11 09:02:44 -04:00
|
|
|
---
|
2021-06-24 10:10:26 -04:00
|
|
|
advanced: true
|
2021-03-13 13:06:18 -05:00
|
|
|
lang: en
|
2019-07-11 09:02:44 -04:00
|
|
|
layout: doc
|
2021-06-16 22:56:25 -04:00
|
|
|
permalink: /doc/template/debian/upgrade/
|
2019-07-11 09:02:44 -04:00
|
|
|
redirect_from:
|
2019-09-02 05:34:26 -04:00
|
|
|
- /doc/template/debian/upgrade-8-to-9/
|
|
|
|
- /doc/debian-template-upgrade-8/
|
|
|
|
- /en/doc/debian-template-upgrade-8/
|
|
|
|
- /doc/DebianTemplateUpgrade8/
|
|
|
|
- /wiki/DebianTemplateUpgrade8/
|
2021-03-13 13:06:18 -05:00
|
|
|
ref: 133
|
2021-07-09 08:10:44 -04:00
|
|
|
title: How to upgrade a Debian template in-place
|
2019-07-11 09:02:44 -04:00
|
|
|
---
|
|
|
|
|
2021-06-16 00:22:35 -04:00
|
|
|
<div class="alert alert-danger" role="alert">
|
|
|
|
<i class="fa fa-exclamation-triangle"></i>
|
2021-09-26 19:47:15 -04:00
|
|
|
<b>Warning:</b> This page is intended for advanced users only. Most users
|
|
|
|
seeking to upgrade should instead <a
|
|
|
|
href="/doc/templates/debian/#installing">install a new Debian template</a>.
|
|
|
|
Learn more about the two options <a
|
|
|
|
href="/doc/templates/debian/#upgrading">here</a>.
|
2021-06-16 00:22:35 -04:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
2021-09-26 19:47:15 -04:00
|
|
|
This page provides instructions for performing an in-place upgrade of an
|
|
|
|
installed [Debian Template](/doc/templates/debian/). If you wish to install a
|
|
|
|
new, unmodified Debian template instead of upgrading a template that is already
|
|
|
|
installed in your system, please see the [Debian
|
|
|
|
Template](/doc/templates/debian/) page instead. ([Learn more about the two
|
|
|
|
options.](/doc/templates/debian/#upgrading)) In general, upgrading a Debian
|
|
|
|
template follows the same process as [upgrading a native Debian
|
|
|
|
system](https://wiki.debian.org/DebianUpgrade).
|
2019-07-11 09:02:44 -04:00
|
|
|
|
2021-06-18 05:16:40 -04:00
|
|
|
## Summary instructions for Debian templates
|
2019-07-11 09:02:44 -04:00
|
|
|
|
2021-09-26 19:47:15 -04:00
|
|
|
**Important:** The prompt on each line indicates where each command should be
|
|
|
|
entered: `dom0`, `debian-<old>`, or `debian-<new>`, where `<old>` is the Debian
|
|
|
|
version number *from* which you are upgrading, and `<new>` is the Debian
|
|
|
|
version number *to* which you are upgrading. The instructions may differ for
|
|
|
|
certain releases. See [release-specific notes](#release-specific-notes) for any
|
|
|
|
instructions specific to your particular release.
|
2019-07-11 09:02:44 -04:00
|
|
|
|
2021-03-13 12:03:23 -05:00
|
|
|
```
|
|
|
|
[user@dom0 ~]$ qvm-clone debian-<old> debian-<new>
|
|
|
|
[user@dom0 ~]$ qvm-run -a debian-<new> gnome-terminal
|
|
|
|
[user@debian-<new> ~]$ sudo sed -i 's/<old-name>/<new-name>/g' /etc/apt/sources.list
|
|
|
|
[user@debian-<new> ~]$ sudo sed -i 's/<old-name>/<new-name>/g' /etc/apt/sources.list.d/qubes-r4.list
|
|
|
|
[user@debian-<new> ~]$ sudo apt update
|
|
|
|
[user@debian-<new> ~]$ sudo apt upgrade
|
|
|
|
[user@debian-<new> ~]$ sudo apt dist-upgrade
|
|
|
|
[user@dom0 ~]$ qvm-shutdown debian-<new>
|
|
|
|
```
|
2019-07-11 09:02:44 -04:00
|
|
|
|
2021-04-10 18:09:05 -04:00
|
|
|
**Recommended:** [Switch everything that was set to the old template to the new template.](/doc/templates/#switching)
|
2019-07-11 09:02:44 -04:00
|
|
|
|
2021-06-18 05:16:40 -04:00
|
|
|
## Detailed instructions for Debian templates
|
2019-09-02 05:34:26 -04:00
|
|
|
|
2021-09-26 19:47:15 -04:00
|
|
|
These instructions will show you how to upgrade Debian templates. The same
|
|
|
|
general procedure may be used to upgrade any template based on the standard
|
|
|
|
Debian template.
|
2019-09-02 05:34:26 -04:00
|
|
|
|
2021-09-26 19:47:15 -04:00
|
|
|
**Important:** The prompt on each line indicates where each command should be
|
|
|
|
entered: `dom0`, `debian-<old>`, or `debian-<new>`, where `<old>` is the Debian
|
|
|
|
version number *from* which you are upgrading, and `<new>` is the Debian
|
|
|
|
version number *to* which you are upgrading. The instructions may differ for
|
|
|
|
certain releases. See [release-specific notes](#release-specific-notes) for any
|
|
|
|
instructions specific to your particular release.
|
2019-07-11 09:02:44 -04:00
|
|
|
|
2021-03-13 12:03:23 -05:00
|
|
|
1. Ensure the existing template is not running.
|
2019-07-11 09:02:44 -04:00
|
|
|
|
2021-09-26 19:47:15 -04:00
|
|
|
```
|
|
|
|
[user@dom0 ~]$ qvm-shutdown debian-<old>
|
|
|
|
```
|
2019-07-11 09:02:44 -04:00
|
|
|
|
2021-03-13 12:03:23 -05:00
|
|
|
2. Clone the existing template and start a terminal in the new template.
|
2019-07-11 09:02:44 -04:00
|
|
|
|
2021-09-26 19:47:15 -04:00
|
|
|
```
|
|
|
|
[user@dom0 ~]$ qvm-clone debian-<old> debian-<new>
|
|
|
|
[user@dom0 ~]$ qvm-run -a debian-<new> gnome-terminal
|
|
|
|
```
|
2019-07-11 09:02:44 -04:00
|
|
|
|
2021-09-26 19:47:15 -04:00
|
|
|
3. Update your `apt` repositories to use the new release's code name instead of
|
|
|
|
the old release's code name. (This can be done manually with a text editor,
|
|
|
|
but `sed` can be used to automatically update the files.)
|
2021-03-13 12:03:23 -05:00
|
|
|
|
2021-09-26 19:47:15 -04:00
|
|
|
```
|
|
|
|
[user@debian-<new> ~]$ sudo sed -i 's/<old-name>/<new-name>/g' /etc/apt/sources.list
|
|
|
|
[user@debian-<new> ~]$ sudo sed -i 's/<old-name>/<new-name>/g' /etc/apt/sources.list.d/qubes-r4.list
|
|
|
|
```
|
2019-07-11 09:02:44 -04:00
|
|
|
|
2021-09-26 19:47:15 -04:00
|
|
|
4. Update the package lists and upgrade. During the process, it may prompt you
|
|
|
|
to overwrite the file `qubes-r4.list`. You should overwrite this file.
|
2019-09-02 05:34:26 -04:00
|
|
|
|
2021-09-26 19:47:15 -04:00
|
|
|
```
|
|
|
|
[user@debian-<new> ~]$ sudo apt update
|
|
|
|
[user@debian-<new> ~]$ sudo apt upgrade
|
|
|
|
[user@debian-<new> ~]$ sudo apt dist-upgrade
|
|
|
|
```
|
2019-09-02 05:34:26 -04:00
|
|
|
|
2021-03-13 12:03:23 -05:00
|
|
|
5. (Optional) Remove unnecessary packages that were previously installed.
|
2019-09-02 05:34:26 -04:00
|
|
|
|
2021-09-26 19:47:15 -04:00
|
|
|
```
|
|
|
|
[user@debian-<new> ~]$ sudo apt-get autoremove
|
|
|
|
```
|
2019-09-02 05:34:26 -04:00
|
|
|
|
2021-03-13 12:03:23 -05:00
|
|
|
6. (Optional) Clean cached packages from `/var/cache/apt`.
|
2019-09-02 05:34:26 -04:00
|
|
|
|
2021-09-26 19:47:15 -04:00
|
|
|
```
|
|
|
|
[user@debian-<new> ~]$ sudo apt-get clean
|
|
|
|
```
|
2019-07-11 09:02:44 -04:00
|
|
|
|
2021-09-26 19:47:15 -04:00
|
|
|
7. (Optional) Trim the new template. (This should [no longer be
|
|
|
|
necessary](/doc/templates/#important-notes), but it does not hurt. Some
|
|
|
|
users have [reported](https://github.com/QubesOS/qubes-issues/issues/5055)
|
|
|
|
that it makes a difference.)
|
2019-07-11 09:02:44 -04:00
|
|
|
|
2021-09-26 19:47:15 -04:00
|
|
|
```
|
|
|
|
[user@debian-<new> ~]$ sudo fstrim -av
|
|
|
|
[user@dom0 ~]$ qvm-shutdown debian-<new>
|
|
|
|
[user@dom0 ~]$ qvm-start debian-<new>
|
|
|
|
[user@debian-<new> ~]$ sudo fstrim -av
|
|
|
|
```
|
2019-07-11 09:02:44 -04:00
|
|
|
|
2021-06-18 05:16:40 -04:00
|
|
|
8. Shut down the new template.
|
2019-07-11 09:02:44 -04:00
|
|
|
|
2021-09-26 19:47:15 -04:00
|
|
|
```
|
|
|
|
[user@dom0 ~]$ qvm-shutdown debian-<new>
|
|
|
|
```
|
2019-07-11 09:02:44 -04:00
|
|
|
|
2021-09-26 19:47:15 -04:00
|
|
|
9. (Recommended) [Switch everything that was set to the old template to the new
|
|
|
|
template.](/doc/templates/#switching)
|
2019-07-11 09:02:44 -04:00
|
|
|
|
2019-09-02 05:34:26 -04:00
|
|
|
10. (Optional) Make the new template the global default.
|
2019-08-22 12:30:06 -04:00
|
|
|
|
2021-03-13 12:03:23 -05:00
|
|
|
```
|
2022-04-02 16:32:13 -04:00
|
|
|
[user@dom0 ~]$ qubes-prefs --set default_template debian-<new>
|
2021-03-13 12:03:23 -05:00
|
|
|
```
|
2019-07-11 09:02:44 -04:00
|
|
|
|
2021-09-26 19:47:15 -04:00
|
|
|
11. (Optional) [Uninstall the old template.](/doc/templates/#uninstalling) Make
|
|
|
|
sure that the template you're uninstalling is the old one, not the new one!
|
2019-07-11 09:02:44 -04:00
|
|
|
|
2021-06-18 05:29:28 -04:00
|
|
|
## Standalones
|
2019-09-02 05:34:26 -04:00
|
|
|
|
2021-09-26 19:47:15 -04:00
|
|
|
The procedure for upgrading a Debian [standalone](/doc/standalone-and-hvm/) is
|
|
|
|
the same as for a template.
|
2019-09-02 05:34:26 -04:00
|
|
|
|
|
|
|
## Release-specific notes
|
|
|
|
|
|
|
|
This section contains notes about upgrading to specific releases.
|
|
|
|
|
2021-09-15 16:22:03 -04:00
|
|
|
### Debian 11 ("Bullseye")
|
|
|
|
|
2021-09-26 19:47:15 -04:00
|
|
|
Please see [Debian's Bullseye upgrade
|
|
|
|
instructions](https://www.debian.org/releases/bullseye/amd64/release-notes/ch-upgrading.en.html).
|
|
|
|
In particular: for APT source lines referencing the security archive, the
|
|
|
|
format has changed slightly along with the release name, going from
|
|
|
|
buster/updates to bullseye-security; see [Section 5.1.2, “Changed security
|
|
|
|
archive
|
|
|
|
layout”](https://www.debian.org/releases/stable/mips64el/release-notes/ch-information.en.html#security-archive).
|
2021-09-15 16:22:03 -04:00
|
|
|
|
2021-09-26 19:47:15 -04:00
|
|
|
This means that, when upgrading from Buster to Bullseye, an additional `sed`
|
|
|
|
command is required:
|
2021-09-15 16:22:03 -04:00
|
|
|
|
|
|
|
```
|
|
|
|
[user@dom0 ~]$ qvm-clone debian-10 debian-11
|
|
|
|
[user@dom0 ~]$ qvm-run -a debian-11 gnome-terminal
|
|
|
|
[user@debian-<new> ~]$ sudo sed -i 's/buster/bullseye/g' /etc/apt/sources.list
|
|
|
|
[user@debian-<new> ~]$ sudo sed -i 's/debian-security bullseye\/updates/debian-security bullseye-security/g' /etc/apt/sources.list
|
|
|
|
[user@debian-<new> ~]$ sudo sed -i 's/buster/bullseye/g' /etc/apt/sources.list.d/qubes-r4.list
|
|
|
|
[user@debian-<new> ~]$ sudo apt update
|
|
|
|
[user@debian-<new> ~]$ sudo apt upgrade
|
|
|
|
[user@debian-<new> ~]$ sudo apt dist-upgrade
|
|
|
|
[user@dom0 ~]$ qvm-shutdown debian-11
|
|
|
|
```
|
|
|
|
|
2019-09-02 05:34:26 -04:00
|
|
|
### Debian 10 ("Buster")
|
|
|
|
|
2021-09-26 19:47:15 -04:00
|
|
|
Please see [Debian's Buster upgrade
|
|
|
|
instructions](https://www.debian.org/releases/buster/amd64/release-notes/ch-upgrading.en.html).
|
2019-07-11 09:02:44 -04:00
|
|
|
|
2019-09-02 05:34:26 -04:00
|
|
|
### Debian 9 ("Stretch")
|
2019-08-22 12:30:06 -04:00
|
|
|
|
2021-09-26 19:47:15 -04:00
|
|
|
* The upgrade process may prompt you to overwrite two files: `qubes-r4.list`
|
|
|
|
and `pulse/client.conf`. `qubes-r4.list` can be overwritten, but
|
|
|
|
`pulse/client.conf` must be left as the currently-installed version.
|
2019-07-11 09:02:44 -04:00
|
|
|
|
2021-09-26 19:47:15 -04:00
|
|
|
* If sound is not working, you may need to enable the Qubes testing repository
|
|
|
|
to get the testing version of `qubes-gui-agent`. This can be done by editing
|
|
|
|
the `/etc/apt/sources.list.d/qubes-r4.list` file and uncommenting the `Qubes
|
|
|
|
Updates Candidates` repo.
|
2019-09-02 05:34:26 -04:00
|
|
|
|
2021-06-18 05:16:40 -04:00
|
|
|
* User-initiated updates/upgrades may not run when a template first starts.
|
2021-09-26 19:47:15 -04:00
|
|
|
This is due to a new Debian config setting that attempts to update
|
|
|
|
automatically; it should be disabled with `sudo systemctl disable
|
|
|
|
apt-daily.{service,timer}`.
|
2019-09-02 05:34:26 -04:00
|
|
|
|
|
|
|
Relevant discussions:
|
|
|
|
|
2021-03-13 12:03:23 -05:00
|
|
|
* [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)
|
|
|
|
* [Fixing sound in Debian Stretch](https://groups.google.com/forum/#!topic/qubes-users/JddCE54GFiU)
|
|
|
|
* [User apt commands blocked on startup](https://github.com/QubesOS/qubes-issues/issues/2621)
|
2019-09-02 05:34:26 -04:00
|
|
|
|
2021-09-26 19:47:15 -04:00
|
|
|
Also see [Debian's Stretch upgrade
|
|
|
|
instructions](https://www.debian.org/releases/stretch/amd64/release-notes/ch-upgrading.en.html).
|
2019-09-02 05:34:26 -04:00
|
|
|
|
|
|
|
### Debian 8 ("Jessie")
|
|
|
|
|
2021-09-26 19:47:15 -04:00
|
|
|
Please see [Debian's Jessie upgrade
|
|
|
|
instructions](https://www.debian.org/releases/jessie/amd64/release-notes/ch-upgrading.en.html).
|
2019-09-02 05:34:26 -04:00
|
|
|
|
|
|
|
### End-of-life (EOL) releases
|
|
|
|
|
2021-09-26 19:47:15 -04:00
|
|
|
We strongly recommend against using any Debian release that has reached
|
|
|
|
[end-of-life
|
|
|
|
(EOL)](https://wiki.debian.org/DebianReleases#Production_Releases).
|
2019-09-02 05:34:26 -04:00
|
|
|
|
|
|
|
## Additional information
|
|
|
|
|
2021-09-26 19:47:15 -04:00
|
|
|
* Please note that, if you installed packages from one of the
|
|
|
|
[testing](/doc/testing/) repositories, you must make sure that the repository
|
|
|
|
is enabled in `/etc/apt/sources.list.d/qubes-r4.list` before attempting the
|
|
|
|
upgrade. Otherwise, your upgrade will
|
|
|
|
[break](https://github.com/QubesOS/qubes-issues/issues/2418).
|
2019-09-02 05:34:26 -04:00
|
|
|
|
2021-09-26 19:47:15 -04:00
|
|
|
* By default, Qubes uses code names in the `apt` sources files, although the
|
|
|
|
templates are referred to by release number. Check the code names for the
|
|
|
|
templates, and ensure you are aware of any changes you have made in the
|
|
|
|
repository definitions.
|