如何在 14.04 上安装 Snapcraft?

如何在 14.04 上安装 Snapcraft?

我正在尝试关注准备就绪在 Ubuntu 14.04 上安装 Snapcraft 的说明(该文档对 14.04 和 16.04 有歧义,但1.x安装过程似乎完全相同)。

我按照步骤操作,没有出现错误,但是无法snapcraft安装。

  • 检查版本:

    $ lsb_release -a
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description:    Ubuntu 14.04.4 LTS
    Release:    14.04
    Codename:   trusty
    
  • 添加存储库:

    $ sudo apt-add-repository ppa:snappy-dev/tools
    ...
    OK
    
  • 运行更新:

    $ sudo apt update
    ... (altogether 57 lines, no error) ...
    Reading package lists... Done
    
  • 安装snappy-tools

    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following extra packages will be installed:
      android-tools-adb android-tools-fastboot apparmor-easyprof binfmt-support click-reviewers-tools click-ubuntu-policy
      debsig-verify kpartx libxmltok1 python3-apparmor python3-bs4 python3-html5lib python3-libapparmor python3-lxml python3-magic
    Preparing to unpack .../snappy-tools_10_amd64.deb ...
    Unpacking snappy-tools (10) ...
    Processing triggers for ureadahead (0.100.0-19) ...
    Processing triggers for systemd (225-1ubuntu9) ...
    Processing triggers for man-db (2.7.4-1) ...
    Setting up binfmt-support (2.1.5-1) ...
    Setting up python3-lxml (3.4.4-1) ...
    Setting up python3-magic (1:5.22+15-2ubuntu1) ...
    Setting up python3-simplejson (3.7.3-1ubuntu1) ...
    Setting up python3-xdg (0.25-4) ...
    Setting up click-reviewers-tools (0.34) ...
    Setting up libxmltok1 (1.2-3build3) ...
    Setting up debsig-verify (0.13) ...
    Setting up python3-bs4 (4.3.2-2ubuntu4) ...
    Setting up python3-html5lib (0.999-3build1) ...
    Setting up qemu-user-static (1:2.3+dfsg-5ubuntu9.2) ...
    Setting up seccomp (2.2.3-2ubuntu1) ...
    Setting up snappy-remote (0.4-0ubuntu1build1) ...
    # -*- mode: ruby -*-
    Setting up android-tools-adb (4.2.2+git20130218-3ubuntu42) ...
    Setting up android-tools-fastboot (4.2.2+git20130218-3ubuntu42) ...
    Setting up click-ubuntu-policy (0.1) ...
    Setting up kpartx (0.5.0-7ubuntu7.1) ...
    Setting up ubuntu-snappy-cli (1.5ubuntu1) ...
    Warning: The home dir /nonexistent you specified can't be accessed: No such file or directory
    Adding system user `snappypkg' (UID 115) ...
    Adding new group `snappypkg' (GID 121) ...
    Adding new user `snappypkg' (UID 115) with group `snappypkg' ...
    Not creating home directory `/nonexistent'.
    Setting up ubuntu-device-flash (0.31-0ubuntu1) ...
    Setting up ubuntu-core-security-seccomp (15.10.17) ...
    Setting up python3-libapparmor (2.10-0ubuntu6) ...
    
  • 验证安装:

    $ which snappy
    /usr/bin/snappy
    $ which snappy-remote
    /usr/bin/snappy-remote
    $ which snapcraft
    $ snapcraft
    snapcraft: command not found
    $ find / -name snapcraft 2> /dev/null
    $
    

我这里遗漏了什么吗?

尽管安装时snappysnappy-remote出现错误:

$ snappy try
Unknown command `try'. Please specify one command of: booted, build, config, firstboot, hw-assign, hw-info, hw-unassign, info, install, internal-run-hooks, internal-unpack, list, login, purge, remove, rollback, search, set, update or versions
$ snappy-remote
the required flag `--url' was not specified

答案1

看来我们的 14.04 打包元数据中有一个错误。这个问题将会被修复,但是如果你遇到这种情况,只需确保安装了 snapcraft 即可:

sudo apt install snapcraft

只要snappy trysnappy-remote给出一些输出,就意味着它们已安装。我们将--help在未来版本中将它们替换为 ,因为它们在没有任何参数的情况下触发的错误可能会令人费解。

答案2

Snapcraft 也可以snap自行安装:

sudo snap install snapcraft

apt但我不知道这是否是一种更好的方法。

相关内容