Snap Packages
Snapcraft : A tool which is used to create snap packages is called Snapcraft.
If somehow your system has no snapd services installed , you can install it for your system. Snap is supported by all major Linux distros. just try to install with native package manager command.
sudo apt-get update && sudo apt-get install snapd
By default snap packages update automatically & check updates 4 times in a day but still you can manually update the packages in snap.
- To update all installed snap packages
$ snap refresh
gnome-system-monitor 3.28.2 from 'canonical' refreshed
gnome-calculator 3.28.2 from 'canonical' refreshed
$ snap refresh --time
- To check which application will be updated in next refresh, run below command.
snap refresh --list
Controlling Updates :
You can control how frequently your snap packages will update. You can schedule your updates withe help of below commands.
refresh.times : This option helps you to schedule your snap packages for updates in a specific time. see the below command example.
sudo snap set system refresh.timer=7:00-9:00,22:00-23:59
The above command will set a schedule your snaps to update at 07:00 to 09:00 a.m and 10:00 to 23:59 pm.
- To stop auto update till a specific date use below commands steps.
i) Generate the specific time which you want to use to hold your update till that date. For this first you have to check the current time and its format.
$ date
Above command will confirm you about the current time and date format and time zone. Now generate the date and time which you will use to hold your snap updates with below commands.
$ date --date="IST 2020-09-20 18:30:00" "+%Y-%m-%d %H:%M:%S"
In above example I choose 20 September 2020 , 6:30 p.m to hold snap update for my system. So my . Now run the final commands to tell the system do not update snap packages till that time.
sudo snap set system refresh.hold="$(date --date="IST 2020-09-20 18:30:00" "+%Y-%m-%dT%H:%M:%S%:z")"Use snap refresh --time to verify it.
- To hold updates for metered connection.
sudo snap set system refresh.metered=hold
- To re-enable the updates on metered connection
sudo snap set system refresh.metered=null
Monitoring Options
To check previous actions either you install , remove , update a package , run below command to check.
snap changes
To get more details about any action use ID number.
snap change 8
Connections Options :
A snap application is connected via an interface to communicate with the outside system resources. Snaps are designed for strong application isolation and safe interface connections are made automatically. So you dont need to worry about interface too much however you can check which interface is currently using in a snap application.
- To see which interfaces a snap is using, and which interfaces it could use but isn’t, use below command
snap connections snap_name
Note: If slot have null value then an interface is not connected else connected with snap app.
- To see which other snaps are using an interface with the interface command:
snap interface camera
Configuration Options :
You can see or modify a configuration of a snap package using below command.
- To see the configuration options exposed by an installed snap.
sudo snap get snap_name
Output:
Key Value
mode production
Snap_name {...}
php {...}
ports {...}
private {...}
To explore configuration options, append the key name to the get command:
sudo snap get snap_name ports
Output:
Key Value
rts.http 80
ports.https 443
So these are some important commands in of snap package manager in Linux. There are more advance commands to manage & modify snap applications functionality according to your choice.
Please share the post with your friends that will encourge us to make some more useful post 😀
0 Comments