Saturday, November 16, 2024
Google search engine
HomeGuest BlogsHow To Install Snap on Arch Linux / Manjaro

How To Install Snap on Arch Linux / Manjaro

In this guide, I’ll take you through the steps to install and use snapd service on Arch Linux / Manjaro and other Arch based Linux distributions. Snap is a software deployment and package management tool originally designed and built by Canonical which works across a range of Linux distributions.

install snap arch

The packages are called ‘snaps‘ and the tool for using them is ‘snapd‘. Snap enables you to run distro-agnostic upstream software packages on your system. Snap bundles most of the libraries and runtimes needed by the application and can be updated and reverted without affecting the rest of the system.

Install Snap on Arch Linux / Manjaro

To install Snapd on Arch Linux, you can use pacman package manager or AUR.

sudo pacman -S snapd

For AUR, you need to have AUR helper installed. In this guide, I recommend yay which can easily be installed using:

Once yay is installed, use it to install Snap.

yay -S --noconfirm --needed snapd

Or install snapd manually.

git clone https://aur.archlinux.org/snapd.git
cd snapd
makepkg -si

Start and enable snapd service.

sudo systemctl enable --now snapd.socket

Confirm service status.

$ systemctl status snapd.socket
 snapd.socket - Socket activation for snappy daemon
     Loaded: loaded (/usr/lib/systemd/system/snapd.socket; enabled; preset: enabled)
     Active: active (running) since Wed 2023-01-25 16:25:52 UTC; 12min ago
      Until: Wed 2023-01-25 16:25:52 UTC; 12min ago
   Triggers: ● snapd.service
     Listen: /run/snapd.socket (Stream)
             /run/snapd-snap.socket (Stream)
      Tasks: 0 (limit: 4536)
     Memory: 0B
        CPU: 699us
     CGroup: /system.slice/snapd.socket

Jan 25 16:25:52 arch.mylab.io systemd[1]: Starting snapd.socket - Socket activation for snappy daemon...
Jan 25 16:25:52 arch.mylab.io systemd[1]: Listening on snapd.socket - Socket activation for snappy daemon.

To enable classic snap support, create a symbolic link between /var/lib/snapd/snap and /snap:

sudo ln -s /var/lib/snapd/snap /snap 

Since the binary file is located under,/snap/bin/ we need to add this to the $PATHvariable.

echo "export PATH=\$PATH:\/snap/bin/" | sudo tee -a /etc/profile

Source the file to get new PATH

source /etc/profile

Snapd is now ready for use. You interact with it using the snap command. See help page below:

snap --help

Test your system by installing the hello-world snap and make sure it runs correctly:

$ sudo snap install hello-world
hello-world 6.4 from Canonical✓ installed

List installed snaps.

$ snap list
Name               Version          Rev    Tracking       Publisher              Notes
bare               1.0              5      latest/stable  canonical✓             base
core               16-2.58          14447  latest/stable  canonical✓             core
core20             20221212         1778   latest/stable  canonical✓             base
core22             20230110         484    latest/stable  canonical✓             base
gtk-common-themes  0.1-81-g442e511  1535   latest/stable  canonical✓             -
hello-world        6.4              29     latest/stable  canonical✓             -
powershell         7.3.1            226    latest/stable  microsoft-powershell✓  classic
snapd              2.58             17950  latest/stable  canonical✓             snapd
telegram-desktop   4.5.3            4486   latest/stable  telegram.desktop       -

Remove snap.

$ sudo snap remove hello-world
hello-world removed

Congratulations!. Snap has been installed successfully on your Arch/Manjaro. Check Snap documentation for more.

For other Linux distributions, check:

RELATED ARTICLES

Most Popular

Recent Comments