Linutronix / elbe

Embedded Linux Build Environment
https://elbe-rfs.org
GNU General Public License v3.0
163 stars 59 forks source link

Installing specific package version #323

Closed fmg-dave closed 1 year ago

fmg-dave commented 2 years ago

I have a deb repository that has multiple versions of a package. I would like to install a specific version (not the latest) and hold it at that version so that it cannot be updated accidentally.

I currently have an entry in pkg-list that looks like this:

<pkg version="1.2.3">my-package</pkg>

and an entry in finetuning that looks like this:

<command>apt-mark hold my-package</command>

However ELBE still installs the latest version of the package and fails validation with the error:

Package List validation
-----------------------

Package 'my-package' version '1.2.3' does not match installed version 1.5.6

I currently get around this by installing the package in finetuning:

<command>apt-get install my-package=1.2.3</command>
<command>apt-mark hold my-package</command>

Does Elbe support this use case? Have I used the version attribute incorrectly?

martinsteih-lr commented 2 years ago

As I understand the version attribute, it is used for validation only. If you structured your repository so that each package version is tied to a release or suite? If so, you could use the pin attribute of pkg (e.g., my-package). This way, Elbe would prefer the package's version in mysuite. For all I know, this is the only way to accomplish that.

bgermann commented 2 years ago

@martinsteih-lr is right with the pin hint.