0

my libevent installed version is 2.0.12

I install the new version of libevent (v2.1.12) through the following command and everything goes well but after that yum info show libevent version 2.0.12 again.

what's wrong with yum? and how can I update yum database?

  $ wget https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz

   $ tar -zxf libevent-*.tar.gz
   $ cd libevent-*/
   $ ./configure --prefix=/usr/local --enable-shared
   $ sudo make && make install
6

yum only looks at what is in the RPM database as yum is just a front end for rpm. As you compiled the package from source and didn't install it with yum or rpm, it's not in the RPM database and yum isn't going to operate on it and will instead only account for the libevent that's in the RPM database. As that libevent is already up to date, yum isn't going to do anything and neither will rpm.

There isn't anything that you need to do with the database as it's functioning as it should. The reason for compiling software from source is to get a version that isn't available in the repos so that you can add it to environment without causing conflicts that can ruin your system by putting you in the notorious "dependency hell".

3
  • Thanks, So the new version is installed. How can I remove the old yum entry(rpm database) and add the new one manually? Jul 24 '21 at 13:55
  • @HassanYousefzadeh that probably merits a whole new question.
    – steve
    Jul 24 '21 at 14:03
  • @HassanYousefzadeh The only way to do that would be to build an rpm for the newer version and install it with yum. That isn't a good idea and I'm not going to advise it for the reasons that I've already given. The package manager and the dependencies of libevent rely on a certain version of libevent that is available in its repos. By having a different version in the database, you'd ruin that. Even if it worked, it still wouldn't update to a later version because only the older version will be available. Jul 24 '21 at 14:03
0

You installed the package over the distribution's version, thus breaking the RPM database of what is installed. If you go asking e.g. rpm verify libevent it will scream bloody murder.

If you absolutely must install the new version (often the distributions, much more so the "enterprise" long-lived ones, keep old base versions and add patches --- localizations, bug fixes, enhancements, ... backported from bleeding edge upstream --- to it, and add in tailored configuration and documentation; the package shipped is not the upstream version of the same number, sometimes not even by a very long shot), create your own RPM package:

  • Get the latest src.rpm from the distribution's archive. In the case of CentOS, you can also take a peek at the packages for closely related Fedora, either the latest version of the distribution or even the experimental rawhide release (cooking to become the next version of the distribution).
  • Unpack it. Keep the manual at hand (warning, this is somewhat outdated) or the generic guide nearby.
  • Changing the spec file to include the new version is simple, but you'll have to make sure any patches or configuration files shipped in the original still apply/are required.
  • Build your own package, fix any errors/warnings. When satisfied, install it. Run any tests you deem necessary.

Doing this ensures RPM (and thus dnf et al) knows about your new package, and goes a long way towards cleanly integrating it into your system. But you get a modified version of the distribution, and are a step farther from being able to ask for help from users of unmodified systems.

Another way is to install unofficial versions of software e.g. under /usr/local, that way you don't risk extensive breakage.

1
  • He didn't install it with the package manager so it isn't in the RPM database. That's why using yum doesn't have any effect on it. He compiled it from source in /usr/local like you suggested in your answer. He hasn't done anything to harm his system. The only way that he would is if he were to get a different rpm than what's in the repos and install it with yum or rpm. Jul 25 '21 at 0:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.