Explore the field guideDocumentationField guidesCommunitySearchStoreJournal

2024-07-01

A quick application build: the original Linyaps introductory tutorial

The original introductory build lesson: install the tools, prepare a project, convert an application and consult the troubleshooting section.

Linyaps
As a new type of independent package management toolset, Linyaps mainly provides a layered and isolated operating environment to solve the compatibility issues caused by the strong dependence of traditional package management systems and the security issues caused by loose permissions. Currently, Linyaps supports 4 distributions, including deepin, UnionTech UOS, Debian and Ubuntu. Linyaps' isolation technology can completely decouple applications and systems, thereby completely solving problems such as compatibility conflicts caused by upgrades and adaptations between systems and applications, and between applications and applications. For developers, this can effectively reduce development costs; for customers, it can reduce enterprise operation and maintenance costs; and for the entire industry, it will help the steady development of the industry.


Install Linyaps

This article will introduce you to the installation of UOS 1070 and deepin V23 Linyaps.

Note: This document applies to 1.5.0, please use ll-cli –version to check your Linyaps program version.

Linyaps consists of three parts:

ll-builder is used to build and debug Linyaps applications, provided by linglong-builder;
ll-box sandbox container, provided by linglong-box;
ll-cli manages and runs Linyaps applications, provided by linglong-bin.

1、UOS 1070

Currently supports amd64, arm64, and loongarch64 (Loongson old world) architectures.
1) Add Linyaps repository source
echo "deb [trusted=yes] https://ci.deepin.com/repo/deepin/deepin-community
/linglong-repo/ unstable main" | sudo tee -a /etc/apt/sources.list
2) Install Linyaps build toolkit

sudo apt update

sudo apt install linglong-builder linglong-box linglong-bin

2、deepin V23

Currently supports amd64 and arm64 architectures.

sudo apt install linglong-builder linglong-box linglong-bin

Install pica tool

This tool currently provides the ability to convert deb packages into Linyaps packages, generate the linglong.yaml file required to build Linyaps applications, and rely on ll-builder to implement application building and export.

1、UOS 1070

Currently supports amd64 and arm64 architectures.

According to the Linyaps installation steps, add the Linyaps repository source

sudo apt install linglong-pica

2、deepin V23

Currently supports amd64 and arm64 architectures.

sudo apt install linglong-pica

Invite you to experience the 10-minute quick build

1. Build examples from scratch

uses deepin-calculator as an example of building a Linyaps application from source code. The appid of the Linyaps application needs to be named using the inverted domain name.

1) Create

mkdir org.deepin.calculator

Create the linglong.yaml file in the directory

touch org.deepin.calculator/linglong.yaml

Enter directory

cd org.deepin.calculator

Edit linglong.yaml using a text editor

A quick application build: the original Linyaps introductory tutorial — source illustration

The linglong.yaml file follows the yaml syntax specification.

2) Build

ll-builder build

Wait for the Linyaps application to be built.

3) Run Linyaps application

ll-builder run

ll-builder run successfully runs and the output is as follows:

A quick application build: the original Linyaps introductory tutorial — source illustration

In order to facilitate debugging, you can use the additional –exec /bin/bash parameter to replace the program that is executed by default after entering the container, such as:

ll-builder run –exec /bin/bash

2. Convert deb application

Taking Baidu Netdisk as an example, we introduce the process of converting deb packages to Linyaps packages. Currently, only software that follows app store packaging specifications is supported.

1) Get the deb package file

apt download com.baidu.baidunetdisk

2) Conversion application
ll-pica convert -c com.baidu.baidunetdisk_4.17.7_amd64.deb -w work -b

Enter directory

cd work/package/com.baidu.baidunetdisk/amd64

3) Install layer file

ll-cli install ./com.baidu.baidunetdisk_4.17.7.0_x86_64_runtime.layer

4) Run the application

ll-cli run com.baidu.baidunetdisk

A quick application build: the original Linyaps introductory tutorial — source illustration

FAQ

1. Common construction problems

1) cmake type build fails with -lxxx, but both ldconfig and pkg-config can query the library information.

The link library path is not in the regular path, the new path is /runtime/lib.

Add environment variable LIBRARY_PATH=<libpath>, which is currently included in the build environment by default.

2) Linking the static library fails during building and requires re-building using fPIC.

Use the -fPIC parameter when building static libraries.

3) Failed to start box during build, as shown below:

Picture

The kernel does not support unprivilege namespace. Enable unprivilege namespace to solve the problem.

sudo sysctl -w kernel.unprivileged_userns_clone=1

4) qtbase is built successfully, but the qt application cannot be built, prompting module and mkspec related errors.

