You can install software on Ubuntu through the APT package manager, Snap Store, Flathub, AppImage, or by compiling from source, with the best method depending on the software’s availability and your need for the latest version. The most common and safest approach is using APT with sudo apt install, which pulls from Ubuntu’s official repositories. For third-party apps, Snap and Flatpak offer sandboxed, up-to-date packages, while AppImages run without installation.
APT: The Default Package Manager
APT (Advanced Package Tool) is Ubuntu’s built-in package manager, using .deb packages from the Ubuntu archives. It resolves dependencies automatically and integrates with the system’s update mechanism. Basic usage includes:
sudo apt update— refreshes the package index from configured repositories.sudo apt install package-name— installs a package along with its dependencies.sudo apt remove package-name— uninstalls while keeping configuration files.apt search keyword— finds packages by name or description.
Most software in the official repositories is stable and well-tested, but not always the latest version. For example, Ubuntu LTS releases may ship older versions of applications like GIMP or LibreOffice compared to what the developers offer.
Snap: Canonical’s Sandboxed Packages
Snaps are containerized packages developed by Canonical, bundled with their dependencies and running in a confined environment. They install with sudo snap install package-name and update automatically. Snap packages are available from the Snap Store, which includes both open-source and proprietary apps like Spotify, Slack, and Visual Studio Code.
Snaps work across many Linux distributions, not just Ubuntu, and they are preinstalled on Ubuntu by default. The main trade-offs are larger disk usage (since each snap bundles libraries) and sometimes slower startup times. You can list installed snaps with snap list and remove one with sudo snap remove package-name.
Flatpak: Another Sandboxed Option
Flatpak is a competing sandboxing system that runs apps in a shared runtime environment. Unlike Snap, Flatpak is not preinstalled on Ubuntu, so you need to set it up manually:
- Install Flatpak:
sudo apt install flatpak - Add the Flathub repository:
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo - Reboot or run
flatpak --user updateto refresh the app list. - Install an app:
flatpak install flathub org.gimp.GIMP
Flatpak apps are sandboxed and can be run with flatpak run or launched from the application menu. Many users prefer Flatpak because it works across distributions and offers fine-grained permission control. However, you must manually add the Flathub repository, and some apps may not be available as Flatpaks.
AppImage: Portable, No Installation
AppImages are self-contained executable files that run without installation. You download a single .AppImage file, make it executable (chmod +x file.AppImage), and double-click to run. They are ideal for trying software without committing to a system-wide install, and they work on any Linux distribution.
The downside is that AppImages do not integrate with the system’s package manager, so you won’t get automatic updates or desktop menu entries (though you can add them manually). Some developers distribute only AppImages, such as Krita or OpenShot.
Deb Files and Third-Party Repositories
Some vendors offer .deb packages for direct download from their websites (e.g., Google Chrome, Microsoft Teams). You can install them with sudo dpkg -i file.deb, but this may fail if dependencies are missing. A more reliable method is sudo apt install ./file.deb, which resolves dependencies from the configured repositories.
Third-party repositories (PPAs) can be added with sudo add-apt-repository ppa:owner/name, then you use apt as usual. PPAs often provide newer versions of software, but they are not officially supported by Ubuntu, so use them with caution. Only add PPAs from trusted sources to avoid security risks.
Compiling from Source
When no package is available, you can compile the program from its source code. This gives you full control over build options and ensures the latest version, but it requires development tools and time. The typical steps are:
- Install build essentials:
sudo apt install build-essential - Download the source tarball and extract it.
- Run
./configure(orcmake) to check dependencies. - Run
maketo compile. - Run
sudo make installto install system-wide.
Compiling is rarely necessary for mainstream apps, but it’s useful for software that isn’t packaged elsewhere or if you need specific patches. Uninstalling compiled software can be tricky, as you may need to manually remove files.
How to Choose the Right Method
Start with APT for anything in the official repositories—it’s the most integrated and secure. If the app isn’t there, check if it’s available as a Snap or Flatpak, which are both safer than random .deb files. Use AppImage for portable apps you don’t want to install. Reserve compiling for special cases.
For command-line tools, APT is usually best. For GUI apps, Snap or Flatpak often offer newer versions. If you value automatic updates, Snap and Flatpak shine. If you value minimal disk usage, APT and AppImage are lighter.
Common Problems and Solutions
Dependency errors: When using dpkg -i, you may see missing dependencies. Fix with sudo apt --fix-broken install.
Snap not found: If Snap isn’t installed, run sudo apt install snapd.
Flatpak apps not showing in menu: Log out and back in, or run flatpak --user update.
AppImage fails to run: Ensure the file is executable and that FUSE is installed (sudo apt install fuse on older systems).
Frequently Asked Questions
How do I install a .deb file? Use sudo apt install ./file.deb in the directory containing the file. This resolves dependencies automatically. Alternatively, double-click the file in the file manager to open it with the Software Center.
Is Snap or Flatpak better? It depends. Snap is preinstalled on Ubuntu and has automatic updates, but Flatpak offers more control over permissions and works across more distributions. Try both and see which performs better for your apps.
How do I uninstall software? For APT, use sudo apt remove package. For Snap, sudo snap remove package. For Flatpak, flatpak uninstall app-id. For AppImage, just delete the file.
Why is the version in the repositories old? Ubuntu LTS releases prioritize stability, so they freeze package versions. If you need a newer version, use a Snap, Flatpak, or a PPA.
Can I use the Ubuntu Software Center? Yes, the GUI Software Center (or App Center) uses APT, Snap, and Flatpak in the background. It’s a user-friendly way to browse and install software without the command line.
Is it safe to install from PPAs? PPAs are not officially reviewed, so they carry some risk. Only add PPAs from well-known developers or projects, and avoid random ones.
Related
General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.
More in this bed
- How to Move Data to a New Samsung Galaxy Phone
- Pixel C vs Surface Pro: Key Differences
- iPhone X vs iPhone: Key Differences Explained
- Chromebook Won’t Charge: How to Fix
- How to Delete Photos on Google Drive
- Firefox Bookmark Management Tips & Tricks