29

Install Snapd and Use snap on Kali Linux 2021.x

 2 years ago
source link: https://computingforgeeks.com/install-snapd-and-use-snap-on-kali-linux/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Install Snapd and Use snap on Kali Linux 2021.x

Traditional package formats refer to those packages built for a specific system and the user has to install the required dependencies for the package. Far apart from traditional package formats, exists distribution independent package formats whereby applications are bundled with all the required dependencies to install and run an application within a single package. This has helped a lot since these package formats can run on any Linux system that has supported the framework for the package.

Snap, also known as snappy was developed by Canonical as a distribution independent package format, first released in 2014. Snap was originally developed for Ubuntu systems but with time, it was adopted by other distributions such as CentOS, Fedora, Linux Mint, Gentoo, Arch e.t.c

The main objective of developing snap was to create a single unified format for software packages that can run on a variety of devices. With Snap, one can access SnapCraft which is an online app store where one can find and install software packages.

By the end of this guide, you should be able to install Snapd and Use snap on Kali Linux 2021.x.

1. Update your system

Before we can commence on Snapd installation, ensure that all the installed Kali Linux 2021.x packages are updated to their latest stable versions.

sudo apt update && sudo apt upgrade -y

A reboot is highly recommended whenever an upgrade is performed:

sudo reboot

2. Install Snap on Kalin Linux 2021.x

Installing Snapd on Kali Linux 2021.x is a very straightforward process that can be achieved using the single command below.

sudo apt install snapd

Sample Output:

.........
The following NEW packages will be installed:
  snapd
0 upgraded, 1 newly installed, 0 to remove and 5 not upgraded.
Need to get 13.5 MB of archives.
After this operation, 57.4 MB of additional disk space will be used.
Get:1 http://http.kali.org/kali kali-rolling/main amd64 snapd amd64 2.51.7-2+b1 [13.5 MB]
Fetched 13.5 MB in 1s (21.9 MB/s)
Selecting previously unselected package snapd.
(Reading database ... 276762 files and directories currently installed.)
Preparing to unpack .../snapd_2.51.7-2+b1_amd64.deb ...
Unpacking snapd (2.51.7-2+b1) ...
Setting up snapd (2.51.7-2+b1) ...
snapd.apparmor.service is a disabled or a static unit not running, not start
ing it.
snapd.recovery-chooser-trigger.service is a disabled or a static unit not ru
nning, not starting it.
snapd.seeded.service is a disabled or a static unit not running, not startin
g it.
snapd.service is a disabled or a static unit not running, not starting it.
snapd.socket is a disabled or a static unit not running, not starting it.
Processing triggers for desktop-file-utils (0.26-1) ...
Processing triggers for man-db (2.9.4-2) ...
Processing triggers for dbus (1.12.20-3) ...
Processing triggers for mailcap (3.70) ...
Processing triggers for kali-menu (2021.4.1) ...

Now start and enable the snapd.socket ,Snapd as well as snapd.appamor using the command below.

sudo systemctl enable --now snapd.socket
sudo systemctl enable --now snapd apparmor

Check the status of Snapd as below.

$ systemctl status snapd
● snapd.service - Snap Daemon
     Loaded: loaded (/lib/systemd/system/snapd.service; enabled; vendor preset: disabled)
     Active: active (running) since Tue 2021-11-23 16:08:26 CET; 3s ago
TriggeredBy: ● snapd.socket
   Main PID: 5402 (snapd)
      Tasks: 9 (limit: 7028)
     Memory: 19.1M
        CPU: 96ms
     CGroup: /system.slice/snapd.service
             └─5402 /usr/lib/snapd/snapd

Nov 23 16:08:26 kali systemd[1]: Starting Snap Daemon...
Nov 23 16:08:26 kali snapd[5402]: AppArmor status: apparmor is enabled but some kernel features are missing: dbus, network
Nov 23 16:08:26 kali snapd[5402]: daemon.go:248: started snapd/2.51.7-2+b1 (series 16; classic; devmode) kali/2021.3 (amd64) linux/5.14.0-kali4-amd64.
Nov 23 16:08:26 kali snapd[5402]: daemon.go:341: adjusting startup timeout by 30s (pessimistic estimate of 30s plus 5s per snap)
Nov 23 16:08:26 kali snapd[5402]: helpers.go:105: error trying to compare the snap system key: system-key missing on disk
Nov 23 16:08:26 kali systemd[1]: Started Snap Daemon.

Verify the installed version of Snap

$ snap --version
snap    2.51.7-2+b1
snapd   2.51.7-2+b1
series  16
kali    2021.3
kernel  5.14.0-kali4-amd64

To Update Snap’s paths on your system, log out and log in back to your system or alternatively reboot it.

sudo reboot -i

3. Use Snap on Kali Linux 2021.x.

Now we are set to use our installed Snap to install independent package formats on our Kali Linux 2021.x machine. We will test our installation by installing Telegram Desktop.

Search the package on Snap as below.

snap find telegram-desktop

Sample Output:

Name              Version  Publisher         Notes  Summary
telegram-desktop  3.2.2    telegram.desktop  -      Telegram Desktop

Install the package on snap using the command:

sudo snap install telegram-desktop

Sample Output:

You can also launch the installed package as below.

snap run telegram-desktop

The program will launch as below.

To list all the installed Snap packages use:

$ snap list
Name               Version          Rev    Tracking       Publisher         Notes
bare               1.0              5      latest/stable  canonical✓        base
core20             20211115         1242   latest/stable  canonical✓        base
gtk-common-themes  0.1-59-g7bca6ae  1519   latest/stable  canonical✓        -
snapd              2.52.1           13640  latest/stable  canonical✓        snapd
telegram-desktop   3.2.2            3343   latest/stable  telegram.desktop  -

4. Update Snap Packages on Kali Linux

Normally, a snap package checks four times a day to track a new version of the installed software. You can change the channel the snap package track by first identifying the channels available for the package.

snap info gtk-common-themes

Sample Output:

As seen there is the tracking channel and several other channels available i.e beta, candidate, and edge.

We can switch tracking to the beta channel as below.

$ sudo snap refresh gtk-common-themes --channel=beta
gtk-common-themes (beta) 0.1-62-g8745644 from Canonical✓ refreshed

Here, in case a new version is available in the beta channel, it will be tracked and automatically installed on your system.

You can list available updates as below.

$ sudo snap refresh --list
All snaps up to date.

In case you have a newer version available for a package, you can force the update manually as below.

$ sudo snap refresh gtk-common-themes
snap "gtk-common-themes" has no updates available

5. Uninstall Snap packages

You can install a snap package using the remove command.

$ sudo snap remove telegram-desktop
telegram-desktop removed

Conclusion.

This is the end! I hope you too managed to install Snapd and use snap on Kali Linux 2021.x. Now you can proceed and install desired packages on Kali Linux 2021.x.

See more:


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK