If you encounter the snap command not found error while trying to install a package on a Linux server, it usually means that the snapd service is not installed or not running. This is common on minimal Ubuntu or Debian installations. The issue is simple, but Snap will not work at all unless snapd is properly configured.
Root Cause
Snap relies on the snapd system service to function. If snapd is missing or inactive, the snap command will not be available.
This error typically occurs when:
The server was installed with a minimal image
snapd was removed manually
The snap binary path is not loaded into the system
Error Message
snap: command not found
Solution Steps
Install snapd
On Ubuntu and Debian based systems, run:
sudo apt updatesudo apt install snapd -y
Enable and start the service
sudo systemctl enable snapdsudo systemctl start snapd
Reboot the server
sudo reboot
Verify installation
snap version
If the version information is displayed, Snap is successfully installed.
Additional Notes
Snap packages run in an isolated sandbox environment
Snap is not mandatory for server environments
For performance and security reasons, Snap may be avoided on production servers
Evaluate your actual needs before using Snap on a live system.