/
usb-drives.rst
74 lines (54 loc) · 3.17 KB
/
usb-drives.rst
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
USB Drives
==========
One can distribute flatpaks along with their dependencies on USB drives (or
network shares, etc.) which is especially helpful in situations where Internet
access is limited or non-existent.
For offline distribution to work there are a few prerequisites:
- the remote repositories providing the app or any of its dependencies must
utilize GPG signatures
- the remote repos must all have a collection ID set on the server side
- the locally configured remotes must have a collection ID set (on the client
side)
- the relevant remotes must be configured on the receiving computer (the one
installing from the drive)
Apps can then be copied to USB drives using `the flatpak create-usb command
<https://docs.flatpak.org/en/latest/flatpak-command-reference.html#flatpak-create-usb>`_.
You can refer to `this blog
post <https://blogs.gnome.org/mclasen/2018/08/26/about-flatpak-installations/>`__
for an introduction.
For example, if you want to put Gedit on a USB drive:
1. First identify the Application ID using ``flatpak list --app``.
In the case of Gedit it is ``org.gnome.gedit``. Use ``flatpak info -o
org.gnome.gedit`` to determine the origin remote. For example that may be
``flathub``.
2. Ensure the origin remote has a collection ID set by using ``flatpak remotes
-d`` and checking the "Collection ID" column. If not, configure one with
e.g. ``flatpak remote-modify --collection-id=org.flathub.Stable flathub``.
If any dependencies come from other remotes, those will also need a
collection ID configured.
3. Next, use the ``df`` command to identify the mount point for the USB
drive. It may be something like ``/media/user/FLATPAKS``.
4. Now copy the flatpak and its dependencies to the drive::
$ flatpak create-usb /media/user/FLATPAKS org.gnome.gedit
5. Wait for the copying process to complete, at which point you should get a
command prompt (``$``). This process can take tens of minutes especially if
the USB drive and USB port aren't USB 3.0+. Then unmount the drive before
removing it::
$ umount /media/user/FLATPAKS
The process for installing from such a USB drive (for example on an offline
machine) differs between Flatpak versions before 1.8.0 and those after. With
earlier versions you can simply use the ``flatpak install`` command as you
normally would online::
$ flatpak install flathub org.gnome.gedit
For versions after 1.8.0, if your linux
distribution has packaged `the relevant systemd units
<https://github.com/flatpak/flatpak/tree/main/sideload-repos-systemd>`__,
using ``flatpak install`` with no extra arguments still works. Otherwise, you
can use the ``--sideload-repo`` option in your command invocation::
$ flatpak install --sideload-repo=/media/user/FLATPAKS/.ostree/repo flathub org.gnome.gedit
The ``flatpak update`` command also accepts a ``--sideload-repo`` option.
Alternatively, it's possible to specify sideload sources using symbolic links
placed in system-wide or user-specific directories and such sources will then
be used for all Flatpak operations without the need for a ``--sideload-repo``
option. See `the flatpak man page
<https://docs.flatpak.org/en/latest/flatpak-command-reference.html#flatpak>`__.