DEV Community

Cover image for Linux apt vs snap
Md Abu Musa
Md Abu Musa

Posted on

Linux apt vs snap

In Linux, both apt (Advanced Package Tool) and snap are package management systems, but they serve different purposes and work in different ways. Here's a comparison:

1. APT (Advanced Package Tool)

  • Type: Traditional package manager for Debian-based distributions (like Ubuntu).
  • Source: Installs software from repositories (PPA) using .deb packages.
  • Installation: Software is installed system-wide, usually into standard system directories like /usr or /lib.
  • Dependency Handling: APT resolves dependencies automatically by downloading the required packages.
  • Updates: Software installed via apt is updated when you run apt update && apt upgrade. It is tied to the system's release cycle.
  • Performance: APT packages run natively on the system, which typically makes them faster and more efficient.
  • Package Size: Typically smaller, since it only installs the required files, leveraging shared system libraries.

2. Snap

  • Type: Universal package management system developed by Canonical.
  • Source: Installs software in the form of "snaps" from the Snap Store. Snaps are self-contained, meaning they bundle all dependencies and libraries needed by the application.
  • Installation: Snaps are installed in their own space under /var/lib/snapd/snap and are mounted as read-only.
  • Dependency Handling: Since snaps bundle their dependencies, they are more isolated from the system, ensuring the application works regardless of what system libraries are installed.
  • Updates: Snap packages are automatically updated in the background without needing user intervention. This allows for quicker delivery of the latest versions.
  • Performance: Snap apps may start slightly slower due to their containerized nature and sandboxing, but they ensure a consistent environment.
  • Package Size: Snaps tend to be larger due to bundling dependencies within each package.

Key Differences:

  • APT is suited for users who want a more native experience, with software that's tailored to their Linux distribution.
  • Snap offers an easier way to distribute applications across different Linux distributions but at the cost of performance overhead and larger package sizes.

Both have their uses—apt for traditional system packages and snap for cross-distribution app delivery.

Do your career a big favor. Join DEV. (The website you're on right now)

It takes one minute, it's free, and is worth it for your career.

Get started

Community matters

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay