How to add apt package manager in yocto project?

Hello world,
I’m using IMX6DL and I’m using yocto reference multimedia reference image, now i want to include apt package manager in this Image, which will be included in production also so, how to include this package manager in yocto Image?

Regards,
Nolan

Hi @Nolan_Maverick,

First, you need to configure YP to use Debian package management to create the package feeds. For that set PACKAGE_CLASSES = "package_deb" in build/conf/local.conf.

Second, you need add the package manager to your images. For that set package-management to the IMAGE_FEATURES variable in build/conf/local.conf.

Cheers,
:rjs

Thanks @RudolfStreif , apt package manger is installed, this my sources.list file.

# deb http://snapshot.debian.org/archive/debian/20220509T000000Z bullseye main
deb http://deb.debian.org/debian bullseye main
# deb http://snapshot.debian.org/archive/debian-security/20220509T000000Z bullseye-security main
deb http://security.debian.org/debian-security bullseye-security main
# deb http://snapshot.debian.org/archive/debian/20220509T000000Z bullseye-updates main
deb http://deb.debian.org/debian bullseye-updates main
deb https://feeds.toradex.com/debian/snapshots/20220512T021145Z testing main non-free

and when I try to update using

apt-get update
This is the error I’m getting how to solve this issue

Get:1 http://security.debian.org/debian-security bullseye-security InRelease [48.4 kB]
Get:2 http://deb.debian.org/debian bullseye InRelease [116 kB]
Get:3 http://deb.debian.org/debian bullseye-updates InRelease [44.1 kB]
Err:1 http://security.debian.org/debian-security bullseye-security InRelease
gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
Err:2 http://deb.debian.org/debian bullseye InRelease
gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
Err:3 http://deb.debian.org/debian bullseye-updates InRelease
gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
Get:4 https://feeds.toradex.com/debian/snapshots/20220512T021145Z testing InRelease [13.0 kB]
Err:4 https://feeds.toradex.com/debian/snapshots/20220512T021145Z testing InRelease
gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
Reading package lists... Done
W: GPG error: http://security.debian.org/debian-security bullseye-security InRelease: gpgv, gpgv2 ord
E: The repository 'http://security.debian.org/debian-security bullseye-security InRelease' is not si.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://deb.debian.org/debian bullseye InRelease: gpgv, gpgv2 or gpgv1 required for verd
E: The repository 'http://deb.debian.org/debian bullseye InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://deb.debian.org/debian bullseye-updates InRelease: gpgv, gpgv2 or gpgv1 requiredd
E: The repository 'http://deb.debian.org/debian bullseye-updates InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: https://feeds.toradex.com/debian/snapshots/20220512T021145Z testing InRelease: gpgv, gd
E: The repository 'https://feeds.toradex.com/debian/snapshots/20220512T021145Z testing InRelease' is.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

Regards,
Nolan

For pulling from remote repositories you need the GNU Privacy Guard signature verification tools. Add them to your image by adding gnupg to IMAGE_INSTALL.

You need of course also create a key, sign the packages on the server and install the key on your target.

BR,
:rjs

Thanks @RudolfStreif ,
it worked, now update is happening good, but while running
$apt-get upgrade

I’m facing this issue

root@colibri-imx6-10909128:~# apt-get upgrade             
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  attr automake base-files base-passwd bash-completion bonnie++ cpp evtest file g++ gawk gcc hostapd libattr1 libcap-dev libcrypt-dev libgmp-dev libgmp10 libice-dev libice6 libpci3 libprocps8 libsm-dev
  libsm6 libwrap0 libx11-6 libx11-dev libx11-xcb1 libxext-dev libxext6 libxi-dev libxi6 libxinerama1 libxrandr-dev libxrandr2 libxtst-dev libxtst6 libxv1 mime-support mtd-utils openssh-sftp-server
  pciutils procps ptpd python3-numpy xwayland
The following packages will be upgraded:
  busybox ethtool liborc-0.4-0 libusb-1.0-0 libxaw7 libxmu6 lrzsz usbutils
