Installing Flox from its repository on Debian and Red Hat
This document describes a practical method for installing Flox from its repositories. Depending on your requirements, this approach may make it easier to create and manage scripts to install Flox on local systems or build it into containers. In addition, systems configured using this method will receive Flox updates as they are released.
Note
When you download and install a Flox .deb or .rpm package,
the installer performs these steps for you.
But you can easily script the steps below to automate this process.
These instructions cover the process of installing from Flox's repository
on modern Debian- and Red Hat-based Linux distributions,
such as Ubuntu and Linux Mint (Debian),
or Fedora, RHEL, and Rocky Linux (Red Hat).
They also include an alternate method for installing Flox on Linux systems,
such as older versions of CentOS,
where yum is the default package manager.
Installation overview
Adding Flox's repository to a Debian- or Red Hat-based Linux system's sources involves the following steps:
- Importing Flox's GPG keys to verify authenticity;
- Configuring the system's package manager to recognize Flox's repository; and
- Installing Flox.
Debian-based systems
To perform these steps on a Debian-based distribution using apt,
do the following.
First, download Flox's GPG keyring to /usr/share/keyrings/.
wget -qO - https://downloads.flox.dev/by-env/stable/deb/flox-archive-keyring.gpg | sudo tee /usr/share/keyrings/flox-archive-keyring.gpg >/dev/null
Next, add the Flox repository to /etc/apt/sources.list.d/flox.list,
pinning it to the keyring you just downloaded.
echo "deb [signed-by=/usr/share/keyrings/flox-archive-keyring.gpg] https://downloads.flox.dev/by-env/stable/deb/ stable/" | sudo tee /etc/apt/sources.list.d/flox.list >/dev/null
Finally, update and install Flox.
Note
These instructions use the modern signed-by method,
which binds the GPG key to only the Flox repository.
If you are running an end-of-life release
(Debian 9 or earlier, Ubuntu 18.04 or earlier)
that does not support signed-by,
see the Debian SecureApt wiki
for the legacy trusted.gpg.d approach.
Red Hat-based systems
To perform these steps on modern Red Hat-based distributions
that use dnf, do the following.
First, download Flox's GPG keyring.
Next, add Flox's repository to /etc/yum.repos.d/flox.repo.
Finally, install Flox.
Installing from Flox's repository using yum
In CentOS 8 and later,
as with Fedora, RHEL, Rocky Linux, and other modern Red Hat-based systems,
dnf is the default package manager.
However, CentOS 7 and earlier ship with yum as the default,
and dnf is not available.
Since dnf is not available on those systems,
the method described above won't work.
This section describes an alternative method
for installing from Flox's repository using rpm and yum.
Note
Even though the method outlined here deals specifically
with older versions of CentOS,
it should also work on any Red Hat-based distribution
for which yum is the default.
To install Flox from its repository using yum, do the following.
First, download and import Flox's GPG key.
Next, configure the Flox repository and install Flox with yum.
Removing the Flox repository
To remove Flox's repository from a Linux system's sources, do the following.
Removing on Debian-based systems
By default, the Flox repository's source list is in
/etc/apt/sources.list.d/flox.list.
However, you can double-check this by running the following command:
Once you've confirmed the existence and location of this file, delete it along with the GPG keyring.
Finally, update your package list.
Note
If you originally installed Flox via the .deb package
rather than following these manual steps,
the repository file may be named flox.sources
(DEB822 format) instead of flox.list.
Use the grep command above to verify the actual filename.
Removing on Red Hat-based systems
By default, the Flox repository's source list is in
/etc/yum.repos.d/flox.repo.
However, you can double-check this by running the following command:
Delete the flox.repo file from /etc/yum.repos.d/.
Finally, clean the dnf cache.