Home | 簡體中文 | 繁體中文 | 雜文 | 知乎專欄 | Github | OSChina 博客 | 雲社區 | 雲棲社區 | Facebook | Linkedin | 視頻教程 | 打賞(Donations) | About
知乎專欄多維度架構 微信號 netkiller-ebook | QQ群:128659835 請註明“讀者”

6.2. snap - Tool to interact with snaps

6.2.1. 安裝 snap

		
[root@netkiller test]# yum info snapd
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Available Packages
Name        : snapd
Arch        : x86_64
Version     : 2.37.4
Release     : 2.el7
Size        : 14 M
Repo        : epel/x86_64
Summary     : A transactional software package manager
URL         : https://github.com/snapcore/snapd
License     : GPLv3
Description : Snappy is a modern, cross-distribution, transactional package manager
            : designed for working with self-contained, immutable packages.

[root@netkiller ~]# yum install -y snapd		
[root@netkiller ~]# systemctl enable --now snapd.socket
Created symlink from /etc/systemd/system/sockets.target.wants/snapd.socket to /usr/lib/systemd/system/snapd.socket.
[root@netkiller ~]# systemctl start snapd

[root@netkiller ~]# snap install hello-world
2019-03-09T11:44:14+08:00 INFO Waiting for restart...
hello-world 6.3 from Canonical✓ installed

[root@netkiller ~]# snap list
Name         Version    Rev   Tracking  Publisher   Notes
core         16-2.37.2  6405  stable    canonical✓  core
hello-world  6.3        27    stable    canonical✓  -
		
		

6.2.2. 列出已經安裝的snap包

		
neo@ubuntu:~$ snap list
Name  Version    Rev   Tracking  Publisher   Notes
core  16-2.37.2  6405  stable    canonical✓  core
go    1.12       3318  stable    mwhudson    classic		
		
		

6.2.3. 搜索要安裝的snap包

		
sudo snap find <text to search>		
		
		

6.2.4. 安裝snap包

		
sudo snap install <snap name>
		
		

6.2.5. 更新snap包

更新snap包,如果你後面不加包的名字的話那就是更新所有的snap包

		
sudo snap refresh <snap name>		
		
		

6.2.6. 把一個包還原到以前安裝的版本

		
sudo snap revert <snap name>		
		
		

6.2.7. 刪除snap包

刪除一個snap包

		
sudo snap remove <snap name>
		
		

6.2.8. 查詢最近做的操作日誌

		
$ snap changes		
		
		
		
neo@ubuntu:~$ snap changes
ID   Status  Spawn               Ready               Summary
2    Done    today at 11:11 CST  today at 12:15 CST  Install "go" snap
3    Done    today at 11:11 CST  today at 11:11 CST  Initialize device