Canonical Snapcraft
Menu Close menu
  • Snap Store
  • About Snapcraft
  • Learn
    • Blog
    • Build
    • Docs
    • Tutorials
  • IoT
  • Forum
  • My account
    • My published snaps
    • My validation sets
    • My stores
    • Account details
    • Sign out
  • Sign in
Toggle side navigation
Toggle side navigation

Snap documentation

Use snaps

  • Snap tutorials
    • Get started
    • Install the daemon
      • AlmaLinux OS
      • Arch Linux
      • Debian
      • Elementary OS
      • Fedora
      • Linux Mint
      • Manjaro Linux
      • Raspberry Pi OS
      • openSUSE
      • Pop!_OS
      • Rocky Linux
      • Ubuntu
  • Snap how-to guides
    • Work with snaps
      • Manage updates
      • Connect interfaces
      • Configure snaps
      • Apps and aliases
    • Manage snaps
      • Create data snapshots
      • Use resource quotas
      • Disk space awareness
      • Set system options
      • Control services
      • Using components
      • Configure snaps with confdb
      • Manage validation sets
      • Snap deltas
      • Use the REST API
      • Use snapctl
    • Fix common issues
      • Test snapd fixes
      • Debug snaps
  • Snap reference
    • Operations
      • Glossary
      • System options
      • System architecture
      • Interfaces
        • Hardware interfaces
        • Media interfaces
        • Network interfaces
        • Security interfaces
        • System interfaces
        • Super-privileged interfaces
    • Administration
      • Network requirements
      • Distribution support
    • Development
      • Supported snap hooks
      • Environment variables
      • REST API
        • snapd REST API
        • Error responses
      • YAML schemas
        • The snap format
        • The gadget snap
        • The kernel snap
    • Release notes
  • Snap explanation
    • How snaps work
      • Refresh awareness
      • Channels and tracks
      • Revisions
      • Transactional updates
      • Validation sets
      • Confdb configuration mechanism
      • Snap components
      • Snap performance
    • Interfaces
      • All about interfaces
      • Interface auto-connection
      • Interface hooks
    • Security
      • Security policies
      • Snap confinement
      • Classic confinement
      • Assertions
      • Snapd release process

Build snaps

Contribute to our docs

Using components

On this page

  • Installing components
  • Updating components
  • Listing components
  • Removing components

A snap component is part of a snap that has been declared as optional. A snap component may then be either installed or not installed alongside its host snap. See Components for further details.

Component support requires snapd 2.67+.

Installing components

Components can be installed with the snap install command:

snap install my-snap+comp1+comp2

:information_source: The syntax <snap_name>+<comp_1>+...+<comp_N> will be used to refer to components from the command line.

The above command will install my-snap alongside components comp1 and comp2. If the snap is already installed, the command will instead install only the missing components.

Once installed, the (asserted) components will refresh when new revisions are available in the store, in the same way as for snaps.

It is also possible to install components from local files. If unasserted, they can be installed only if the host snap is unasserted too and you will need to use the --dangerous flag:

snap install --dangerous ./my-snap+comp1+comp2_1.0.comp

When refreshing a snap, all components will refresh to the new revisions tuple. If the new snap revision does not define some components defined in the previously installed snap and that are currently installed, those components will be removed.

Refreshing an unnasserted snap requires new component builds to be installed manually.

Updating components

It is also possible to refresh a snap and install a component at the same time:

snap refresh my-snap+comp1

Listing components

The snap components command is used to list the components installed and available on the system:

$ snap components
Component                    Status     Type
snap-with-comps+one          installed  standard
snap-with-comps+two          installed  standard
snap-with-comps+three        available  standard
other-snap-with-comps+one    installed  standard
other-snap-with-comps+two    installed  standard
other-snap-with-comps+three  available  standard

A snap name can be optionally provided to filters the list of reported components to those only associated with the provided snap:

$ snap components snap-with-comps
Component                	Status 	Type
snap-with-comps+one      	installed  standard
snap-with-comps+two      	installed  standard
snap-with-comps+three    	available  standard
Note that there are some plans for a "snap component" subcommand, but that is not yet implemented and there are talks of changing its design.

Removing components

To remove only the components, use the “remove” command, followed by the snap and component names:

snap remove my-snap+comp1+comp2

To remove the snap plus any installed components, just remove the snap:

snap remove my-snap

Last updated 4 months ago.

Help improve this document in the forum.

Back to top

© 2025 Canonical Ltd.

Ubuntu and Canonical are registered trademarks of Canonical Ltd.
Powered by Charmed Kubernetes

Join the forum, contribute to or report problems with, snapd, Snapcraft, or this site.

  • Terms of Service
  • Data privacy
  • Manage your tracker settings
  • Service status
  • Other functions
  • Share on Twitter
  • Share on Facebook
  • Share on YouTube