Since switching to Zorin OS all of my software has been installed using Snap (apt) packages as far as I know. The latest software I installed had to be done using a Flatpack in order to get the latest version.
What is the difference between these two? I have read people having problems with Flatpack installs and getting updates for the software but I have no clue how that works. I know the command sudo get-apt upgrade is supposed to update all the software installed using Snap packages.
Can somebody give me a quick lesson on Flatpacks vs. Snap Packages?
Snap and apt are two different packaging formats, so your post mentions three: apt, snap and flatpak
Programs installed through apt (also named as .deb when downloaded as standalone files, or as "Zorin OS package" when looked up from the software store) are usually the most reliable ones, as they are installed alongside the system libraries and have the permissions needed to work well
Flatpak and Snap try to take a different approach; separating the programs installed by the user from the system libraries. This allows to have newer versions of programs even when they need a library on a higher version than what the system provides, because instead of using what comes with the system, they bring their own dependencies. Let's say, as an invented example, a program for tweaking GPU settings requires gpulib to be on version 2.2, but the system brings it on version 2.1. This would mean that an apt package would not work, but flatpak and snap instead install gpulib 2.2 in a separate folder that doesn't touch the system files, allowing you to use the program. Simmilarly, if you later want a program that uses gpulib 2.3, you will have both, 2.2 and 2.3 installed alongside (until no programs rely on it anymore, in which case it will be removed to save space)
However, due to being containerized and having its own set of "system" libraries and restrictions for permissions, there can be times where simple functions on programs dont work well (like drag-and-drop from any folder that isnt Downloads). This is the strongest point in favor of apt, despite it's other complications
As for differences between flatpak and snap, im not informed enough, but one i know for sure is that snaps auto-update and flatpaks wait for your approval before starting to update
I adjusted this threads title to Apt vs Flatpak in order to allay confusion. If this is not what the O.P. (@randdmart) intends, please speak up.
Please keep in mind, reading @Sorro's answer, that Snap and Flatpak are two distinct alternative sandboxed application formats and both are distinct from APT, which is the standard package management format.
The most important differences between them have already been mentioned, but i'll provide some info on what i prefer:
Most times i will check if the package is available in apt: sudo apt search [app_name]
If it isn't found in the package list, I'll just look it up on their website and download the .deb file. I used nala for so long that im used to just installing applications through commands now with: sudo apt install ./package.deb.
I use flatpak so rarely, so far I've used it for very few apps:
Plex
PulseEffects
PrismLauncher
I used flatpak for most things when i first started using ubuntu, but after a while i just run into issues.
Force of habit yeah, haha. There was a time where i would only use sudo where it was necessary, but most times i would have to write the command twice anyways.
See apt update:
[redacted]@cypher:~$ apt update
Reading package lists... Done
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)
W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)
Another one that I use frequently is !$. This expands to the last argument on the last command in history. For example, I run apt search to search for a particular package. If it's there, and it has the same name as I searched for, I can run:
sudo apt install !$
To save me some typing when copying files you can also do:
Instead of having to type that whole path again, !#:2 expands to the current line typed so far (!#) and select the argument at position 2 (:2), keeping in mind that the counter starts at 0. And then, add a suffix for the new name as a backup (.bak).
Or, if I just need the name of the file, instead of the whole directory:
oooo, thats a cool one. I just tested this and it works so nicely! The other ones you listed are also handy, but i fear i would struggle to remember them. It is really good that they've atleast made this possible.