amazonlinux / amazon-linux-2023

Amazon Linux 2023
https://aws.amazon.com/linux/amazon-linux-2023/
Other
500 stars 38 forks source link

[Feature Request] - AL2023 DNF version 2 years old #636

Closed koen-serneels closed 3 months ago

koen-serneels commented 4 months ago

AL2023 fully up-to-date with everything, but the DNF version is lagging almost 2 years behind (4.12 was released Apr 27, 2022):

dnf --version
4.12.0
  Installed: dnf-0:4.12.0-2.amzn2023.0.4.noarch at Fri Dec 15 01:49:48 2023
  Built    : Amazon Linux at Tue Jan 31 01:01:11 2023

  Installed: rpm-0:4.16.1.3-12.amzn2023.0.6.x86_64 at Fri Dec 15 01:49:15 2023
  Built    : Amazon Linux at Mon Apr 17 16:53:56 2023

I´m in need for a more recent version as it has support for auto-reboot via the config options ¨reboot/reboot_command¨. Trying to upgrade DNF using the nightlies as shown on their GH page (https://github.com/rpm-software-management/dnf/) didn´t work:

Repository 'epel-2023-x86_64' does not exist in project 'rpmsoftwaremanagement/dnf-nightly'.

Also building from source didn´t work as it couldn´t even parse the spec file.

So, my request: would it be possible to foresee a newer version of DNF on AL2023? Or maybe elaborate what would be the best way to build a more recent DNF version?

stewartsmith commented 4 months ago

Would a plugin such as https://github.com/agross/dnf-automatic-restart solve your use case?

(note: i have not audited that plugin at all, but it appears to do what you desire)

stewartsmith commented 4 months ago

Any update to DNF must stay very compatible, as we are understandably risk averse in making updates to the packaging packages.

zcobol commented 4 months ago

@stewartsmith a dnf package can be easily build on AL2023:

  1. install buildsys-build group. Run dnf grouplist to see what's available and what's installed.
  2. download a source package that has the reboot option. It was added in ver 4.15.0
  3. run sudo dnf builddep dnf.spec to install dependecies
  4. run rpmbuild -ba dnf.spec to build binary & source packages. rpmbuild -bb dnf.spec will build binaries only.
  5. check rpmbuild/RPMS/noarch for the new packages, Upgrade dnf on all your aws instances.
  6. Enjoy!

Package list:

[ec2-user noarch]$ ls -l
total 980
-rw-r--r--. 1 ec2-user ec2-user 472787 Feb 20 18:00 dnf-4.15.0-1.amzn2023.noarch.rpm
-rw-r--r--. 1 ec2-user ec2-user  32090 Feb 20 18:00 dnf-automatic-4.15.0-1.amzn2023.noarch.rpm
-rw-r--r--. 1 ec2-user ec2-user  36287 Feb 20 18:00 dnf-data-4.15.0-1.amzn2023.noarch.rpm
-rw-r--r--. 1 ec2-user ec2-user 420218 Feb 20 18:00 python3-dnf-4.15.0-1.amzn2023.noarch.rpm
-rw-r--r--. 1 ec2-user ec2-user  33689 Feb 20 18:00 yum-4.15.0-1.amzn2023.noarch.rpm

Verify first:

[ec2-user noarch]$ sudo rpm -Uvh --test *.rpm
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]

https://kojipkgs.fedoraproject.org//packages/dnf/4.15.0/1.fc36/src/dnf-4.15.0-1.fc36.src.rpm used for testing.

stewartsmith commented 4 months ago

There's more to DNF than just the dnf package - there's libdnf, librepo, libcomps, rpm, libsolv, and something else I'm sure I'm forgetting. We have to ensure everything works together, and we have the long term stability we need. L

stewartsmith commented 3 months ago

We have a bunch of updates to the rpm and dnf ecosystems in AL2023.4 (see the release notes) - I'm going to resolve this issue as updates have occurred there. We're carefully managing what versions of these packages we bring in, so that we maintain compatibility.