0

I often find with CentOS that I find a reference to a package on the internet and it the pages says "this package is available in the repo", so then I do sudo yum install (as I know that I have that repo) and it comes up blank. I see this dozens of times (so much that if it says on an internet page "this is in the repo", I know that there is only a 50% chance of that being true.

Take a trivial example: fortune. Every page you will ever see says that it is in the EPEL repo. Ok, great yum install repo epel-release and then sudo yum install fortune. No such package exists!!!

I find here that the package seems to have been in CentOS 6 EPEL, but not after that. https://pkgs.org/download/fortune

So, in that case:

• How do I go about adding the CentOS 6 EPEL (and maybe also CentOS 7) repo to my CentOS 8 install?, and

• Tell my system to only use 7 if the package is not in 8 and to only use 6 if the package is not in 7?

• Also, is RPMforge still a valid repo? I saw a page saying that it was dead/deprecated, but do people still use that, and if so, how do I add it (maybe that helps me with many packages)?

YorSubs
  • 135
  • 6
  • 1
    Files compiled for CentOS 6 will have different dependencies, link to different libraries, and so on. You cannot simply use a CentOS 6 repo on CentOS 8 and expect it to work. Nonetheless, you can add whatever repo/version you want by putting it in `/etc/yum.repos.d`. – tater Nov 13 '20 at 16:45
  • Thanks, that is interesting. So, I would like to test that out, could you advise me a bit on that please? So for the above example, say I wanted to just try and go to the CentOS 6 repo and install that `fortune` package for a simple example. Is there a way that I can do that? Is there a way to tell `yum` to specifically only look in that one repo for this package, and to resolve dependencies from that repo? I'm not worried about breaking this CentOS install, so am willing to try/learn - but do you think it will break my setup or will it be fine? – YorSubs Nov 13 '20 at 16:56
  • Not sure why fortune-mod was dropped from EPEL. Could just be an oversight. You might contact the Fedora package maintainer and ask if it can be re-added to EPEL. – Michael Hampton Nov 14 '20 at 00:44
  • Found him and sent him an email. :) – YorSubs Nov 14 '20 at 07:32

2 Answers2

3

First, caveat: Centos6 is end of life so you should be upgrading to at least Centos7.

To install epel for a particular distro go to the epel website and that will tell you how to install epel for your particular distribution:

https://fedoraproject.org/wiki/EPEL#Quickstart

Do not try to mix different versions ie Centos7 / Centos8 as this will cause all sorts of dependency errors.

If you just want to find a particular package for a particular distribution there are two rpm search sites which can help locate older packages:

https://www.rpmfind.net/

and

http://rpm.pbone.net/

