Snap 是 Ubuntu 下的 AppStore 的命令行版。界面版 Ubuntu Software 后台调用的还是 Snap。

搜索

snap search <keyword>

例如:

$ snap search intelli
Name                       Version  Publisher         Notes    Summary
intellij-idea-community    2020.3   jetbrains✓        classic  Capable & Ergonomic Java IDE
firefox                    83.0-2   mozilla✓          -        Mozilla Firefox web browser
intellij-idea-ultimate     2020.3   jetbrains✓        classic  Capable & Ergonomic Java IDE for Enterprise, Web & Mobile Development
cacher                     2.38.2   cacherapp✓        -        Cacher is a code snippet library for professional developers. Use it to build a technical knowledge base for you and your team.
datagrip                   2020.3   jetbrains✓        classic  IntelliJ-based IDE for databases and SQL
intellij-idea-educational  2020.3   jetbrains✓        classic  IntelliJ IDEA Educational Edition
goland                     2020.3   jetbrains✓        classic  A Clever IDE to Go
rubymine                   2020.3   jetbrains✓        classic  The Most Intelligent Ruby and Rails IDE
rider                      2020.3   jetbrains✓        classic  A fast & powerful cross-platform .NET IDE
killbots                   20.04.0  kde✓              -        port of the classic BSD console game robots
kgoldrunner                20.04.0  kde✓              -        A game of action and puzzle-solving

安装

snap install <name> <notes>

例如:

$ sudo snap install gimp
$ sudo snap install code --classic

错误处理

安装过程有可能出错,安装没有正常结束。再次安装就会出现类似以下错误:

$ sudo snap install intellij-idea-community --classic
error: snap "intellij-idea-community" has "install-snap" change in progress

输入 snap changes 查看安装任务。例如:

$ snap changes
ID   Status  Spawn                  Ready                  Summary
4    Done    today at 09:45 CST     today at 09:45 CST     Initialize device
5    Error   today at 10:03 CST     today at 10:23 CST     Install "clion" snap
6    Done    today at 10:23 CST     today at 10:30 CST     Install "clion" snap
7    Error   today at 10:31 CST     today at 10:54 CST     Install "pycharm-community" snap
14   Doing   today at 12:05 CST     -                      Install "intellij-idea-community" snap

可以看到 ID 为 14 的任务正在执行中。执行以下命令终止任务:

$ sudo snap abort 14

再执行安装命令就可以正常安装了。

发表回复

您的电子邮箱地址不会被公开。