gardenlinux icon indicating copy to clipboard operation
gardenlinux copied to clipboard

How to deal with apt Package Versions?

Open dnan0s opened this issue 1 year ago • 1 comments

I never quite understood how to best deal with version issues, when you want to install packages from Debian sources.

From my understanding Garden Linux Sources are often more up to date than Debian sources, but they lack the huge amount of packages Debian offers, am i right?

What happened:

I am trying to install those packages: apt install -y build-essential debhelper devscripts fakeroot git libaio-dev libboost-filesystem-dev libboost-program-options-dev libboost-thread-dev libncurses-dev libnuma-dev libssl-dev lintian

Debug Logs:

Trying to install in a fresh vanilla Garden Linux (Container)

root@04b0cd0c26ee:/#     apt install -y build-essential debhelper devscripts fakeroot git libaio-dev libboost-filesystem-dev libboost-program-options-dev libboost-thread-dev libncurses-dev libnuma-dev libssl-dev lintian     
Package lintian is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package fakeroot is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package libncurses-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Error: Package 'fakeroot' has no installation candidate
Error: Unable to locate package libaio-dev
Error: Unable to locate package libboost-filesystem-dev
Error: Unable to locate package libboost-program-options-dev
Error: Unable to locate package libboost-thread-dev
Error: Package 'libncurses-dev' has no installation candidate
Error: Unable to locate package libnuma-dev
Error: Package 'lintian' has no installation candidate

now i have added Debian Sources, as packages were obviously not available

this can be fixed mostly manually by carefully cherrypicking the correct versions, so apt doesn't need to cry. ...

root@04b0cd0c26ee:/# nano /etc/apt/sources.list.d/debian.list
root@04b0cd0c26ee:/# apt update
Hit:1 http://deb.debian.org/debian bookworm InRelease
Get:2 http://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB]
Get:3 http://deb.debian.org/debian bookworm-updates InRelease [55.4 kB]     
Get:4 http://deb.debian.org/debian-security bookworm-security/non-free-firmware Sources [796 B]
Get:5 https://packages.gardenlinux.io/gardenlinux today InRelease [1738 B]                                    
Get:6 http://deb.debian.org/debian-security bookworm-security/main Sources [101 kB]
Get:7 http://deb.debian.org/debian-security bookworm-security/main amd64 Packages [165 kB]
Get:8 http://deb.debian.org/debian-security bookworm-security/non-free-firmware amd64 Packages [688 B]
Get:9 http://deb.debian.org/debian bookworm-updates/non-free-firmware Sources [2076 B]
Get:10 http://deb.debian.org/debian bookworm-updates/main Sources [17.9 kB]
Get:11 http://deb.debian.org/debian bookworm-updates/main amd64 Packages [13.8 kB]
Get:12 http://deb.debian.org/debian bookworm-updates/non-free-firmware amd64 Packages [616 B]
Fetched 407 kB in 0s (841 kB/s)                         
All packages are up to date.     
root@04b0cd0c26ee:/#     apt install -y build-essential debhelper devscripts fakeroot git libaio-dev libboost-filesystem-dev libboost-program-options-dev libboost-thread-dev libncurses-dev libnuma-dev libssl-dev lintian
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