8 upgraded, 0 newly installed, 0 to remove and 46 not upgraded.
Need to get 1183 kB of archives.
After this operation, 2996 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://deb.debian.org/debian bullseye/main armhf busybox armhf 1:1.30.1-6+b3 [424 kB]
Get:2 http://deb.debian.org/debian bullseye/main armhf ethtool armhf 1:5.9-1 [170 kB]
Get:3 http://deb.debian.org/debian bullseye/main armhf liborc-0.4-0 armhf 1:0.4.32-1 [157 kB]
Get:4 http://deb.debian.org/debian bullseye/main armhf libusb-1.0-0 armhf 2:1.0.24-3 [54.6 kB]
Get:5 http://deb.debian.org/debian bullseye/main armhf libxmu6 armhf 2:1.1.2-2+b3 [52.7 kB]
Get:6 http://deb.debian.org/debian bullseye/main armhf libxaw7 armhf 2:1.0.13-1.1 [167 kB]
Get:7 http://deb.debian.org/debian bullseye/main armhf lrzsz armhf 0.12.21-10 [85.0 kB]
Get:8 http://deb.debian.org/debian bullseye/main armhf usbutils armhf 1:013-3 [72.3 kB]
Fetched 1183 kB in 1s (1937 kB/s)
tar: error while loading shared libraries: libselinux.so.1: cannot open shared object file: No such file or directory
dpkg-deb: error: tar subprocess returned error exit status 127
dpkg: error processing archive /tmp/apt-dpkg-install-gxWgHi/0-busybox_1%3a1.30.1-6+b3_armhf.deb (--unpack):
 dpkg-deb --control subprocess returned error exit status 2
tar: error while loading shared libraries: libselinux.so.1: cannot open shared object file: No such file or directory
dpkg-deb: error: tar subprocess returned error exit status 127
dpkg: error processing archive /tmp/apt-dpkg-install-gxWgHi/1-ethtool_1%3a5.9-1_armhf.deb (--unpack):
 dpkg-deb --control subprocess returned error exit status 2
tar: error while loading shared libraries: libselinux.so.1: cannot open shared object file: No such file or directory
dpkg-deb: error: tar subprocess returned error exit status 127
dpkg: error processing archive /tmp/apt-dpkg-install-gxWgHi/2-liborc-0.4-0_1%3a0.4.32-1_armhf.deb (--unpack):
 dpkg-deb --control subprocess returned error exit status 2
tar: error while loading shared libraries: libselinux.so.1: cannot open shared object file: No such file or directory
dpkg-deb: error: tar subprocess returned error exit status 127
dpkg: error processing archive /tmp/apt-dpkg-install-gxWgHi/3-libusb-1.0-0_2%3a1.0.24-3_armhf.deb (--unpack):
 dpkg-deb --control subprocess returned error exit status 2
tar: error while loading shared libraries: libselinux.so.1: cannot open shared object file: No such file or directory
dpkg-deb: error: tar subprocess returned error exit status 127
dpkg: error processing archive /tmp/apt-dpkg-install-gxWgHi/4-libxmu6_2%3a1.1.2-2+b3_armhf.deb (--unpack):
 dpkg-deb --control subprocess returned error exit status 2
tar: error while loading shared libraries: libselinux.so.1: cannot open shared object file: No such file or directory
dpkg-deb: error: tar subprocess returned error exit status 127
dpkg: error processing archive /tmp/apt-dpkg-install-gxWgHi/5-libxaw7_2%3a1.0.13-1.1_armhf.deb (--unpack):
 dpkg-deb --control subprocess returned error exit status 2
tar: error while loading shared libraries: libselinux.so.1: cannot open shared object file: No such file or directory
dpkg-deb: error: tar subprocess returned error exit status 127
dpkg: error processing archive /tmp/apt-dpkg-install-gxWgHi/6-lrzsz_0.12.21-10_armhf.deb (--unpack):
 dpkg-deb --control subprocess returned error exit status 2
tar: error while loading shared libraries: libselinux.so.1: cannot open shared object file: No such file or directory
dpkg-deb: error: tar subprocess returned error exit status 127
dpkg: error processing archive /tmp/apt-dpkg-install-gxWgHi/7-usbutils_1%3a013-3_armhf.deb (--unpack):
 dpkg-deb --control subprocess returned error exit status 2

Can you give some solution on how to solve this problem

Warm regards,
Nolan

It’s looking for libselinux. It’s kind of strange as it is not a regular dependency. You can try to add meta-selinux to your layers and then add libselinux to IMAGE_INSTALL.