Falstone
  • 179
  • 6
  • Thanks. So, how would I go about completing this experiment? i.e. to install `fortune` (a package that is as trivially simple as I can think of) onto my CentOS 8 (note: I am not using CentOS 6 or 7, just 8). I downloaded the .rpm and did `rpm -i ` against it but got all sorts of dependency errors `warning: fortune-mod-1.99.1-13.el6.i686.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY error: Failed dependencies: libc.so.6 is needed by fortune-mod-1.99.1-13.el6.i686`. Surely a package as simplistic as `fortune` shouldn't be impossible to install on CentOS 8? – YorSubs Nov 13 '20 at 17:12
  • 1
    Hi, it is quite often the case, when you directly download packages there will be further dependencies. In your case libc.so.6. It may be because you are trying to install the Centos 6 package (denoted by the 'el6' in the package name. centos 8 would be .el8.). You could use: yum provides "libc.so.6" to find which package provides that library. BTW yum can be used to install local packages ie: yum install 'path to rpm file' – Falstone Nov 13 '20 at 17:44
  • ok, so `$ yum provides "libc.so.6" Last metadata expiration check: 10:26:28 ago on Fri 13 Nov 2020 08:28:52 CET. glibc-2.28-101.el8.i686 : The GNU libc libraries Repo : BaseOS Matched from: Provide : libc.so.6` Not really sure how to interpret that. What should my next step be? (I'm amazed that it is so unbelievably complex to install such a simple package, but I'm happy to do whatever you suggest to see how it is done! :-) ). – YorSubs Nov 13 '20 at 17:56
  • It is telling you if you want libc.so.6 you need to install package glibc - so yum install glibc – Falstone Nov 13 '20 at 18:46
  • Sadly, nothing I seem to do works. :-( Appreciate any ideas that you have. `$ sudo yum install glibc Last metadata expiration check: 2:02:30 ago on Fri 13 Nov 2020 17:50:36 CET. Package glibc-2.28-101.el8.x86_64 is already installed. Dependencies resolved. Nothing to do. Complete!` – YorSubs Nov 13 '20 at 18:54
  • OK so you already have libc.so.6 installed for centos8 - as I said in my first comment your system probably doesn't like that you are trying to install the version of fortune from Centos6. So you need to find the version of fortune for centos 8 - centos8 is based on fedora 28. The package from fedora 28 fortune-mod-1.99.5-2.fc28.rpm 'should' work. – Falstone Nov 13 '20 at 19:09
  • One step forward, but still fails :-( `]$ rpm -i fortune-mod-1.99.1-13.el6.x86_64.rpm warning: fortune-mod-1.99.1-13.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY error: Failed dependencies: librecode.so.0()(64bit) is needed by fortune-mod-1.99.1-13.el6.x86_64`. Do you know how to resolve that dependency? I wonder why this package was in CentOS 6, but not in CentOS 7 or 8, but *is* in Fedora. It's really difficult getting Linux to do anything I guess, but really appreciate your help. It's just an "anit-user" focused OS I guess ... :-( – YorSubs Nov 13 '20 at 19:34
  • Got it! I downloaded recode or something for librecorde and after that it worked. Phew, that was hard work! Thanks for the help. :-) – YorSubs Nov 13 '20 at 19:36
  • Great - if you are happy you could accept my answer as the solution. Just as an aside I note that first you referred to the i686 package and in your last comment you refer to the x86_64 package. They are different chip architectures i686 is 32bit x86_64 is the newer 64 bit chip architecture. – Falstone Nov 13 '20 at 19:47
  • I don't mind too much, I can throw things onto this CentOS setup and I'm not too bothered, will probably rebuild it at some point. But you are giving me good rules on how to find and install things that I might want to try and that's great. However, i686 and x86_64 should be able to co-exist right, so long as my CPU is x86_64 compatible. I mean, an x86_64 CPU should also be able to process older i686 right? – YorSubs Nov 13 '20 at 21:38
  • We are beginning to get into something that should be asked as a new question - Yes in theory a 64 bit pc can run 32 bit programmes. This issue is an x86_64 package will expect x86_64 dependencies and vice-versa. So installing i686 packages on an x86_64 system will cause problems due to different libraries. Changing libaraies to fix one problem is likely to cause other failures - so best to avoid trying to mix architectures. – Falstone Nov 15 '20 at 15:55
1

The fortune program in CentOS 7, is available under a different package name, fortune-mod, so (with EPEL repo enabled):

yum install fortune-mod

Why it was renamed to -mod is beyond me. But for some consistency of how you install it across different CentOS version, you can actually use binary name in lieu of package name:

yum install /usr/bin/fortune

In CentOS 8, it is not available.

Danila Vershinin
  • 4,738
  • 3
  • 16
  • 21
  • Completely fails. Any idea how to make it work? `$ sudo yum install fortune-mod ::: Last metadata expiration check: 0:36:54 ago on Fri 13 Nov 2020 17:50:36 CET. No match for argument: fortune-mod Error: Unable to find a match: fortune-mod`. Also fails for /usr/bin/fortune. `$ sudo yum install /usr/bin/fortune ::: Last metadata expiration check: 0:39:05 ago on Fri 13 Nov 2020 17:50:36 CET. No match for argument: /usr/bin/fortune Error: Unable to find a match: /usr/bin/fortune` – YorSubs Nov 13 '20 at 17:27