Signup/Sign In
MARCH 28, 2023

How to install snap package manager on any Linux distro?

Technology #linux

    Snapcraft is a package management system for Linux that allows users to easily install and manage applications. It was developed by Canonical, the company behind the popular Ubuntu distribution of Linux. Snap packages are self-contained and can be installed on any Linux distribution that supports Snap.

    What is snapd?

    Snapd is the background service (or daemon) that runs on Linux systems and enables the use of the snap package management system. It is responsible for managing and interacting with the snap store, as well as handling the installation and management of snap packages on the system.

    What is snap?

    Snap is the command-line interface (CLI) for interacting with snapd and managing snap packages. It is used to install, remove, update, and manage snap packages on the system.

    What is snapcraft?

    Snapcraft is a tool for building and publishing snap packages. It allows developers to create a snap package for their application and publish it to the snap store, where it can be easily installed and managed on any Linux system that has snapd installed.

    How to build & install snap on Linux?

    snap is open source and you can check the source code on github. It is programmed using Golang which makes it easy to build and run.

    1. Open terminal window or connect remotely with SSH to your Ubuntu Server.

    2. Update repositories and upgrade packages (with root permissions): apt update && apt upgrade

    3. Install dependencies: apt install golang

    4. Get snapd source code from github.

    cd ~/
    git clone https://github.com/snapcore/snapd.git
    cd snapd

    5. Install build dependencies.

    cd ~/snapd
    sudo apt-get build-dep .

    If your using any other Linux distribution then check packaging directory https://github.com/snapcore/snapd/tree/master/packaging.

    6. Build snapd and other packages.

    cd ~/snapd
    go get ./... && ./get-deps.sh

    7. To build the snap command line client:

    cd ~/snapd
    mkdir -p /tmp/build
    go build -o /tmp/build/snap ./cmd/snap

    Conclusion

    In summary, snapd is the service that enables the use of snap on a Linux system, snap is the CLI for interacting with snapd and managing snap packages, and snapcraft is a tool for building and publishing snap packages.

    Pradeep has expertise in Linux, Go, Nginx, Apache, CyberSecurity, AppSec and various other technical areas. He has contributed to numerous publications and websites, providing his readers with insightful and informative content.
    IF YOU LIKE IT, THEN SHARE IT
    Advertisement

    RELATED POSTS