Linux Tutorial

Installing Applications via Flatpak and Toolbox on Fedora Silverblue

9views

Fedora Silverblue is an immutable desktop operating system that takes a fundamentally different approach to traditional Linux distributions. Instead of a mutable filesystem where packages can be freely installed and modified, Silverblue uses an image-based system powered by rpm-ostree.

Why Immutable Matters

The immutable nature of Silverblue provides several key advantages:

  • Stability: The core operating system remains unchanged, reducing the risk of system breakage
  • Reliability: Each system installation is identical, making issues more predictable and reproducible
  • Rollback capability: If an update causes problems, you can easily revert to the previous system state
  • Security: The read-only root filesystem limits the attack surface for malicious software

The Three-Tier Application Strategy

On Silverblue, applications are installed using three primary methods:

  1. Flatpak: For GUI applications (recommended primary method)
  2. Toolbox: For command-line tools and development environments
  3. rpm-ostree layering: For system-level packages (drivers, virtualization tools)

This guide focuses on the first two methods, which represent the modern approach to application management on immutable systems.


Understanding Flatpak {#understanding-flatpak}

What is Flatpak?

Flatpak is a universal packaging format that allows developers to distribute applications independently of the host system. Each Flatpak application runs in a sandbox, isolated from the rest of your system.

Key Benefits

  • Sandboxing: Applications run in isolated environments with controlled permissions
  • Distribution-agnostic: The same Flatpak works across different Linux distributions
  • Multiple versions: Install different versions of the same application simultaneously
  • Dependency management: Applications bundle their dependencies, avoiding conflicts
  • Automatic updates: Applications can be updated independently of the system

How Flatpak Works

Flatpak applications consist of two components:

  1. Runtimes: Shared libraries and frameworks (e.g., GNOME Platform, KDE Platform)
  2. Applications: The actual program files and app-specific dependencies

When you install a Flatpak app, the runtime is downloaded once and shared among all apps that use it, saving disk space.


Understanding Toolbox {#understanding-toolbox}

What is Toolbox?

Toolbox is a containerization utility built on top of Podman that creates mutable, containerized command-line environments. It provides a familiar package-based environment where tools and libraries can be installed using traditional package managers like DNF.

Key Benefits

  • Familiar environment: Use DNF to install packages just like on traditional Fedora
  • System isolation: Keep the host system clean while having full development capabilities
  • Multiple environments: Create separate containers for different projects or workflows
  • Home directory access: Seamless access to your files and projects
  • GUI support: Run graphical applications from within containers

When to Use Toolbox

Use Toolbox for:

  • Command-line development tools (compilers, interpreters, build tools)
  • Legacy applications not available as Flatpaks
  • Testing and experimentation without affecting the host system
  • Creating project-specific development environments

Setting Up Flatpak {#setting-up-flatpak}

Prerequisites

Flatpak comes pre-installed on Fedora Silverblue. To verify installation:

bash
flatpak --version

You should see output similar to:

Flatpak 1.15.4

Adding the Flathub Repository

Flathub is the primary repository for Flatpak applications, hosting thousands of apps. By default, Silverblue includes only the Fedora Flatpak repository, which has a limited selection.

Method 1: Using the Flathub Website (Recommended for Beginners)

  1. Visit the Flathub setup page: https://flatpak.org/setup/Fedora
  2. Click the “Flathub repository file” button
  3. When prompted, select “Open with Software Install (default)”
  4. Click “OK” to download
  5. A new window will open showing the Flathub repository
  6. Click “Install” to add the repository

Method 2: Using the Command Line

Open a terminal and run:

bash
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

The --if-not-exists flag ensures the command won’t fail if Flathub is already configured.

Verifying Repository Setup

Check your configured remotes:

bash
flatpak remotes

Expected output:

Name     Options
fedora   system,oci
flathub  system

You should see both the Fedora registry and Flathub listed.


Installing Applications with Flatpak {#installing-flatpak}

Method 1: Using GNOME Software (GUI)

This is the easiest method for beginners:

  1. Open the “Software” application from your application menu
  2. On first launch, wait a few minutes for the app to scan available applications
  3. Use the search icon (magnifying glass) in the top-left to search for applications
  4. Click on your desired application to view details
  5. Click the “Install” button in the top-right corner
  6. Wait for the installation to complete

The application will now appear in your application menu.

Method 2: Using the Command Line

Searching for Applications

To search for an application:

bash
flatpak search <application-name>

Example:

bash
flatpak search firefox

Output:

Name                Description                              Application ID                     Version Branch Remotes
Firefox             Fast, Private & Safe Web Browser         org.mozilla.firefox                ...     stable flathub

Installing an Application

To install an application from Flathub:

bash
flatpak install flathub <application-id>

Example:

bash
flatpak install flathub org.mozilla.firefox

The command will:

  1. Download the required runtime (if not already installed)
  2. Download the application
  3. Set up the sandbox environment

When prompted, type y and press Enter to confirm.

Installing Multiple Applications

You can install multiple apps in a single command:

bash
flatpak install flathub org.mozilla.firefox org.gimp.GIMP org.videolan.VLC

Listing Installed Applications

View all installed Flatpaks:

bash
flatpak list

To see only applications (not runtimes):

bash
flatpak list --app

Updating Applications

Update all Flatpak applications:

bash
flatpak update

Update a specific application:

bash
flatpak update org.mozilla.firefox

Removing Applications

Uninstall an application:

bash
flatpak uninstall org.mozilla.firefox

Remove unused runtimes and dependencies:

bash
flatpak uninstall --unused

Running Applications

From the Application Menu

Installed Flatpaks appear automatically in your desktop application launcher.

From the Command Line

bash
flatpak run org.mozilla.firefox

Managing Flatpak Permissions {#managing-permissions}

Flatpak applications run in sandboxes with restricted access to system resources. Understanding and managing these permissions is crucial for both security and functionality.

Understanding Permission Categories

Flatpak permissions are organized into several categories:

  • Shares: Home directory access, network access
  • Sockets: Display server (X11/Wayland), sound server (PulseAudio/PipeWire)
  • Devices: Hardware access (webcam, microphone, GPU)
  • Filesystem: Specific directory access
  • Features: Background running, notifications, system tray
  • Bus access: D-Bus system and session access

Viewing Application Permissions

Check permissions for a specific application:

bash
flatpak info --show-permissions org.mozilla.firefox

Overriding Permissions via Command Line

Grant additional permissions:

bash
flatpak override --user --filesystem=~/Documents org.mozilla.firefox

Common permission overrides:

bash
# Allow access to the entire home directory
flatpak override --user --filesystem=home org.mozilla.firefox

# Allow network access
flatpak override --user --share=network org.mozilla.firefox

# Disable network access
flatpak override --user --unshare=network org.mozilla.firefox

# Allow Wayland access
flatpak override --user --socket=wayland org.mozilla.firefox

# Allow specific directory access
flatpak override --user --filesystem=/media org.mozilla.firefox

Resetting Permissions

Reset application permissions to defaults:

bash
flatpak override --user --reset org.mozilla.firefox

Using Flatseal (GUI Permission Manager)

Flatseal provides a graphical interface for managing Flatpak permissions, making it much easier than using command-line overrides.

Installing Flatseal

bash
flatpak install flathub com.github.tchx84.Flatseal

Using Flatseal

  1. Launch Flatseal from your application menu
  2. Select an application from the left sidebar
  3. View all permissions on the right panel
  4. Toggle permissions on/off using the switches
  5. Modify filesystem access paths directly
  6. Click the “Reset” button to restore defaults if needed

Key Flatseal Features

  • Visual overview: See all permissions at a glance
  • Easy toggles: Enable/disable permissions with simple switches
  • Custom paths: Add specific directories for filesystem access
  • Batch operations: Apply global overrides to all applications
  • Change highlighting: Modified settings are highlighted
  • Risk-free testing: Reset button restores defaults instantly

Setting Up Toolbox {#setting-up-toolbox}

Prerequisites

Toolbox comes pre-installed on Fedora Silverblue. Verify installation:

bash
toolbox --version

If not installed (on older Silverblue versions):

bash
sudo rpm-ostree install toolbox
sudo systemctl reboot

Understanding Toolbox Containers

Toolbox containers are lightweight, mutable environments that:

  • Share your home directory with the host
  • Use the same username and user ID
  • Have access to the display server (for GUI apps)
  • Can communicate with system services via D-Bus
  • Support sudo for package installation

Creating Your First Toolbox

Create a default toolbox based on your Fedora version:

bash
toolbox create

When prompted, type y to download the base image (approximately 500MB).

The default container name follows the pattern: fedora-toolbox-<version>

For example, on Fedora 40:

Created container: fedora-toolbox-40
Enter with: toolbox enter

Creating Named Toolboxes

Create a toolbox with a custom name:

bash
toolbox create --container myproject

Or using the shorthand:

bash
toolbox create -c myproject

Creating Toolboxes for Different Fedora Versions

Create a toolbox for a specific Fedora release:

bash
toolbox create --release 39 --container fedora39-env

Shorthand:

bash
toolbox create -r 39 -c fedora39-env

This is useful when:

  • You need older package versions
  • Testing compatibility with different Fedora releases
  • Working with legacy software

Creating Toolboxes for Different Distributions

While Toolbox primarily supports Fedora and RHEL, you can use custom images:

bash
toolbox create --image registry.fedoraproject.org/fedora-toolbox:38 -c custom-env

Listing Toolbox Containers

View all toolboxes and their status:

bash
toolbox list

Example output:

IMAGE ID      IMAGE NAME                                    CREATED
e6d38a7d896c  registry.fedoraproject.org/fedora-toolbox:40  2 weeks ago

CONTAINER ID  CONTAINER NAME      CREATED        STATUS   IMAGE NAME
94a91110021a  fedora-toolbox-40   4 days ago     running  registry.fedoraproject.org/fedora-toolbox:40
f91f8b4a3a51  myproject           2 days ago     running  registry.fedoraproject.org/fedora-toolbox:40

List only containers (not images):

bash
toolbox list -c

List only images:

bash
toolbox list -i

Working with Toolbox Containers {#working-toolbox}

Entering a Toolbox

Enter the default toolbox:

bash
toolbox enter

Enter a named toolbox:

bash
toolbox enter myproject

Your prompt will change to indicate you’re inside the container:

⬢[username@toolbox ~]$

The symbol indicates you’re in a toolbox environment.

Installing Packages Inside Toolbox

Once inside a toolbox, use DNF as you would on traditional Fedora:

bash
# Update package lists
sudo dnf update

# Install development tools
sudo dnf install gcc make git vim

# Install Python development tools
sudo dnf install python3-devel python3-pip

# Install Node.js
sudo dnf install nodejs npm

# Install Java development kit
sudo dnf install java-latest-openjdk-devel

Note: You can use sudo without entering a password inside toolboxes.

Running Commands Without Entering

Execute a command in a toolbox without starting an interactive shell:

bash
toolbox run gcc --version

Run a command in a specific toolbox:

bash
toolbox run -c myproject python3 script.py

This is useful for:

  • Quick command execution
  • Scripting and automation
  • CI/CD pipelines

Exiting a Toolbox

Leave the toolbox and return to the host:

bash
exit

Or press Ctrl+D.

File System Access

Your home directory is shared between the host and all toolboxes:

bash
# Inside toolbox
cd ~/Documents
ls
# You'll see the same files as on your host system

Files created in your home directory inside a toolbox are immediately accessible on the host and vice versa.

Running GUI Applications from Toolbox

Toolbox containers can run graphical applications that appear on your desktop:

  1. Enter your toolbox:
bash
toolbox enter
  1. Install a GUI application:
bash
sudo dnf install gedit
  1. Run the application:
bash
gedit &

The application window will appear on your Silverblue desktop as if it were running natively.

Example: Setting Up a Development Environment

Here’s a complete example of setting up a Python development environment:

bash
# Create a dedicated toolbox for Python development
toolbox create -c python-dev

# Enter the toolbox
toolbox enter python-dev

# Install Python development tools
sudo dnf install python3-devel python3-pip python3-virtualenv

# Install additional tools
sudo dnf install git vim tmux

# Install Python packages
pip3 install --user flask django requests pandas numpy

# Create a project directory
mkdir ~/projects/myapp
cd ~/projects/myapp

# Initialize a git repository
git init

# Exit the toolbox
exit

Now you have a dedicated Python development environment that doesn’t affect your host system.

Example: Setting Up a Java Development Environment

bash
# Create a Java development toolbox
toolbox create -c java-dev

# Enter the toolbox
toolbox enter java-dev

# Install Java JDK and Maven
sudo dnf install java-latest-openjdk-devel maven

# Verify installation
java -version
mvn -version

# Install IntelliJ IDEA Community Edition (optional)
sudo dnf install intellij-idea-community

# Exit
exit

Advanced Toolbox Usage {#advanced-toolbox}

Creating Project-Specific Toolboxes

Best practice: Create separate toolboxes for different projects or workflows:

bash
# Web development environment
toolbox create -c webdev
toolbox enter webdev
sudo dnf install nodejs npm yarn httpd

# Data science environment
toolbox create -c datascience
toolbox enter datascience
sudo dnf install python3-pip python3-scipy python3-matplotlib jupyter-notebook

# System administration toolbox
toolbox create -c sysadmin
toolbox enter sysadmin
sudo dnf install ansible terraform kubectl

Removing Toolboxes

Delete a toolbox you no longer need:

bash
toolbox rm myproject

Or use the full name:

bash
toolbox rm -f fedora-toolbox-40

The -f flag forces removal without confirmation.

Managing Toolbox Storage

Toolbox containers consume disk space. To see storage usage:

bash
# Check all podman containers (toolbox uses podman)
podman system df

Remove unused images:

bash
podman image prune -a

Toolbox vs Distrobox

While Toolbox is the default on Silverblue, Distrobox offers more flexibility:

  • Toolbox: Best for Fedora/RHEL ecosystems, officially supported
  • Distrobox: Supports more distributions (Ubuntu, Arch, Alpine, etc.)

If you need Ubuntu or other distributions, consider installing Distrobox:

bash
curl -s https://raw.githubusercontent.com/89luca89/distrobox/main/install | sh -s -- --prefix ~/.local

Accessing Removable Media

Toolboxes have access to removable media mounted on the host:

bash
# Inside toolbox
ls /run/media/$USER/

Network Access in Toolboxes

Toolboxes share the host’s network stack, so networking works seamlessly:

bash
# Inside toolbox
curl https://example.com
ping google.com

Using systemd Services in Toolboxes

Toolboxes can interact with systemd on the host:

bash
# Inside toolbox
systemctl --user status

Troubleshooting Common Issues {#troubleshooting}

Flatpak Issues

Issue: “No remote refs found”

Symptom: Cannot find applications when searching Flathub.

Solution: Ensure Flathub repository is properly added:

bash
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak update --appstream

Issue: Application won’t start

Symptom: Application crashes or shows blank window.

Solution:

  1. Check if the application has necessary permissions
  2. Try resetting the application:
bash
flatpak repair --user
flatpak run --reset org.mozilla.firefox

Issue: Wayland applications showing blank screen

Symptom: Applications don’t display correctly on Wayland.

Solution: Grant Wayland socket access:

bash
flatpak override --user --socket=wayland org.example.app

Or use Flatseal to enable Wayland in the Sockets section.

Issue: Cannot access files in specific directories

Symptom: Application can’t open or save files.

Solution: Grant filesystem access:

bash
flatpak override --user --filesystem=~/Documents org.example.app

Or use Flatseal to add the directory in the Filesystem section.

Issue: Firefox won’t play videos

Symptom: Video playback fails in Flatpak Firefox.

Solution: Use the Flathub Firefox instead of the system version, as it includes necessary codecs:

bash
flatpak install flathub org.mozilla.firefox

Toolbox Issues

Issue: “Command not found” after installing package

Symptom: After installing a package, the command isn’t recognized.

Solution: Ensure you’re inside the toolbox:

bash
toolbox enter
which <command-name>

Issue: Cannot create toolbox

Symptom: Toolbox creation fails with network errors.

Solution:

  1. Check internet connection
  2. Try using a different mirror:
bash
toolbox create --distro fedora --release 40

Issue: Slow toolbox performance

Symptom: Commands run slowly inside toolbox.

Solution:

  1. Check if your home directory has many files (toolbox mounts it)
  2. Create a toolbox with less mounted directories:
bash
toolbox create --home /tmp/toolbox-home -c minimal

Issue: GUI apps won’t start from toolbox

Symptom: Graphical applications fail to launch.

Solution: Ensure D-Bus and display server access:

bash
# Inside toolbox
echo $DISPLAY
echo $DBUS_SESSION_BUS_ADDRESS

# If empty, exit and re-enter the toolbox
exit
toolbox enter

Issue: Toolbox image download fails

Symptom: Image download times out or fails.

Solution: Try downloading manually with podman:

bash
podman pull registry.fedoraproject.org/fedora-toolbox:40
toolbox create -c myenv

General Silverblue Issues

Issue: Running out of disk space

Solution: Clean up unused Flatpaks and containers:

bash
# Remove unused Flatpaks
flatpak uninstall --unused

# Clean Podman storage
podman system prune -a

# Check available space
df -h /

Issue: Updates taking too long

Solution: Silverblue updates the entire image, which can be large. Ensure you have good internet and patience. Update in stages:

bash
# Update base system
rpm-ostree update

# Update Flatpaks separately
flatpak update

Conclusion

Fedora Silverblue’s approach to application management through Flatpak and Toolbox represents a paradigm shift in Linux desktop computing. This guide has covered:

  1. Flatpak: The primary method for installing GUI applications with sandboxing and isolation
  2. Toolbox: Creating mutable containerized environments for development and CLI tools
  3. Permission Management: Controlling application access using Flatseal and command-line tools
  4. Best Practices: Organizing toolboxes by project, managing permissions carefully, and maintaining system cleanliness

Key Takeaways

  • Use Flatpak for GUI applications whenever possible
  • Create project-specific Toolboxes to keep environments organized
  • Manage Flatpak permissions carefully using Flatseal
  • Avoid layering packages with rpm-ostree unless absolutely necessary
  • Regular cleanup of unused Flatpaks and toolboxes saves disk space

Next Steps

  1. Explore the Flathub repository for thousands of available applications
  2. Create toolboxes for your specific development needs
  3. Join the Fedora Silverblue community for support and updates
  4. Experiment with different toolbox configurations

Additional Resources

Happy computing on Fedora Silverblue!

Thank you for visiting our website, TechsBucket. If you liked the article, then share it with others.

Leave a Response