I was trying to install PHP 8.2 using the command dnf update -y, which reinstalled the OS to 9.5. However, after that, I didn’t use dnf update -y and instead used sudo dnf install http://rpms.remirepo.net/enterprise/remi-release-9.rpm -y to install PHP 8.2, but it still updated the OS to 9.7.
I’ll start with the obvious: 9.5 is end of life and is not supported. You should keep your systems fully up to date at all times.
The next thing: The remi-release-9 package specifically requires redhat-release 9.7 or above.
[label@sani ~]$ rpm -qp http://rpms.remirepo.net/enterprise/remi-release-9.rpm --requires
warning: http://rpms.remirepo.net/enterprise/remi-release-9.rpm: Header OpenPGP V4 RSA/SHA512 signature, key ID b19527f1478f8947: NOKEY
(redhat-release >= 9.7 or centos-stream-release >= 9)
config(remi-release) = 9.7-4.el9.remi
epel-release = 9
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsZstd) <= 5.4.18-1
rpmlib(RichDependencies) <= 4.12.0-1
system-release(releasever) = 9
It has nothing to do with Rocky Linux and has everything to do with the requirements of the release package. Regardless, 9.5 is EOL.
That makes no sense. The dnf up merely updates packages that are already installed (if newer versions are available). It does not install “unforeseen” packages. Furthermore, it does update, not reinstall.
Note: avoid the -y option. Do you really want the dnf always to proceed no matter what?
Not whole “OS”, just the packages that the package ‘remi-release-9’ does require.
(At least the package that has Rocky’s version number.)
Not updating the system is not good. Updating just some packages is not good either.
Regular dnf up is good.
This post is tagged as Rocky 9, it’s worth noting that PHP 8.2 is already available (as a stream) in the Rocky repos.