Why my program installed using snap not use librery that I have include on snap packages?

40 Views Asked by At

Sorry for my english. I created an application. I would like to package it in snap format. I do it. Unfortunately, when I start the application (after I installed it on a PC with newly installed Ubuntu 22.04, I obviously use a virtual machine to test) it does not look for the libraries in the snap folder but in the operating system. Obviously on the PC where I created the app it works but on a newly installed system it cannot start. Since snaps like flatpaks give the possibility to install an application with all dependencies included, I would like the program to take the libraries that I put inside the snap (which are the ones the program needs to run). The snapcraft.yaml file is configured like this:

  name: lamiavideoteca  
    base: core22 
    version: "2.40" 
    summary: Program for cataloging Films description: Program that allows you to catalog your collection of Films and/or Video/Audio.  
    grade: stable 
    confinement: strict
        
    parts: 
     lamiavideoteca: 
       plugin: dump 
       source: .
        
    apps: 
     lamiavideoteca: 
       command: usr/bin/LaMiaVideoteca                       
       desktop: usr/share/applications LaMiaVideoteca.desktop
        
    environment:  
    QT_PLUGIN_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt6/plugins:$QT_PLUGIN_PATH 
    LD_LIBRARY_PATH: $LD_LIBRARY_PATH:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET

As you can see from the code I set the environment variables to show the libraries to the application. The package is generated but when I start it from the terminal I notice that it does not find the necessary libraries, which are present in the /snap/lamiavideoteca/current/usr/lib folder.

I tryed change librery location on snap. I change snapcraft.yaml (I used stage... stage-packages) but nothing works and the programs search the library on usr/lib and not on snap/lamiavideoteca/usr/lib. Why? Thanks for the answer

0

There are 0 best solutions below