There is a problem with the lower version of fuse-overlay mount, which causes the file content to be contaminated during qtbase commit and cannot be used normally. Use fuse-overlayfs >= version 1.7.

2. Common operating problems

1) The application runs and reads the application installation resource files under /usr/share. Why does the reading fail?
Linyaps application runs in a container environment, and application data will be mounted under /opt/apps/<appid>/. The /usr/share directory will only contain system data, not application-related data. Therefore reading /usr/share directly will fail.
Recommendation: Use the XDG_DATA_DIRS environment variable to read resources. /opt/apps/<appid>/files/share will exist in the search path of this environment variable.
2) The font library file cannot be found when the application is running? Why can the corresponding font library be read when the deb package is installed?
When installing the deb package, it will depend on the corresponding font library file. The Linyaps package format adopts a self-sufficient packaging format.
In addition to the basic system libraries, the Qt library and DTK library files provided in the runtime, you do not need to provide them yourself. Other dependent data files need to be provided by yourself.
Recommendation: Put the corresponding data files into files/share and use the environment variable XDG_DATA_DIRS to read the path.
3) What is in the Linyaps application runtime? Can I add some library files to it?
Currently, the runtime that Linyaps application depends on provides Qt library and DTK library. Because the runtime has strict size restrictions, adding additional library files to the runtime is currently not allowed.
4) The application runs in a container. Can a configuration file be created in any path of the container during operation?
Configuration files can be created under XDG_CONFIG_HOME.
5) Where is application data saved? Where can I find it outside the container?
Because Linyaps application follows the principle of non-interference.
XDG_DATA_HOME、
XDG_CONFIG_HOME、
XDG_CACHE_HOME
Environment variables are defined in the path corresponding to the host ~/.linglong/<appid>/, so user application data will be saved in this path. When the application is running and writing data, it should also read the corresponding environment variables and write the data. Reading and writing configurations of other applications is prohibited.
6) The application provides a dbus service file, how to place it? What to write in the Exec section?
When an application provides a dbus service file, it needs to be placed in the entries/dbus-1/services directory. If Exec executes a binary in the Linyaps package, use the –exec option parameter to execute the corresponding binary.
7) After the application is installed, the launcher cannot be found?
TryExec=xxx, when xxx does not exist in the $PATH path, it will be considered that the application does not exist and will not be displayed.
8) Why does the icon appear as a small black dot?
Desktop writes the Icon field, and the Icon field name is incorrect or uses an absolute path.
9) Why does the icon appear as a gear?
desktop does not provide an Icon field.
10) In which path are the icons stored?
svg →$PREFIX/share/icons/hicolor/scalable/apps/

Other formats are stored according to resolution, such as 16X16

png/xpm → $PREFIX/share/icons/hicolor/16X16/apps/

11) Why do the xdg-open and xdg-email that come with the application fail?
Linyaps specially handles xdg-open and xdg-email in the runtime, so the application is prohibited from executing the xdg-open and xdg-email executable files or scripts it carries.

12) The application’s use of system environment variables does not take effect, why?

When using environment variables, you need to confirm whether the corresponding environment variables exist in the container. If not, you need to contact the Linyaps team to handle it.
13) The library files required for application operation are not found. How to provide them?
The resource files and library files that the application needs to use need to be provided by the application itself. The library files are placed in the $PREFIX/lib path.
14) Why does the Qt WebEngine rendering process crash when the application is running?
Because the system upgraded glibc, the application failed to use the built-in browser and the application needed to be re-adapted.
A temporary solution is to set an environment variable:
export QTWEBENGINE_DISABLE_SANDBOX=1。
15) When the application is running, the libqxcb.so library cannot be found or qtwebengine reports an error?
When the qt.conf file exists, configure the correct path in the file, or use
QTWEBENGINEPROCESS_PATH、
QTWEBENGINE_RESOURCES_PATH、
QT_QPA_PLATFORM_PLUGIN_PATH、
QT_PLUGIN_PATH environment variable configures the search path.
16) Can the application carry the database file itself and write data to the database during operation?
The file system in the container is a read-only file system and does not allow data to be written to application resource files.
17) Why does executing a binary with suid and guid permissions fail?
To ensure system security, the Linyaps container prohibits the execution of such permissioned binaries within the container.
18) The uab offline package format cannot be used as input method under Debian and Ubuntu?
It is recommended to install fictx input method and experience it.
19) How to know which packages are installed in the container environment?
ll-builder run –exec bash Enter the container environment and use the cat /var/lib/dpkg/status | grep "^Package: " command to view the pre-installed software packages. In addition, the source code compiled libraries can be viewed using cat /runtime/packages.list.

English edition: Linglong editorial · 18 October 2026. Original publication: 2024-07-01.