Читать книгу Mastering Linux System Administration - Richard Blum - Страница 113

Real World Scenario INSTALLING FLATPAK

Оглавление

The flatpak container format provides quick installation of many popular application programs. To use flatpak on your CentOS server, you'll need to first install the software package and then install the repository configuration by following these steps:

1 Log onto your CentOS server as the root user account.

2 From the command‐line prompt, enter the command dnf install flatpak. There are lots of dependencies required, so you'll see quite a few packages install.

3 Once flatpak is installed, you will need to point it to a flatpak container repository. The most popular one is Flathub. Configure that by entering the command flatpak remote‐add ‐‐if‐not‐exists flathub https://flathub.org/repo/flathub.flatpakrepo. You should see output that's similar to this:# flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo Note that the directories '/var/lib/flatpak/exports/share' '/root/.local/share/flatpak/exports/share' are not in the search path set by the XDG_DATA_DIRS environment variable, so applications installed by Flatpak may not appear on your desktop until the session is restarted. #

4 Test the flatpak command by entering the command flatpak list.# flatpak list #Not too exciting. When you first install flatpak, there won't be any containers installed, but now you know that flatpak is installed.

To find an application in the flatpak repository, you use the flatpak search command.

# flatpak search mosh Name Description Application ID Version Branch Remotes Mosh The Mobile Shell org.mosh.mosh 1.3.2 stable flathub #

When working with a container, you must use its Application ID value and not its name. To install the application, use the flatpak install command.

# flatpak install org.mosh.mosh Looking for matches… Found similar ref(s) for 'mosh' in remote 'flathub' (system). Use this remote? [Y/n]: y Found ref 'app/org.mosh.mosh/x86_64/stable' in remote 'flathub' (system). Use this ref? [Y/n]: y Required runtime for org.mosh.mosh/x86_64/stable (runtime/org.freedesktop.Platform/x86_64/20.08) found in remote flathub Do you want to install it? [Y/n]: y … Installation complete. #

To check whether the installation went well, you can use the flatpak list command again.

# flatpak list Name Application ID Version Branch Installation Freedesktop Plat… org.freedesktop.Platform 20.08.2 20.08 system default …freedesktop.Platform.GL.default 20.08 system openh264 …g.freedesktop.Platform.openh264 2.1.0 2.0 system Mosh org.mosh.mosh 1.3.2 stable system #

Finally, to remove an application container, use the flatpak uninstall command.

# flatpak uninstall org.mosh.mosh ID Branch Op 1. [-] org.mosh.mosh stable r Uninstall complete. #

Using application containers is similar to using package management systems, but what goes on behind the scenes is fundamentally different. However, the end result is that you have an application installed on your Linux system that can be easily maintained and upgraded.

Mastering Linux System Administration

Подняться наверх