2011-04-10 18:42:58 -04:00
---
2021-03-13 13:06:18 -05:00
lang: en
2015-04-10 16:17:45 -04:00
layout: doc
2021-06-17 07:23:57 -04:00
permalink: /doc/how-to-install-software/
2015-10-11 03:04:59 -04:00
redirect_from:
2021-06-17 07:23:57 -04:00
- /doc/software-update-domu/
2019-09-02 05:34:26 -04:00
- /doc/software-update-vm/
2015-10-28 18:14:40 -04:00
- /en/doc/software-update-vm/
2015-10-11 03:04:59 -04:00
- /doc/SoftwareUpdateVM/
- /wiki/SoftwareUpdateVM/
2021-03-13 13:06:18 -05:00
ref: 189
2021-07-08 21:06:41 -04:00
title: How to install software
2011-04-10 18:42:58 -04:00
---
2021-06-20 23:43:43 -04:00
When you wish to install software in Qubes OS, you should generally install it
2021-07-05 09:09:42 -04:00
in a [template ](/doc/glossary/#template ). For installing templates themselves,
2022-04-20 17:19:04 -04:00
see [how to install a template ](/doc/templates/#installing ). Advanced users may
also be interested in learning how to install software in
2021-06-20 23:55:57 -04:00
[standalones ](/doc/standalones-and-hvms/ ) and
2021-06-20 23:43:43 -04:00
[dom0 ](/doc/how-to-install-software-in-dom0 ).
2019-08-26 20:43:58 -04:00
2022-04-20 17:19:04 -04:00
Qubes OS is effectively a "meta" operating system (OS) that can run almost any
arbitrary OS inside of itself. For example, the way software is normally
installed in a Linux distribution ("distro") is quite different from the way
software is normally installed in Windows. This isn't up to Qubes. Qubes is
just the framework in which you're running these other OSes. Therefore, if you
want to install software in a Linux template, for example, you should do so in
whatever way is normal for that Linux distro. Most Linux software is
distributed via [packages ](https://en.wikipedia.org/wiki/Package_format ), which
are stored in [software
repositories](https://en.wikipedia.org/wiki/Software_repository) ("repos").
[Package managers ](https://en.wikipedia.org/wiki/Package_manager ) handle
downloading, installing, updating, and removing packages. (Again, none of this
is Qubes-specific.) If you're not familiar with how software is normally
installed in Linux distros via package managers or the software you want
doesn't seem to be available in your distro's repos (or you're in another
situation not covered on this page), please read this [community guide to
installing software in Qubes](https://forum.qubes-os.org/t/9991/).
The following instructions explain how to permanently install new software in a
template. There are different instructions for software from the default
repositories and all other software. (If you're not sure, try the default
repositories first.)
## Installing software from default repositories
2021-06-18 04:25:09 -04:00
1. Start the template.
2011-04-10 18:42:58 -04:00
2021-06-18 09:58:10 -04:00
2. Start either a terminal (e.g. `gnome-terminal` ) or a dedicated software
management application, such as `gpk-application` .
2021-06-18 04:25:09 -04:00
2021-06-20 23:43:43 -04:00
3. Install software as normally instructed inside that operating system, e.g.:
- Fedora: `sudo dnf install <PACKAGE_NAME>`
- Debian: `sudo apt install <PACKAGE_NAME>`
2021-06-18 04:25:09 -04:00
2022-04-20 17:37:28 -04:00
4. Shut down the template.
2021-06-18 04:25:09 -04:00
2022-04-20 17:37:28 -04:00
5. Restart all qubes based on the template.
2021-06-18 04:25:09 -04:00
2022-04-20 17:37:28 -04:00
6. (Recommended) In the relevant qubes' **Settings > Applications** tab, select
the new application(s) from the list, and press **OK** . These new shortcuts
will appear in the Applications Menu. (If you encounter problems, see
[here ](/doc/app-menu-shortcut-troubleshooting/ ) for troubleshooting.)
2020-11-03 17:17:40 -05:00
2021-06-18 08:46:02 -04:00
![[The Applications tab in Qube Settings ](/attachment/doc/r4.1-dom0-appmenu-select.png )](/attachment/doc/r4.1-dom0-appmenu-select.png)
2013-04-29 04:40:46 -04:00
2022-04-20 17:19:04 -04:00
## Installing software from other sources
**Warning:** This method gives your template direct network access, which is
[risky ](#why-dont-templates-have-network-access ). This method is **not**
2022-04-20 17:51:39 -04:00
recommended for trusted templates. Moreover, depending on how you install this
software, it may not get updated automatically when you [update Qubes
normally](/doc/how-to-update/), which means you may have to update it manually
yourself.
2022-04-20 17:19:04 -04:00
Some software is not available from the default repositories and must be
downloaded and installed from another source. This method assumes that you're
trying to follow the instructions to install some piece of software in a normal
operating system, except that operating system is running as a template in
Qubes OS.
1. (Recommended) Clone the desired template (since this new template will
probably be less trusted than the original).
2022-04-20 17:37:28 -04:00
2. (Recommended) In the new template's **Settings > Basic** tab, change the
color label from black to red (or another color that signifies to you that
the template is less trusted).
2022-04-20 17:19:04 -04:00
2022-04-20 17:37:28 -04:00
3. In the new template's **Settings > Basic** tab, change the **Networking**
value from `default (none) (current)` to `sys-firewall` (or whichever
network-providing qube you wish to use).
2022-04-20 17:19:04 -04:00
2022-04-20 17:37:28 -04:00
4. (Recommended) In the new template's **Settings > Firewall rules** tab,
select "Limit outgoing Internet connections to..." and tick "Allow full
access for 5 min." (This can help in case you forget to remove network
access later.)
2022-04-20 17:19:04 -04:00
5. Follow the normal instructions for installing your software in the new
template. For example, open a terminal and enter the commands as instructed.
**Warning:** If you don't fully understand the commands you're entering,
then this can be extremely risky, and the template should be regarded as
*completely untrusted* .
2022-04-20 17:37:28 -04:00
6. (Recommended) In the new template's **Settings > Basic** tab, change the
**Networking** value from `sys-firewall (current)` (or whichever
network-providing qube you chose) back to `default (none)` .
2022-04-20 17:19:04 -04:00
2022-04-20 17:37:28 -04:00
7. Shut down the new template.
2022-04-20 17:19:04 -04:00
2022-04-20 17:37:28 -04:00
8. Create or assign your desired app qubes to use the new template. If any app
qubes were already assigned to the new template, restart them.
2022-04-20 17:19:04 -04:00
2022-04-20 17:37:28 -04:00
9. (Recommended) In the relevant qubes' **Settings > Applications** tab, select
the new application(s) from the list, and press **OK** . These new shortcuts
will appear in the Applications Menu. (If you encounter problems, see
[here ](/doc/app-menu-shortcut-troubleshooting/ ) for troubleshooting.)
2022-04-20 17:19:04 -04:00
![[The Applications tab in Qube Settings ](/attachment/doc/r4.1-dom0-appmenu-select.png )](/attachment/doc/r4.1-dom0-appmenu-select.png)
2021-06-20 23:43:43 -04:00
## Troubleshooting
If things are still not working as expected:
2022-04-20 17:19:04 -04:00
- Review the instructions very carefully, making sure you follow each step.
2021-06-20 23:43:43 -04:00
- Make sure you **shut down the template after installing your software** .
- Make sure you **restart your app qube *after* shutting down your template** .
2022-04-20 17:37:28 -04:00
- Make sure your app qube is assigned to the right template.
2021-06-20 23:43:43 -04:00
- If your software requires special files or directories to be persistent, and
2022-04-20 17:19:04 -04:00
you're an advanced user, see [standalones and
HVMs](/doc/standalones-and-hvms/) and [how to make any file persistent
2021-06-20 23:43:43 -04:00
(bind-dirs)](/doc/bind-dirs/).
2021-06-21 21:39:21 -04:00
- [Ask for help. ](/support/ )
2021-06-20 23:43:43 -04:00
2022-04-20 17:19:04 -04:00
2021-06-18 04:25:09 -04:00
## How to update software
2011-04-11 06:10:01 -04:00
2021-06-18 04:25:09 -04:00
Please see [How to Update ](/doc/how-to-update/ ).
2011-04-10 18:42:58 -04:00
2022-04-20 17:19:04 -04:00
2021-06-18 04:25:09 -04:00
## Why don't templates have network access?
2022-03-07 19:50:22 -05:00
In order to protect you from performing risky activities in templates, they do
2022-04-20 17:19:04 -04:00
not have normal network access by default. Instead, templates use an [updates
2021-06-18 09:58:10 -04:00
proxy](#updates-proxy) that allows you to install and update software without
2022-04-20 17:19:04 -04:00
giving the template direct network access. **The updates proxy is already set
up to work automatically out-of-the-box and requires no special action from
you.** Most users should simply follow the normal instructions for [installing
software from default
repositories](#installing-software-from-default-repositories) and
[updating ](/doc/how-to-update/ ) software. If your software is not available in
the default repositories, see [installing software from other
sources](#installing-software-from-other-sources).
2021-06-18 04:25:09 -04:00
## Advanced
2021-06-18 09:58:10 -04:00
The following sections cover advanced topics pertaining to installing and
updating software in domUs.
2021-06-18 04:25:09 -04:00
2022-04-20 17:19:04 -04:00
2021-06-18 04:25:09 -04:00
### Testing repositories
2011-04-10 18:42:58 -04:00
2021-06-18 09:58:10 -04:00
If you wish to install updates that are still in [testing ](/doc/testing ), you
must enable the appropriate testing repositories.
2017-03-21 22:05:09 -04:00
2021-07-05 09:09:42 -04:00
**Note:** The following repos are in templates and standalones. For dom0 testing
repos, see [here ](/doc/how-to-install-software-in-dom0/#testing-repositories ).
For testing new templates, please see [here ](/doc/testing/#templates ).
2022-04-20 17:19:04 -04:00
2021-06-18 04:25:09 -04:00
#### Fedora
2016-06-12 14:39:09 -04:00
2017-03-21 13:31:27 -04:00
There are three Qubes VM testing repositories (where `*` denotes the Release):
2016-06-12 14:39:09 -04:00
2021-06-18 09:58:10 -04:00
- `qubes-vm-*-current-testing` -- testing packages that will eventually land in
the stable (`current`) repository
- `qubes-vm-*-security-testing` -- a subset of `qubes-vm-*-current-testing`
that contains packages that qualify as security fixes
- `qubes-vm-*-unstable` -- packages that are not intended to land in the stable
(`qubes-vm-*-current`) repository; mostly experimental debugging packages
2016-06-12 14:39:09 -04:00
2021-06-18 09:58:10 -04:00
To temporarily enable any of these repos, use the `--enablerepo=<repo-name>`
option. Example commands:
2016-06-12 14:39:09 -04:00
~~~
sudo dnf upgrade --enablerepo=qubes-vm-*-current-testing
sudo dnf upgrade --enablerepo=qubes-vm-*-security-testing
sudo dnf upgrade --enablerepo=qubes-vm-*-unstable
~~~
2021-06-18 09:58:10 -04:00
To enable or disable any of these repos permanently, change the corresponding
`enabled` value to `1` in `/etc/yum.repos.d/qubes-*.repo` .
2016-06-12 14:39:09 -04:00
2022-04-20 17:19:04 -04:00
2021-06-18 04:25:09 -04:00
#### Debian
2017-03-21 13:31:27 -04:00
2021-06-18 09:58:10 -04:00
Debian also has three Qubes VM testing repositories (where `*` denotes the
Release):
2017-03-21 13:31:27 -04:00
2021-06-18 09:58:10 -04:00
- `*-testing` -- testing packages that will eventually land in the stable
(`current`) repository
- `*-securitytesting` -- a subset of `*-testing` that contains packages that
qualify as security fixes
- `*-unstable` -- packages that are not intended to land in the stable
repository; mostly experimental debugging packages
2017-03-21 13:31:27 -04:00
2021-06-18 09:58:10 -04:00
To enable or disable any of these repos permanently, uncomment the
corresponding `deb` line in `/etc/apt/sources.list.d/qubes-r*.list` .
2018-01-26 08:05:21 -05:00
2022-04-20 17:19:04 -04:00
2021-06-18 05:29:28 -04:00
### Standalones
2012-11-29 06:10:31 -05:00
2021-06-20 23:43:43 -04:00
The process for installing and updating software in
[standalones ](/doc/glossary/#standalone ) is the same as described above for
templates, except no qubes are based on standalones, so there are no other
qubes to restart.
2018-09-03 15:50:51 -04:00
2022-04-20 17:19:04 -04:00
2021-06-18 04:25:09 -04:00
### RPMFusion for Fedora templates
2011-04-10 18:42:58 -04:00
2021-06-18 09:58:10 -04:00
If you would like to enable the [RPM Fusion ](https://rpmfusion.org/ )
repositories, open a Terminal of the template and type the following commands,
depending on which RPM Fusion repositories you wish to enable (see [RPM
Fusion](https://rpmfusion.org/) for details):
2011-04-11 06:10:01 -04:00
2015-09-26 19:00:33 -04:00
~~~
2020-09-13 08:49:37 -04:00
sudo dnf config-manager --set-enabled rpmfusion-free
sudo dnf config-manager --set-enabled rpmfusion-free-updates
sudo dnf config-manager --set-enabled rpmfusion-nonfree
sudo dnf config-manager --set-enabled rpmfusion-nonfree-updates
2019-09-02 05:34:26 -04:00
sudo dnf upgrade --refresh
2015-09-26 19:00:33 -04:00
~~~
2013-12-04 17:15:37 -05:00
2021-06-18 09:58:10 -04:00
This will permanently enable the RPM Fusion repos. If you install software from
here, it's important to keep these repos enabled so that you can receiving
future updates. If you only enable these repos temporarily to install a package
the Qubes update mechanism may persistently notify you that updates are
available, since it cannot download them.
2020-11-03 19:05:02 -05:00
2022-04-20 17:19:04 -04:00
2021-06-18 04:25:09 -04:00
### Reverting changes to a template
2019-09-19 22:44:21 -04:00
2021-06-18 04:25:09 -04:00
Perhaps you've just updated your template, and the update broke your template.
2021-06-18 09:58:10 -04:00
Or perhaps you've made a terrible mistake, like accidentally confirming the
installation of an unsigned package that could be malicious. If you want to
undo changes to a template, there are three basic methods:
2019-09-19 22:44:21 -04:00
1. **Root revert.**
2021-06-18 09:58:10 -04:00
This is appropriate for misconfigurations, but not for security concerns. It
will preserve your customizations.
2019-09-19 22:44:21 -04:00
2. **Reinstall the template.**
2021-06-18 09:58:10 -04:00
This is appropriate for both misconfigurations and security concerns, but
you will lose all customizations.
2019-09-19 22:44:21 -04:00
3. **Full revert.**
2021-06-18 09:58:10 -04:00
This is appropriate for both misconfigurations and security concerns, and it
can preserve your customizations. However, it is a bit more complex.
2019-09-19 22:44:21 -04:00
2022-04-20 17:19:04 -04:00
2020-09-29 09:45:50 -04:00
#### Root revert
2019-09-19 22:44:21 -04:00
2021-06-18 09:58:10 -04:00
**Important:** This command will roll back any changes made *during the last
time the template was run, but **not** before.* This means that if you have
already restarted the template, using this command is unlikely to help, and
you'll likely want to reinstall it from the repository instead. On the other
hand, if the template is already broken or compromised, it won't hurt to try
reverting first. Just make sure to **back up** all of your data and changes
first!
2019-09-19 22:44:21 -04:00
2021-06-18 09:58:10 -04:00
1. Shut down `<template>` . If you've already just shut it down, do **not**
start it again (see above).
2019-09-19 22:44:21 -04:00
2. In a dom0 terminal:
2021-06-18 09:58:10 -04:00
```
qvm-volume revert < template > :root
```
2019-09-19 22:44:21 -04:00
2022-04-20 17:19:04 -04:00
2020-09-29 09:45:50 -04:00
#### Reinstall the template
2019-09-19 22:44:21 -04:00
2021-06-18 04:25:09 -04:00
Please see [How to Reinstall a template ](/doc/reinstall-template/ ).
2019-09-19 22:44:21 -04:00
2022-04-20 17:19:04 -04:00
2020-09-29 09:45:50 -04:00
#### Full revert
2019-09-19 22:44:21 -04:00
This is like the simple revert, except:
2021-06-18 09:58:10 -04:00
- You must also revert the private volume with `qvm-volume revert
< template > :private`. This requires you to have an old revision of the private
volume, which does not exist with the current default config. However, if you
don't have anything important in the private volume (likely for a template),
then you can work around this by just resetting the private volume with
`qvm-volume import --no-resize <template>:private /dev/null` .
2019-09-19 22:44:21 -04:00
2021-06-18 09:58:10 -04:00
- The saved revision of the volumes must be uncompromised. With the default
`revisions_to_keep=1` for the root volume, you must **not** have started the
template since the compromising action.
2019-09-19 22:44:21 -04:00
2014-04-11 06:13:33 -04:00
2019-09-02 05:34:26 -04:00
### Updates proxy
2014-09-05 07:55:59 -04:00
2021-06-18 09:58:10 -04:00
Updates proxy is a service which allows access only from package managers. This
is meant to mitigate user errors (like using browser in the template), rather
than some real isolation. It is done with http proxy (tinyproxy) instead of
simple firewall rules because it is hard to list all the repository mirrors
(and keep that list up to date). The proxy is used only to filter the traffic,
not to cache anything.
The proxy is running in selected VMs (by default all the NetVMs (1)) and
intercepts traffic directed to 10.137.255.254:8082. Thanks to such
configuration all the VMs can use the same proxy address, and if there is a
proxy on network path, it will handle the traffic (of course when firewall
rules allow that). If the VM is configured to have access to the updates proxy
(2), the startup scripts will automatically configure dnf to really use the
proxy (3). Also access to updates proxy is independent of any other firewall
settings (VM will have access to updates proxy, even if policy is set to block
all the traffic).
There are two services (`qvm-service`, [service
framework](/doc/qubes-service/)):
1. `qubes-updates-proxy` (and its deprecated name: `qubes-yum-proxy` ) - a
service providing a proxy for templates - by default enabled in NetVMs
(especially: sys-net)
2. `updates-proxy-setup` (and its deprecated name: `yum-proxy-setup` ) - use a
proxy provided by another VM (instead of downloading updates directly),
enabled by default in all templates
Both the old and new names work. The defaults listed above are applied if the
service is not explicitly listed in the services tab.
2014-09-05 07:55:59 -04:00
2022-04-20 17:19:04 -04:00
2019-09-02 05:34:26 -04:00
#### Technical details
2014-09-05 07:55:59 -04:00
2021-06-18 09:58:10 -04:00
The updates proxy uses RPC/qrexec. The proxy is configured in qrexec policy in
dom0: `/etc/qubes-rpc/policy/qubes.UpdatesProxy` . By default this is set to
sys-net and/or sys-whonix, depending on firstboot choices. This new design
allows for templates to be updated even when they are not connected to any
NetVM.
2014-09-05 07:55:59 -04:00
2021-06-18 09:58:10 -04:00
Example policy file in R4.0 (with Whonix installed, but not set as default
UpdateVM for all templates):
2021-03-13 12:03:23 -05:00
```shell_session
2018-01-28 09:35:59 -05:00
# any VM with tag `whonix-updatevm` should use `sys-whonix`; this tag is added to `whonix-gw` and `whonix-ws` during installation and is preserved during template clone
2019-08-21 18:41:43 -04:00
@tag:whonix -updatevm @default allow,target=sys-whonix
@tag:whonix -updatevm @anyvm deny
2018-01-28 09:35:59 -05:00
# other templates use sys-net
2021-06-18 05:16:40 -04:00
@type:template @default allow,target=sys-net
2019-08-21 18:41:43 -04:00
@anyvm @anyvm deny
2018-01-28 09:35:59 -05:00
```
2022-04-20 17:19:04 -04:00
2020-09-29 09:45:50 -04:00
### Installing Snap Packages
2019-11-14 10:37:13 -05:00
2021-06-18 09:58:10 -04:00
Snap packages do not use the normal update channels for Debian and Fedora (apt
and dnf) and are often installed as the user rather than as root. To support
these in an app qube you need to take the following steps:
1. In the **template** you must install `snapd` and `qubes-snapd-helper` . Open
a terminal in the template and run:
```shell_session
[user@fedora-30-snap-demo ~]$ sudo dnf install snapd qubes-snapd-helper
Last metadata expiration check: 0:55:39 ago on Thu Nov 14 09:26:47 2019.
Dependencies resolved.
========================================================================================================
Package Arch Version Repository Size
========================================================================================================
Installing:
snapd x86_64 2.42.1-1.fc30 updates 17 M
qubes-snapd-helper noarch 1.0.1-1.fc30 qubes-vm-r4.0-current 10 k
Installing dependencies:
[...]
Transaction Summary
========================================================================================================
Install 20 Packages
Total download size: 37 M
Installed size: 121 M
Is this ok [y/N]: y
Downloading Packages:
[..]
Failed to resolve booleanif statement at /var/lib/selinux/targeted/tmp/modules/200/snappy/cil:1174
/usr/sbin/semodule: Failed!
[...]
Last metadata expiration check: 0:57:08 ago on Thu Nov 14 09:26:47 2019.
Notifying dom0 about installed applications
Installed:
snapd-2.42.1-1.fc30.x86_64 qubes-snapd-helper-1.0.1-1.fc30.noarch
[...]
Complete!
```
You may see the following message:
```
Failed to resolve booleanif statement at /var/lib/selinux/targeted/tmp/modules/200/snappy/cil:1174
/usr/sbin/semodule: Failed!
```
This is expected and you can safely continue.
Shutdown the template:
```shell_session
[user@fedora-30-snap-demo ~]$ sudo shutdown -h now
```
2. Now open the **app qube** in which you would like to install the Snap
application and run a terminal:
```shell_session
[user@snap-demo-app qube ~]$ snap install < package >
```
When the install is complete you can close the terminal window.
3. Refresh the Applications list for the app qube. In the Qubes Menu for the
**app qube** * launch the Qube Settings. Then go to the Applications tab and
click "Refresh Applications"
The refresh will take a few minutes; after it's complete the Snap app will
appear in the app qube's list of available applications. At this point the
snap will be persistent within the app qube and will receive updates when
the app qube is running.
2019-11-14 10:37:13 -05:00
2022-04-20 17:19:04 -04:00
2020-09-29 09:45:50 -04:00
### Autostarting Installed Applications
2019-11-26 12:24:35 -05:00
2021-06-18 09:58:10 -04:00
If you want a desktop app to start automatically every time a qube starts you
can create a link to it in the `~/.config/autostart` directory of the **app
qube**. This might be useful for Qubes that you set to automatically start on
boot or for Qubes that have a set of apps you typically use all day, such as a
chat app.
2019-11-26 12:24:35 -05:00
2021-06-18 04:55:53 -04:00
1. Open a terminal in the **app qube** where you would like the app to launch.
2020-03-26 20:00:11 -04:00
2021-06-18 09:58:10 -04:00
2. List the names of the available desktop shortcuts by running the command `ls
/usr/share/applications` and find the exact name of the shortcut to the app
you want to autostart:
```shell_session
[user@example-app qube ~]$ ls /usr/share/applications/
bluetooth-sendto.desktop
eog.desktop
firefox.desktop
...
xterm.desktop
yelp.desktop
```
2020-03-26 20:00:11 -04:00
2019-11-26 12:24:35 -05:00
3. Create the autostart directory:
2020-03-26 20:00:11 -04:00
2021-06-18 09:58:10 -04:00
```
[user@example-app qube ~]$ mkdir -p ~/.config/autostart
```
2020-03-26 20:00:11 -04:00
2021-06-18 09:58:10 -04:00
4. Make a link to the desktop app file you'd like to start in the autostart
directory. For example, the command below will link the Thunderbird app into
the autostart directory:
2020-03-26 20:00:11 -04:00
2021-06-18 09:58:10 -04:00
```
[user@example-app qube ~]$ ln -s /usr/share/applications/mozilla-thunderbird.desktop ~/.config/autostart/mozilla-thunderbird.desktop
```
2019-11-26 12:24:35 -05:00
2021-06-18 09:58:10 -04:00
Note that the app will autostart only when the app qube starts. If you would
like the app qube to autostart, select the "Start qube automatically on boot"
checkbox in the app qube's Qube Settings.