You want to install Firefox on Ubuntu. You open the terminal and discover you can install it three different ways:
sudo apt install firefox
sudo snap install firefox
flatpak install flathub org.mozilla.firefox
Three commands, three package managers, same app. But they’re not the same — each one installs Firefox differently, takes different amounts of disk space, updates differently, and breaks in different ways.
If you’re confused about which one to use, you’re not alone. This guide explains the practical differences, when each one breaks, and how to fix the most common errors for all three.
The Quick Answer: Which One Should You Use?
| Package Manager | Best For | Avoid For |
|---|---|---|
| apt | System tools, CLI apps, development libraries | Desktop apps that need latest versions |
| Flatpak | Desktop GUI apps (Firefox, Spotify, Discord, GIMP) | System utilities, CLI tools |
| Snap | Apps only available as Snap (some Canonical tools) | Anything available via apt or Flatpak |
The general rule: Use apt for everything system-related, Flatpak for desktop apps from Flathub, and Snap only as a last resort.
Why not Snap first? Performance. Snap apps are noticeably slower to launch because they use a compressed filesystem that must be decompressed on every startup. This is well-documented and is the main reason Linux Mint removed Snap support entirely.
How Each One Works (30-Second Explanation)
apt (Advanced Package Tool)
- Installs
.debpackages from Ubuntu/Debian repositories - Packages share system libraries (small install size)
- Deeply integrated with the OS
- Updates via
sudo apt update && sudo apt upgrade
Snap (Canonical)
- Bundles the app + all dependencies in one container
- Runs in a sandbox isolated from the system
- Auto-updates in the background (you can’t fully control this)
- All packages come from the Snap Store (centralized, run by Canonical)
Flatpak (Freedesktop.org)
- Similar to Snap — bundles app + dependencies
- Also sandboxed, but with better permission controls
- Packages from Flathub (community-run, decentralized)
- Manual updates:
flatpak update
Common apt Errors and Fixes
Error: “Broken packages” or “Unmet dependencies”
sudo apt install some-package
E: Unable to correct problems, you have held broken packages.
Why: Package dependencies conflict. Usually happens after adding third-party PPAs or after a partial upgrade.
Fix:
sudo dpkg --configure -a
sudo apt --fix-broken install
sudo apt clean
sudo apt update
sudo apt upgrade
If it persists, identify the problematic PPA:
sudo apt-add-repository --list
Remove any suspicious PPA and update:
sudo apt-add-repository --remove ppa:problematic/ppa
sudo apt update
Error: “Could not get lock /var/lib/dpkg/lock”
This means another process is using apt. We have a dedicated guide for this error — check it out for 6 step-by-step methods.
Error: “Hash sum mismatch” during apt update
W: Failed to fetch ... Hash Sum mismatch
Why: Corrupted package cache or a mirror sync issue.
Fix:
sudo rm -rf /var/lib/apt/lists/*
sudo apt clean
sudo apt update
Common Snap Errors and Fixes
Problem: Snap Apps Take 5-10 Seconds to Open
This is Snap’s most common complaint. The first launch decompresses the SquashFS image, which is slow.
Fix — Option A: Pre-seed the Snap by connecting desktop interfaces:
sudo snap connect app-name:desktop
sudo snap connect app-name:desktop-legacy
Fix — Option B (Recommended): Switch to the Flatpak version of the same app. For example, replace Snap Firefox with Flatpak Firefox:
sudo snap remove firefox
flatpak install flathub org.mozilla.firefox
Flatpak apps launch significantly faster than their Snap counterparts.
Error: “snap has no updates available” but app is outdated
Snap auto-updates, but sometimes gets stuck.
Fix: Force a refresh:
sudo snap refresh app-name
Or refresh all snaps:
sudo snap refresh
Error: “cannot perform the following tasks: Mount snap”
Why: Corrupted Snap package.
Fix:
sudo snap remove app-name
sudo snap install app-name
Problem: Snap Apps Can’t Access Files on External Drives
Snap’s sandbox is very restrictive. Apps can’t see /media/, /mnt/, or USB drives by default.
Fix: Grant removable media access:
sudo snap connect app-name:removable-media
For home directory access:
sudo snap connect app-name:home
Problem: Snap Eating Too Much Disk Space
Snap keeps old versions of every app (usually 3 revisions).
Fix — Clean old revisions:
snap list --all | awk '/disabled/{print $1, $3}' |
while read name rev; do
sudo snap remove "$name" --revision="$rev"
done
Set retention to 2 revisions (minimum):
sudo snap set system refresh.retain=2
Common Flatpak Errors and Fixes
Problem: Flatpak App Doesn’t Match System Theme
Your GTK/Qt apps look “off” — wrong colors, wrong fonts, different widget style compared to native apps.
Why: Flatpak apps run in a sandbox and don’t automatically inherit your system’s GTK theme.
Fix: Install your theme as a Flatpak runtime. For example, if you use the Adwaita-dark theme:
flatpak install flathub org.gtk.Gtk3theme.Adwaita-dark
For other themes, search Flathub for your theme name:
flatpak search gtk3theme
Then set the theme globally:
sudo flatpak override --env=GTK_THEME=Adwaita-dark
Problem: Flatpak App Can’t Access Files Outside ~/
By default, Flatpak apps can only access your home directory.
Fix — Grant access to a specific folder:
flatpak override --user --filesystem=/path/to/folder app-id
Fix — Grant full filesystem access (less secure):
flatpak override --user --filesystem=host app-id
Find the app ID with:
flatpak list --app
Error: “error: No remote refs found similar to ‘flathub’”
Why: Flathub repository not configured.
Fix: Add Flathub:
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
Problem: Flatpak Runtimes Using Too Much Disk Space
Flatpak shares runtimes between apps (e.g., GNOME Platform 45), but unused runtimes accumulate.
Fix:
flatpak uninstall --unused
This removes runtimes that no installed app requires. Safe to run regularly.
Comparison Table: Error Types by Package Manager
| Issue | apt | Snap | Flatpak |
|---|---|---|---|
| Slow app startup | ❌ Not an issue | ⚠️ Very common | ❌ Not an issue |
| Dependency conflicts | ⚠️ Common with PPAs | ❌ Not an issue | ❌ Not an issue |
| Theme mismatch | ❌ Not an issue | ⚠️ Sometimes | ⚠️ Common |
| Can’t access USB drives | ❌ Not an issue | ⚠️ Default blocked | ⚠️ Default blocked |
| Disk space usage | ✅ Minimal | ⚠️ High (old revisions) | ⚠️ Moderate (runtimes) |
| Auto-updates | ❌ Manual | ✅ Automatic | ❌ Manual |
| App availability | ⚠️ Limited to repos | ✅ Large store | ✅ Large store (Flathub) |
| Sandboxing/security | ❌ None | ✅ Strong | ✅ Strong (with portals) |
How to Check Which Version of an App You Have Installed
If you’re not sure whether an app was installed via apt, Snap, or Flatpak:
# Check apt
dpkg -l | grep app-name
# Check Snap
snap list | grep app-name
# Check Flatpak
flatpak list | grep app-name
If the app shows up in multiple results, you have duplicate installations. Remove the one you don’t want to save disk space and avoid confusion about which version opens by default.
Frequently Asked Questions
Should I use apt, Snap, or Flatpak to install apps on Ubuntu?
Use apt for system tools and CLI utilities (like git, curl, build-essential). Use Flatpak for desktop GUI apps from Flathub for the best balance of performance and security. Use Snap only when an app is exclusively available as a Snap. On Ubuntu 24.04+, some apps like Firefox come as Snap by default — you can replace them with Flatpak if you prefer faster startup.
Why are Snap apps so slow to open?
Snap uses a compressed SquashFS filesystem. Every launch requires decompression, which adds 3-10 seconds on HDDs and 1-3 seconds on SSDs. This is a known architectural limitation of the Snap format. Flatpak and apt packages don’t have this issue.
Can I have the same app installed via both Snap and Flatpak?
Technically yes, but it’s not recommended. You’ll have two separate instances with separate configs, taking up extra disk space. Use snap list and flatpak list to check, and remove the duplicate.
How do I completely remove Snap from Ubuntu?
If you prefer apt + Flatpak only:
sudo snap remove --purge firefox
sudo snap remove --purge snap-store
sudo snap remove --purge snapd
sudo apt remove --purge snapd
sudo apt-mark hold snapd
The last command prevents apt from reinstalling snapd. Note that some Ubuntu packages may try to pull in Snap as a dependency.
Is Flatpak more secure than apt?
Flatpak’s sandboxing provides better isolation than apt packages, which run with full system access. However, Flatpak’s security depends on correctly configured permissions. An app with --filesystem=host has the same access as a native apt package. Always check permissions with flatpak info --show-permissions app-id.
Conclusion
The three Linux package managers serve different purposes and break in different ways. Use apt for system-level tools, Flatpak for desktop apps, and Snap only when necessary. When apt breaks, dpkg --configure -a and apt --fix-broken install fix most issues. When Snap is slow, switch to Flatpak. When Flatpak themes look wrong, install the GTK theme as a Flatpak runtime. Understanding which tool to use for which job eliminates most of the frustration.
Last updated: February 2025 | Tested on Ubuntu 22.04, 24.04, Linux Mint 22, and Fedora 41