Unsatisfied dependencies:
 libapt-pkg-perl : Depends: perlapi-5.36.0
 libberkeleydb-perl : Depends: perlapi-5.36.0
 libcpanel-json-xs-perl : Depends: perlapi-5.36.0
 libdevel-size-perl : Depends: perlapi-5.36.0
 libemail-address-xs-perl : Depends: perlapi-5.36.0
 libncurses-dev : Depends: libtinfo6 (= 6.4-4) but 6.5-2 is to be installed
                  Depends: libncurses6 (= 6.4-4) but 6.5-2 is to be installed
                  Depends: libncursesw6 (= 6.4-4) but 6.5-2 is to be installed
 libnetaddr-ip-perl : Depends: perlapi-5.36.0
 libnuma-dev : Depends: libnuma1 (= 2.0.16-1) but 2.0.18-1 is to be installed
 libparams-util-perl : Depends: perlapi-5.36.0
 libperlio-gzip-perl : Depends: perlapi-5.36.0
 libperlio-utf8-strict-perl : Depends: perlapi-5.36.0
 libproc-processtable-perl : Depends: perlapi-5.36.0
 libsereal-decoder-perl : Depends: perlapi-5.36.0
 libsereal-encoder-perl : Depends: perlapi-5.36.0
 libstdc++-12-dev : Depends: gcc-12-base (= 12.2.0-14) but 12.4.0-1 is to be installed
                    Depends: libgcc-12-dev (= 12.2.0-14) but 12.4.0-1 is to be installed
 libsub-identify-perl : Depends: perlapi-5.36.0
 libsub-name-perl : Depends: perlapi-5.36.0
 libsyntax-keyword-try-perl : Depends: perlapi-5.36.0
                              Depends: libxs-parse-keyword-perl but it is not going to be installed
 libterm-readkey-perl : Depends: perlapi-5.36.0
 libtext-levenshteinxs-perl : Depends: perlapi-5.36.0
 libtext-markdown-discount-perl : Depends: perlapi-5.36.0
 libtext-xslate-perl : Depends: perlapi-5.36.0
                       Depends: libdata-messagepack-perl but it is not going to be installed
                       Depends: libmouse-perl but it is not going to be installed
 libtime-moment-perl : Depends: perlapi-5.36.0
 libunicode-utf8-perl : Depends: perlapi-5.36.0
 libvariable-magic-perl : Depends: perlapi-5.36.0
 libxml-libxml-perl : Depends: perlapi-5.36.0
 libyaml-libyaml-perl : Depends: perlapi-5.36.0
Error: Unable to correct problems, you have held broken packages.

So, in the end i could install it by forcing the OS to pretty much always use Debian Trixie Sources.

My Main Question is: How can i best deal with such a situation? Can i adjust my Garden Linux image somehow, so apt magically deals itself with those issues?

How to reproduce it: apt install -y build-essential debhelper devscripts fakeroot git libaio-dev libboost-filesystem-dev libboost-program-options-dev libboost-thread-dev libncurses-dev libnuma-dev libssl-dev lintian

Environment:

Name Value
Garden Linux Branch Main

dnan0s avatar Jul 04 '24 15:07 dnan0s

Hi @dnan0s!

high level

Abstractly speaking, packages are bundled together to a distribution. All package versions within a distribution must be compatible with each other, so you will not end up in the situation you described.

But if you start mixing distributions, you cannot have that guarantee anymore.

Garden Linux today apt distribution is an alias to today's version number of Garden Linux (e.g. today would be 1557.0). This is based on debian testing, but debian testing can change at any time. So you will need the matching snapshot for the Garden Linux version.

Based on your logs I can see that you added bookworm, so there is an even bigger gap between current Garden Linux and debian bookworm.

possible solution for your problem

We create a full mirror of debian testing for every garden linux version, this should be compatible. However, we did not expose it to users directly yet. I will discuss with my colleagues if we can expose this in a convenient way (or if we do this already)

Vincinator avatar Jul 05 '24 07:07 Vincinator

Are these mirrors usable if someone wants to use gardenlinux as a base image in their Dockerfile?

halamix2 avatar Jul 10 '25 12:07 halamix2

Are these mirrors usable if someone wants to use gardenlinux as a base image in their Dockerfile?

This is just my opinion as a developer:

In theory yes if you pick the right mirror, but we don't have any documentation on how to do that, and also I don't think we want to expose this as an API. Our PM @pnpavlov is ooo right now, but I think he would be the right person to approach from a product perspective.

fwilhe avatar Jul 10 '25 13:07 fwilhe