2014-07-28 17:14:28 -04:00
---
2021-03-13 13:06:18 -05:00
lang: en
2015-04-10 16:17:45 -04:00
layout: doc
2021-06-16 22:56:25 -04:00
permalink: /doc/templates/debian/
2015-10-11 03:04:59 -04:00
redirect_from:
2016-05-21 10:49:01 -04:00
- /doc/debian/
2015-10-28 18:14:40 -04:00
- /en/doc/templates/debian/
2015-10-11 03:04:59 -04:00
- /doc/Templates/Debian/
- /wiki/Templates/Debian/
2021-03-13 13:06:18 -05:00
ref: 134
2021-06-17 07:23:57 -04:00
title: Debian Templates
2014-07-28 17:14:28 -04:00
---
2021-06-18 05:16:40 -04:00
The Debian [template ](/doc/templates/ ) is an officially [supported ](/doc/supported-versions/#templates ) template in Qubes OS.
This page is about the standard (or "full") Debian template.
For the minimal version, please see the [Minimal templates ](/doc/templates/minimal/ ) page.
2021-04-10 18:09:05 -04:00
There is also a [Qubes page on the Debian Wiki ](https://wiki.debian.org/Qubes ).
2015-04-23 10:14:55 -04:00
2019-09-02 05:34:26 -04:00
## Installing
2015-04-23 10:14:55 -04:00
2021-06-18 05:16:40 -04:00
To [install ](/doc/templates/#installing ) a specific Debian template that is not currently installed in your system, use the following command in dom0:
2014-07-28 17:14:28 -04:00
2021-03-13 12:03:23 -05:00
```
$ sudo qubes-dom0-update qubes-template-debian-XX
```
2018-10-22 09:09:09 -04:00
2019-09-02 05:34:26 -04:00
(Replace `XX` with the Debian version number of the template you wish to install.)
2014-07-28 17:14:28 -04:00
2021-06-18 05:16:40 -04:00
To reinstall a Debian template that is already installed in your system, see [How to Reinstall a template ](/doc/reinstall-template/ ).
2014-07-28 17:14:28 -04:00
2019-09-02 05:34:26 -04:00
## After Installing
2015-04-22 23:26:43 -04:00
2021-06-18 05:16:40 -04:00
After installing a fresh Debian template, we recommend performing the following steps:
2015-04-22 23:26:43 -04:00
2021-06-18 05:16:40 -04:00
1. [Update the template ](/doc/software-update-vm/ ).
2016-01-20 10:00:53 -05:00
2021-06-18 05:16:40 -04:00
2. [Switch any app qubes that are based on the old template to the new one ](/doc/templates/#switching ).
2014-07-28 17:14:28 -04:00
2021-06-18 05:16:40 -04:00
3. If desired, [uninstall the old template ](/doc/templates/#uninstalling ).
2017-11-27 19:52:39 -05:00
2021-06-21 01:01:01 -04:00
## Installing software
See [How to Install Software ](/doc/how-to-install-software/ ).
2019-09-02 05:34:26 -04:00
## Updating
2021-06-21 01:01:01 -04:00
For routine daily updates within a given release, see [How to Update ](/doc/how-to-update/ ).
2019-09-02 05:34:26 -04:00
## Upgrading
2021-06-18 05:16:40 -04:00
There are two ways to upgrade your template to a new Debian release:
2020-08-16 04:49:30 -04:00
2021-06-21 00:55:36 -04:00
- **Recommended:** [Install a fresh template to replace the existing one. ](#installing ) **This option may be simpler for less experienced users.** After you install the new template, redo all desired template modifications and [switch everything that was set to the old template to the new template ](/doc/templates/#switching ). You may want to write down the modifications you make to your templates so that you remember what to redo on each fresh install. In the old Debian template, see `/var/log/dpkg.log` and `/var/log/apt/history.log` for logs of package manager actions.
2019-09-02 05:34:26 -04:00
2021-06-21 00:55:36 -04:00
- **Advanced:** [Perform an in-place upgrade of an existing Debian template. ](/doc/template/debian/upgrade/ ) This option will preserve any modifications you've made to the template, **but it may be more complicated for less experienced users.**
2019-09-02 05:34:26 -04:00
## Release-specific notes
This section contains notes about specific Debian releases.
### Debian 10
2019-08-22 12:30:06 -04:00
Debian 10 (buster) - minimal:
2021-03-13 12:03:23 -05:00
```
[user@dom0 ~]$ sudo qubes-dom0-update --enablerepo=qubes-templates-itl qubes-template-debian-10-minimal
```
2019-08-22 12:30:06 -04:00
2019-07-10 11:43:46 -04:00
Debian 10 (buster) - stable:
2021-03-13 12:03:23 -05:00
```
[user@dom0 ~]$ sudo qubes-dom0-update --enablerepo=qubes-templates-itl qubes-template-debian-10
```
2019-07-10 11:43:46 -04:00
2017-05-20 17:48:23 -04:00
### Starting services
2017-02-09 15:29:54 -05:00
The Debian way (generally) is to start daemons if they are installed.
This means that if you install (say) ssh-server in a template, *all* the qubes that use that template will run a ssh server when they start. (They will, naturally, all have the same server key.) This may not be what you want.
So be very careful when installing software in Templates - if the daemon spawns outbound connections then there is a serious security risk.
In general, a reasonable approach would be, (using ssh as example):
2021-03-13 12:03:23 -05:00
2017-02-09 15:29:54 -05:00
- Install the ssh service.
2020-04-19 15:54:19 -04:00
- `systemctl stop ssh`
- `systemctl disable ssh`
- `systemctl mask ssh`
2017-02-09 15:29:54 -05:00
- Close down template
Now the ssh service will **NOT** start in qubes based on this template.
2020-04-19 15:54:19 -04:00
Where you **DO** want the service to run, put this in `/rw/config/rc.local` :
2017-02-09 15:29:54 -05:00
2021-03-13 12:03:23 -05:00
```
systemctl unmask ssh
systemctl start ssh
```
2017-02-09 15:29:54 -05:00
Don't forget to make the file executable.
2017-05-20 17:48:23 -04:00
### Unattended Upgrades
2017-02-09 15:29:54 -05:00
2020-04-19 15:54:19 -04:00
Some users have noticed that on upgrading to Stretch, the `unattended-upgrade` package is installed.
2017-02-09 15:29:54 -05:00
This package is pulled in as part of a Recommend chain, and can be purged.
2021-03-13 12:03:23 -05:00
The lesson is that you should carefully look at what is being installed to your system, particularly if you run `dist-upgrade` .
2017-02-09 15:29:54 -05:00
2018-03-21 20:35:56 -04:00
### Package installation errors in Qubes 4.0
2020-10-10 06:02:41 -04:00
If some packages throw installation errors, see [this guide. ](/doc/vm-troubleshooting/#fixing-package-installation-errors )