Issues while packaging in ubuntu 14.04

I’ve been trying to learn how to package an app in ubuntu 14.04 and have been running into random issues where I can’t even package a simple hello-world app. I understand ubntu 16 is the recommended host but I need to use 14.04 because of our development environment.

I was trying to learn using the documentation of the offlineimap from this link and here’s my output.

    vagrant@ubuntu14:~/hello$ sudo snapcraft
pyversions -d
Pulling offlineimap 
Ign trusty InRelease                                                                                                                                               
Get:1 trusty-security InRelease [65.9 kB]                                                                                                                            
Get:2 trusty-updates InRelease [65.9 kB]                                                                                                                           
Get:3 trusty-security/main amd64 Packages [735 kB]                                                                                                                   
Get:4 trusty Release.gpg [933 B]                                                                                                                                   
Get:5 trusty-updates/main amd64 Packages [1080 kB]                                                                                                                 
Get:6 trusty-security/restricted amd64 Packages [14.2 kB]                                                                                                            
Get:7 trusty-updates/restricted amd64 Packages [17.2 kB]                                                                                                           
Get:8 trusty-security/universe amd64 Packages [229 kB]                                                                                                               
Get:9 trusty-updates/universe amd64 Packages [455 kB]                                                                                                              
Get:10 trusty-security/multiverse amd64 Packages [4799 B]                                                                                                            
Get:11 trusty-updates/multiverse amd64 Packages [14.6 kB]                                                                                                          
Get:12 trusty-security/main Translation-en [402 kB]                                                                                                                  
Get:13 trusty-updates/main Translation-en [534 kB]                                                                                                                 
Get:14 trusty-security/multiverse Translation-en [2564 B]                                                                                                            
Get:15 trusty-updates/multiverse Translation-en [7616 B]                                                                                                           
Get:16 trusty-security/restricted Translation-en [3556 B]                                                                                                            
Get:17 trusty-updates/restricted Translation-en [4021 B]                                                                                                           
Get:18 trusty-security/universe Translation-en [126 kB]                                                                                                              
Get:19 trusty-updates/universe Translation-en [244 kB]                                                                                                             
Get:20 trusty Release [58.5 kB]                                                                                                                                    
Get:21 trusty/main amd64 Packages [1350 kB]                                                                                                                        
Get:22 trusty/restricted amd64 Packages [13.0 kB]                                                                                                                  
Get:23 trusty/universe amd64 Packages [5859 kB]                                                                                                                    
Get:24 trusty/multiverse amd64 Packages [132 kB]                                                                                                                   
Get:25 trusty/main Translation-en [762 kB]                                                                                                                         
Get:26 trusty/multiverse Translation-en [102 kB]                                                                                                                   
Get:27 trusty/restricted Translation-en [3457 B]                                                                                                                   
Get:28 trusty/universe Translation-en [4089 kB]                                                                                                                    
Fetched 16.4 MB in 6s (815 kB/s)                                                                                                                                                                
Skipping blacklisted from manifest packages: ['adduser', 'apt', 'apt-utils', 'base-files', 'base-passwd', 'bash', 'bsdutils', 'coreutils', 'dash', 'debconf', 'debconf-i18n', 'debianutils', 'diffutils', 'dmsetup', 'dpkg', 'e2fslibs', 'e2fsprogs', 'file', 'findutils', 'gcc-4.9-base', 'gnupg', 'gpgv', 'grep', 'gzip', 'hostname', 'initscripts', 'insserv', 'libacl1', 'libapparmor1', 'libapt-inst1.5', 'libapt-pkg4.12', 'libattr1', 'libaudit-common', 'libaudit1', 'libblkid1', 'libbz2-1.0', 'libc-bin', 'libc6', 'libcap2', 'libcap2-bin', 'libcomerr2', 'libcryptsetup4', 'libdb5.3', 'libdebconfclient0', 'libdevmapper1.02.1', 'libgcc1', 'libgcrypt20', 'libgpg-error0', 'libgpm2', 'libkmod2', 'liblocale-gettext-perl', 'liblzma5', 'libmagic1', 'libmount1', 'libncurses5', 'libncursesw5', 'libpam-modules', 'libpam-modules-bin', 'libpam-runtime', 'libpam0g', 'libpcre3', 'libprocps3', 'libreadline6', 'libselinux1', 'libsemanage-common', 'libsemanage1', 'libsepol1', 'libslang2', 'libss2', 'libstdc++6', 'libtext-charwidth-perl', 'libtext-iconv-perl', 'libtext-wrapi18n-perl', 'libtinfo5', 'libudev1', 'libusb-0.1-4', 'libustr-1.0-1', 'libuuid1', 'locales', 'login', 'lsb-base', 'makedev', 'manpages', 'manpages-dev', 'mawk', 'mount', 'multiarch-support', 'ncurses-base', 'ncurses-bin', 'passwd', 'perl-base', 'procps', 'readline-common', 'sed', 'sensible-utils', 'systemd', 'sysv-rc', 'sysvinit-utils', 'tar', 'tzdata', 'ubuntu-keyring', 'udev', 'util-linux', 'zlib1g']
Get:1 trusty-updates/main libexpat1 amd64 2.1.0-4ubuntu1.4 [70.9 kB]                                                                                       
Get:2 trusty-updates/main libffi6 amd64 3.1~rc1+r3.0.13-12ubuntu0.2 [17.9 kB]                                                                              
Get:3 trusty-updates/main libsqlite3-0 amd64 3.8.2-1ubuntu2.1 [342 kB]                                                                                     
Get:4 trusty-updates/main libssl1.0.0 amd64 1.0.1f-1ubuntu2.25 [831 kB]                                                                                    
Get:5 trusty-updates/main libpython2.7-minimal amd64 2.7.6-8ubuntu0.4 [307 kB]                                                                             
Get:6 trusty-updates/main mime-support all 3.54ubuntu1.1 [29.3 kB]                                                                                         
Get:7 trusty-updates/main libpython2.7-stdlib amd64 2.7.6-8ubuntu0.4 [1869 kB]                                                                             
Get:8 trusty-updates/main libpython2.7 amd64 2.7.6-8ubuntu0.4 [1040 kB]                                                                                    
Get:9 trusty-updates/main libc-dev-bin amd64 2.19-0ubuntu6.14 [69.0 kB]                                                                                    
Get:10 trusty-updates/main linux-libc-dev amd64 3.13.0-149.199 [774 kB]                                                                                    
Get:11 trusty-updates/main libc6-dev amd64 2.19-0ubuntu6.14 [1913 kB]                                                                                      
Get:12 trusty-updates/main libexpat1-dev amd64 2.1.0-4ubuntu1.4 [115 kB]                                                                                   
Get:13 trusty-updates/main libpython2.7-dev amd64 2.7.6-8ubuntu0.4 [22.0 MB]                                                                               
Get:14 trusty-updates/main python2.7-minimal amd64 2.7.6-8ubuntu0.4 [1188 kB]                                                                              
Get:15 trusty/main libpython-dev amd64 2.7.5-5ubuntu3 [7078 B]                                                                                             
Get:16 trusty/main libpython-stdlib amd64 2.7.5-5ubuntu3 [7012 B]                                                                                          
Get:17 trusty-updates/main python2.7 amd64 2.7.6-8ubuntu0.4 [196 kB]                                                                                       
Get:18 trusty/main python-minimal amd64 2.7.5-5ubuntu3 [27.5 kB]                                                                                           
Get:19 trusty/main python amd64 2.7.5-5ubuntu3 [134 kB]                                                                                                    
Get:20 trusty-updates/main python2.7-dev amd64 2.7.6-8ubuntu0.4 [269 kB]                                                                                   
Get:21 trusty/main python-dev amd64 2.7.5-5ubuntu3 [1166 B]                                                                                                
Get:22 trusty-updates/main python-pkg-resources all 3.3-1ubuntu2 [61.9 kB]                                                                                 
Get:23 trusty-updates/main python-setuptools all 3.3-1ubuntu2 [230 kB]                                                                                     
Fetched 31.5 MB in 6s (2459 kB/s)                                                                                                                                                               
pyversions -d
Building offlineimap 
pyversions -d
Staging offlineimap 
pyversions -d
Snapping offlineimap 
pyversions -d
Traceback (most recent call last):
  File "/usr/bin/snapcraft", line 33, in <module>
  File "/usr/lib/python3/dist-packages/snapcraft/", line 148, in main
  File "/usr/lib/python3/dist-packages/snapcraft/", line 104, in assemble
    stderr=subprocess.PIPE,) as proc:
  File "/usr/lib/python3.4/", line 859, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.4/", line 1457, in _execute_child
    raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'snappy'

From that guide:-

“Note: We strongly recommend using an Ubuntu 16.04 host, VM or container for this guide. While it is possible to use newer releases of Ubuntu, or other Linux distributions, this may result in incorrect libraries being pulled into the build.”

You’re using 14.04, and should be using 16.04, or a VM running 16.04. Then you’ll have more success :slight_smile:

Also, you ran sudo snapcraft but the guide says snapcraft without sudo.

hi, thanks for replying to my question.

As I mentioned in the first post, I HAVE to stick to 14.04 because thats our production environment. This was just an example of the failure but the same thing has been happening even for hello-world.

Is there any tutorial / link that you know of which deals with ubuntu 14.04 (trusty)?

You can build in a 16.04 VM though, surely?

Yeah, however there’s no point in building it in 16.04 in a VM because when I goto package the actual app it would be on 14.04 so I want to stick to 14.04 while I am learning.

No, you build and package the snap on 16.04. It will be installable on 14.04, 16.04 and beyond.

1 Like

Are you not able to use LXD to build the snap? You’re not permitted to build using LXD on 14.04 (LXD would be using a 16.04 container but running on 14.04).