We are already familiar with installing, updating and removing packages using the APT (Advanced Package Tool) package manager. But recently Snap became a hot topic as Ubuntu 22.04 LTS shipped Snap as its default package manager. They even moved default apps like Firefox from APT to Snap. So, let’s see how to manage Snap packages with the terminal by searching, installing, updating and removing Snap packages.
Search Packages With Snap
Similar to the APT, Snap also has a search functionality. You can search for packages and their available versions using
snap find or
snap search commands and the name of the package you need to search.
snap find chromium
View All Currently Installed Snap Packages
All the currently installed Snap packages can be listed with the
snap list command.
View Detailed Information About A Snap Package
You can get detailed information about a specific package by using the
snap info command and the name of the package you need to view more information.
snap info chromium
Install New Packages With Snap
Installing new packages is similar to the APT. Run
snap install with the package name you need to install.
snap install chromium
Snap does not have a command similar to APT’s
apt-get update command. However, Snap automatically checks for updates. If you really need to know the time of the last check, you can use the
snap refresh --time command.
View All Available Snap Updates
Before updating Snap packages, you can list packages that have updates by running the
snap refresh –list command.
snap refresh –list
Update A Specific Snap Package
When we use APT, we use the same
apt-get install command to install and update packages. But Snap has a separate command called
refresh for that. Run
snap refresh with the name of the package that you need to update.
snap refresh chromium
Update All Snap Packages
We can update all the packages by running the
snap refresh without mentioning any package name. It will check outdated packages and update to their latest available versions.
Remove A Snap Package
Finally, if you do not use a particular package, you can remove it by using the
snap remove command with the package name that you need to remove.
snap remove chromium