Software Package Manager Tools: Snap vs. APT

I faced an issue a while ago, and it was taking a long time, that was done by a command following below.

`sudo snap install mysql-workbench-community`

after running the command, It shows in terminal:
Automatically connect eligible plugs and slots of snap “mysql-workbench-community”

In that case, my query was that why it takes a long time to install/run the application. Actually, I didn’t know about the command-line tool `snap` before, but I used very often, not knowing the tool that how works.

Eventually, I got to know that “Automatically connect eligible plugs and slots …” means downloading the dependency applications. Well, I am going to describe what the reason behind taking a long time and how it works. Here we go!

There two software package managers to work with: snap and apt in Ubuntu Linux. The snap and apt both automate software package installation, management and removal, but they work in different ways.

Snap:

A snap is a bundle of an app and its dependencies that works without modification across many different Linux distributions.

We can describe in another words like: Snap is a secure and scalable way to embed applications on Linux devices. A snap is an application containerized with all its dependencies. A snap can be installed using a single command on any device running Linux. With snaps, software updates are automatic and resilient.

Snap packages an application as an archive that contains the binary code, data and libraries required to run said application, including any external dependencies. When we execute the application, snap unpacks the archive and the application runs in a sandboxed environment.

APT:

APT for Advanced Package Tool, is an interactive command-line tool for managing deb packages on different Linux distributions. Introduced in 1998, APT has become a widely supported. The package manager installs, removes, updates, and upgrades deb packages.

Actually, It is a collection of tools used to install, update, remove, and otherwise manage software packages on Debian and its derivative operating systems, including Ubuntu and Linux Mint.

Apt manages are Debian packages, known as debs. each deb contains the application code, data and libraries required to install an application. Debs also define the application’s dependencies, such as any other software the application requires to run. When we install a Debian package via apt, apt installs the application’s dependencies automatically.

Apt installs data permanently into Ubuntu’s file system, from where the applications run. The applications run as standard processes directly on the host system, rather than in sandboxed environments.

Differences between Snap and APT:

  1. When we run the command with APT, it installs the software directly to our system, and it installs the only one version of each application that we use. On the other hand, it’s very easy to install multiple application at a same time with snap.
  2. Package creation is easier than the APT packages, where we can bundle the dependencies into the the package, without define them and expect that the user’s system has the right dependencies available.
  3. The data and dependencies of the application in snap packages are self-contained and it is easy to remove the entire application with the snap and APT as well. But APT makes the risk that it does not delete the data fully when we remove an application. So APT makes the trouble on our system.
  4. Snap can run without root privileges, although it expects the root privileges by default to install the snap packages. On the other hand, APT requires the root privileges. In that case, Snap is more secure than APT.
  5. Snap is a better for IT teams whose main package management needs revolve around software built in house. Apt makes sense when most of the software we run on Ubuntu comes from third parties
  6. Apt is older, it is Introduced in 1998. The snap is newer.

We can say that snap is more cleaner, simpler in software management experience. On the other hand, apt packages have their advantages too. For one, they are smaller because they don’t bundle dependencies. Installing software with apt results in more efficient storage space use. Applications installed via apt are also likely to start faster because the application packages don’t need to decompress before they run; instead, the packages decompress at installation time.