The main difference between a classic Ubuntu installation and Ubuntu Core is that Ubuntu Core’s system configuration, package management, and update control is governed entirely by snapd, the snap daemon.
Snap features are explained comprehensively in the Snap documentation, but we’ll cover some basic operations below:
You can list which snaps are installed on your Ubuntu Core system with snap list
:
$ snap list
Name Version Rev Tracking Publisher Notes
core22 20230801 864 latest/stable canonical✓ base
pc 22-0.3 146 22/stable canonical✓ gadget
pc-kernel 5.15.0-86.96.1 1433 22/stable canonical✓ kernel
snapd 2.60.3 20092 latest/stable canonical✓ snapd
The above shows the standard (and initial) set of snaps in a default Ubuntu Core installation. For more details on what these do, see Snaps in Ubuntu Core.
As Ubuntu Core is a minimal installation, one of the first things you might want to install is a text editor. You can search for snaps using snap find
, or consult the Snap Store. Nano-strict is a good choice because it’s strictly confined, as required for Ubuntu Core, and useful:
snap install nano-strict
By default, Ubuntu Core defaults to disabling access to most resources, including writing files to your home directory.
Permissions in snap and Ubuntu Core are handled by interfaces. You can see which interfaces nano-strict needs with the snap connections
command:
$ snap connections nano-strict
Interface Plug Slot Notes
home nano-strict:home - -
removable-media nano-strict:removable-media - -
Connecting the home interface between Ubuntu Core and nano-strict will allow you to save files to your home directory. This is accomplished with the snap connect
command:
snap connect nano-strict:home :home
after which you can verify that you are connected to your home directory:
$ snap connections nano-strict
Interface Plug Slot Notes
home nano-strict:home :home manual
removable-media nano-strict:removable-media - -
After running the above command, you will be able use the nano-strict
command to create and edit text files in your home directory!
The :home
syntax denotes the home slot on Ubuntu Core. For more information on how to work with interfaces, see Interface management in the snap documentation.
To remove a snap from your system, along with its internal user, system and configuration data, use the snap remove
command (add the --purge
option to avoid making a snapshot of the snap’s data):
$ snap remove [--purge] nano-strict
nano-strict removed
For more information on how to work with snaps, including how to control daemons/servers, how to make data snapshots and how to install specific revisions, see the Snap Documentation .