How does YUM identify which packages to update?

Issues related to applications and software problems and general support
Post Reply
SteffanCline
Posts: 5
Joined: 2015/04/17 13:29:13

How does YUM identify which packages to update?

Post by SteffanCline » 2021/09/12 06:45:40

I have an old software package that depends on older versions of libicu and ImageMagick. In the past, I have just built them on the target machine, installed them in /usr/local, rather than the default /usr, and never had problems with parallel versions on the same machine - CentOS repo distro in /usr and my own in /usr/local. A friend built the RPMs for me so I could simply install on new deployments without all the extras (gcc etc). I installed them and all was fine at first. I had to make an entry into /etc/ld.so.conf.d for /usr/local/lib64 so the library paths could be resolved. I ran yum update and it installed newer versions of ImageMagick and libicu than mine in /usr and ERASED my versions in /usr/local. I don't understand how or why that happened. In the past, YUM did not detect my manually built libraries and did not decide to install a CentOS version.

EDIT: STRIKE - "I used rpm -ivh xxx.rpm to install these custom RPMs so I wouldn't think they'd be in YUM's database of what had been installed. "

Thinking back on this, for the ImageMagick version, it had so many dependencies that I did you use yum localinstall xxxx to install it and resolve the dependencies. My mistake.

My question goes to how exactly does YUM know what packages to update?

Does yum look at the installed RPMs and match names to newer packages?

Is it just a matter of renaming my RPMs slightly so YUM can't identify and try to overwrite them? Something like MyBuild-ImageMagickxxxxxxx.el8.x86_64.rpm perhaps?
Last edited by SteffanCline on 2021/09/12 18:28:02, edited 1 time in total.

sml
Posts: 305
Joined: 2020/01/17 09:01:44

Re: How does YUM identify which packages to update?

Post by sml » 2021/09/12 11:19:55

SteffanCline wrote:
2021/09/12 06:45:40
I used rpm -ivh xxx.rpm to install these custom RPMs so I wouldn't think they'd be in YUM's database of what had been installed.
They are in the RPM database though. This is enough. To prevent those packages from being upgraded, list them in the installonlypkgs option in /etc/dnf/dnf.conf.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: How does YUM identify which packages to update?

Post by TrevorH » 2021/09/12 13:21:38

If they were upgraded then it also means the distro versions were newer (i.e higher version/release) than yours.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

SteffanCline
Posts: 5
Joined: 2015/04/17 13:29:13

Re: How does YUM identify which packages to update?

Post by SteffanCline » 2021/09/12 18:30:03

I edited the main post to reflect I actually used yum localinstall ImageMagick.... due to all the dependencies.

At this point, the question comes down to how do I make the package identify as something other than the "normal" ImageMagick package so DNF/YUM don't try to update or replace it but would still install a newer one if requested in the default locations - /usr ?

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: How does YUM identify which packages to update?

Post by TrevorH » 2021/09/12 19:40:17

What is it that your special ImageMagick has that the standard one does not?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

SteffanCline
Posts: 5
Joined: 2015/04/17 13:29:13

Re: How does YUM identify which packages to update?

Post by SteffanCline » 2021/09/13 08:04:31

It’s an older build to support a specific middleware called Lasso (like php). It requires the older ImageMagick and libicu.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: How does YUM identify which packages to update?

Post by TrevorH » 2021/09/13 08:59:57

I would suggest the long term solution is to do something like call your package a different name and alter its install paths to say /opt so it doesn't overwrite things from the normal one. You'd need to do something like adjust LD_LIBRARY_PATH before launching your app to pick up the non-standard paths. You'll find there are other things linked against ImageMagick and its libs that might require the newer one.

Alternatively, you could also bump the Epoch: of your package - sort of like a super-version field - so that it never gets overwritten by the distro copy. Epoch is sort of the last resort and is frowned upon as it's almost impossible to remove the epoch change once it's been done so all rebuilds of the package then have to use the same or higher in future.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply