Install the app
Let's take the installation kubectl command as an example:
The first step is to search for the application first
# snap search kubectl Name Version Publisher Notes Summary kubectl 1.18.8 canonical✓ classic Command line client for controlling a Kubernetes cluster. kubernetes-worker 0.0.1 canonical✓ - A complete Kubernetes worker kafkactl 1.11.0 dwi-di - A command-line interface for interaction with Apache Kafka kubectl-eks 1.10.3 canonical-cloud-snaps classic kubectl controls the Kubernetes cluster manager. kubectl-iexec v1.6.2-next leetserve - plugin to interactively exec to a pod client-keystone-auth v1.14.0+git36.e163280 knobby - Client plugin for kubectl to enable keystone authentication. devoperator 1.5.1 art-hens-teeth classic DevOps tools kube-commander 0.2.1 anatoly-rugalev - Browse your kubernetes clusters in a casual way
The second step, check the package information, get all available versions
# snap info kubectl name: kubectl summary: Command line client for controlling a Kubernetes cluster. publisher: Canonical✓ store-url: https://snapcraft.io/kubectl contact: https://www.ubuntu.com/kubernetes license: Apache-2.0 description: | kubectl is a command line client for running commands against Kubernetes clusters. For more information about kubectl, including syntax, descriptions of command operations, and common examples, see the [overview](https://kubernetes.io/docs/reference/kubectl/overview/). For details about each command, including all the supported flags and subcommands, see the [kubectl reference documentation](https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands/). snap-id: ZgG2URycDgvxSVskfoZxn44uaRMw0iwe channels: latest/stable: 1.18.8 2020-08-27 (1612) 10MB classic latest/candidate: 1.18.8 2020-08-27 (1612) 10MB classic latest/beta: 1.18.8 2020-08-27 (1612) 10MB classic latest/edge: 1.18.8 2020-08-27 (1612) 10MB classic 1.19/stable: 1.19.0 2020-08-27 (1623) 10MB classic 1.19/candidate: 1.19.0 2020-08-27 (1623) 10MB classic 1.19/beta: 1.19.0 2020-08-27 (1623) 10MB classic 1.19/edge: 1.19.0 2020-08-27 (1623) 10MB classic 1.18/stable: 1.18.8 2020-08-26 (1612) 10MB classic ...
The third step, install the application (or specific version)
# snap install kubectl --classic // If you need to install a specific version # snap install kubectl --classic --channel=1.18/stable
Note that whether to use the --classic option is related to the permission of the application. The application's Snapcraft homepage or error message will prompt whether to use the --classic option.
Related Links
references
K4NZ / 使用 snap 安装应用
How to install snap packages behind web proxy on Ubuntu 16.04 - Ask Ubuntu
How to list all available versions of a snap which is not installed? - Ask Ubuntu
ubuntu - Install specific previous version of package using snap? - Unix & Linux Stack Exchange