Cyberithub

5 Easy Steps to Install flatpak on Ubuntu 20.04

Advertisements

In this article, I will take you through 5 Easy Steps to Install flatpak on Ubuntu 20.04. Flatpak is a framework for distributing desktop applications across various Linux distributions. It has been created by developers who have a long history of working on the Linux desktop, and is run as an independent open source project. More on Flatpak docs.

5 Easy Steps to Install flatpak on Ubuntu 20.04

Steps to Install flatpak on Ubuntu 20.04

Also Read: 6 Easy Steps to Install Microsoft Edge Browser on Ubuntu 20.04 LTS 

Step 1: Prerequisites

a) You should have a running Ubuntu 20.04 Server.

b) You should have sudo or root access to run privileged commands.

c) You should have apt utility available in your Server.

Step 2: Update Your Server

First we need to synchronize all the installed packages with the latest updates available on Ubuntu Repo by using apt update command as shown below.

root@localhost:~# apt update
Get:1 http://ppa.launchpad.net/micahflee/ppa/ubuntu focal InRelease [17.5 kB]
Hit:2 http://in.archive.ubuntu.com/ubuntu focal InRelease
Get:3 http://in.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Hit:4 https://packages.microsoft.com/repos/edge stable InRelease
Get:5 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4E72F77D7D158F33
Get:6 http://in.archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
Get:7 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 DEP-11 Metadata [274 kB]
Get:8 http://in.archive.ubuntu.com/ubuntu focal-updates/universe amd64 DEP-11 Metadata [323 kB]
Get:9 http://in.archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 DEP-11 Metadata [2,468 B]
Get:10 http://in.archive.ubuntu.com/ubuntu focal-backports/universe amd64 DEP-11 Metadata [1,768 B]
Get:11 http://security.ubuntu.com/ubuntu focal-security/main amd64 DEP-11 Metadata [24.4 kB]
Get:12 http://security.ubuntu.com/ubuntu focal-security/universe amd64 DEP-11 Metadata [58.3 kB]
Get:13 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 DEP-11 Metadata [2,464 B]
Reading package lists... Done

 

Step 3: Install flatpak

After successful update, you can install flatpak utility using apt install flatpak command as shown below.

root@localhost:~# apt install flatpak
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
libatomic1
Use 'apt autoremove' to remove it.
The following additional packages will be installed:
libappstream-glib8 libostree-1-1
The following NEW packages will be installed:
flatpak libappstream-glib8 libostree-1-1
0 upgraded, 3 newly installed, 0 to remove and 145 not upgraded.
Need to get 1,483 kB of archives.
After this operation, 6,988 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://in.archive.ubuntu.com/ubuntu focal/main amd64 libappstream-glib8 amd64 0.7.16-1ubuntu1 [135 kB]
Get:2 http://in.archive.ubuntu.com/ubuntu focal/universe amd64 libostree-1-1 amd64 2020.3-1 [280 kB]
Get:3 http://in.archive.ubuntu.com/ubuntu focal-updates/universe amd64 flatpak amd64 1.6.5-0ubuntu0.3 [1,068 kB]
Fetched 1,483 kB in 1s (1,537 kB/s)
Selecting previously unselected package libappstream-glib8:amd64.
(Reading database ... 187945 files and directories currently installed.)

 

Step 4: Adding Flatpak Repo

Flatpak installs all the packages from flathub repo so we need to first add the repo using flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo command as shown below. Once added, you are now good to go for new packages installation.

root@localhost:~# flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

 

Step 5: Install OpenJDK 8 using flatpak

If you want to install any of the packages from flathub using flatpak utility then first search that package using flatpak search <package_name> and then install it by using flatpak install <ApplicationID> . Here we will install OpenJDK 8 as an example. So we will first search this package by using flatpak search openjdk command as shown below.

root@localhost:~# flatpak search openjdk
Name                        Description                                                    Application ID                          Version     Branch Remotes
OpenJDK SDK Extension       The latest version of the OpenJDK JRE and JDK                  org.freedesktop.Sdk.Extension.openjdk               20.08  flathub
OpenJDK SDK Extension       The latest version of the OpenJDK JRE and JDK                  org.freedesktop.Sdk.Extension.openjdk               19.08  flathub
OpenJDK SDK Extension       The latest version of the OpenJDK JRE and JDK                  org.freedesktop.Sdk.Extension.openjdk               18.08  flathub
OpenJdk 8 Sdk extension     OpenJdk 8 Sdk extension                                        org.freedesktop.Sdk.Extension.openjdk8              20.08  flathub
OpenJdk 8 Sdk extension     OpenJdk 8 Sdk extension                                        org.freedesktop.Sdk.Extension.openjdk8              19.08  flathub
OpenJDK 11 SDK Extension    The LTS (long term support) version of the OpenJDK JRE and JDK org.freedesktop.Sdk.Extension.openjdk11             20.08  flathub
OpenJDK 11 SDK Extension    The LTS (long term support) version of the OpenJDK JRE and JDK org.freedesktop.Sdk.Extension.openjdk11             19.08  flathub
OpenJDK 11 SDK Extension    The LTS (long term support) version of the OpenJDK JRE and JDK org.freedesktop.Sdk.Extension.openjdk11             18.08  flathub

Once we have the appropriate OpenJDK 8 located then we can use flatpak install org.freedesktop.Sdk.Extension.openjdk8 command to install this package as shown below.

root@localhost:~# flatpak install org.freedesktop.Sdk.Extension.openjdk8
Looking for matches…
Found similar ref(s) for ‘org.freedesktop.Sdk.Extension.openjdk8’ in remote ‘flathub’ (system).
Use this remote? [Y/n]: y
Similar refs found for ‘org.freedesktop.Sdk.Extension.openjdk8’ in remote ‘flathub’ (system):

1) runtime/org.freedesktop.Sdk.Extension.openjdk8/x86_64/20.08
2) runtime/org.freedesktop.Sdk.Extension.openjdk8/x86_64/1.6
3) runtime/org.freedesktop.Sdk.Extension.openjdk8/x86_64/18.08
4) runtime/org.freedesktop.Sdk.Extension.openjdk8/x86_64/19.08

Which do you want to use (0 to abort)? [0-4]: 1


ID Branch Op Remote Download
1. [✓] org.freedesktop.Sdk.Extension.openjdk8 20.08 i flathub 278.4 MB / 281.2 MB

Installation complete.

Leave a Comment