Trying to use 18.04 packages on 20.04 machine snapcraft build

So when running “snapcraft --destructive-mode” command. I get this output:

The 'qt515' part is missing libraries that are not included in the snap or base. They can be satisfied by adding the following entries to the existing stage-packages for this part:
- libdouble-conversion1
- libevent-2.1-6
- libhunspell-1.6-0
- libicu60
- libmysqlclient20

And when those stage packages are added to the part with " sudo apt-get install -y libevent-2.1-6" you get this output, for each of the packages given above. Each of those packages when trying to do apt-get install show that they are already downloaded:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
libevent-2.1-6 is already the newest version (2.1.8-stable-4build1).
The following package was automatically installed and is no longer required:
  libasound2-dev
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

But then when trying to rerun “snapcraft --destructive-mode” it is circling errors between each of those libraries above that it cant find them:

Failed to fetch stage packages: Error downloading packages for part 'qt515': The package 'libevent-2.1-6' was not found..

So I have those packages downloaded but the build still complains about them, unsure why? How do I fix this? I am trying to have a backwards compatible app.

you do not download any stage packages, snapcraft does this internally after you added them to the stage-packages: entry of your part:

I added those like so:

parts:
  qt515:
    plugin: dump
    source: /opt/qt51512/qt51512_5.15.12-wickr_amd64.deb
    source-type: deb
    stage-packages:
      - libasn1-8-heimdal
      - libatk-bridge2.0-0
      - libatk1.0-0
      - libatspi2.0-0
      - libavahi-client3
      - libavahi-common3
      - libcairo-gobject2
      - libcairo2
      - libclang1-6.0
      - libcups2
      - libdatrie1
      - libdouble-conversion1 #libdouble-conversion3 #
      - libdrm2
      - libegl1
      - libepoxy0
      - libevent-2.1-6
      ...

For all of them. But it still gives the errors:

Failed to fetch stage packages: Error downloading packages for part 'qt515': The package 'libevent-2.1-6' was not found..

for each of the libdouble-conversion1, libevent-2.1-6, libhunspell-1.6-0, libicu60, libmysqlclient20 packages.

How do I resolve this @ogra ?

looks like there is no -2.1-6 version anywhere in ubuntu:

try if -2.1-7 works to fulfill the requirement instead …

But then it will give this output:

The 'qt515' part is missing libraries that are not included in the snap or base. They can be satisfied by adding the following entries to the existing stage-packages for this part:
- libdouble-conversion1
- libevent-2.1-6
- libhunspell-1.6-0
- libicu60
- libmysqlclient20

Thats why I tried downloading them from the archive ubuntu website:

wget http://ftp.br.debian.org/debian/pool/main/d/double-conversion/libdouble-conversion1_3.1.0-3_amd64.deb

wget http://archive.ubuntu.com/ubuntu/pool/main/libe/libevent/libevent-2.1-6_2.1.8-stable-4build1_amd64.deb

wget  http://archive.ubuntu.com/ubuntu/pool/main/h/hunspell/libhunspell-1.6-0_1.6.2-1_amd64.deb

wget  http://archive.ubuntu.com/ubuntu/pool/main/i/icu/libicu60_60.2-3ubuntu3.2_amd64.deb

Manually download libmysqlclient20_5.7.42-1ubuntu18.04_amd64.deb
From  https://dev.mysql.com/downloads/mysql/5.7.html


sudo chmod +x libdouble-conversion1_3.1.0-3_amd64.deb libevent-2.1-6_2.1.8-stable-4build1_amd64.deb libhunspell-1.6-0_1.6.2-1_amd64.deb libicu60_60.2-3ubuntu3.2_amd64.deb libmysqlclient20_5.7.42-1ubuntu18.04_amd64.deb 

sudo dpkg -i libdouble-conversion1_3.1.0-3_amd64.deb libevent-2.1-6_2.1.8-stable-4build1_amd64.deb libhunspell-1.6-0_1.6.2-1_amd64.deb libicu60_60.2-3ubuntu3.2_amd64.deb libmysqlclient20_5.7.42-1ubuntu18.04_amd64.deb 

Like that ^. But it still has issues… @ogra Any thoughts?

Is there a particular reason you’re trying to do this with destructive mode? Running with destructive mode on a different platform to the base you’re using can result in a lot of issues - if you need to use destructive mode, I’d recommend firing up a VM that matches your snap’s base and running snapcraft inside of that.

1 Like