2

I'm trying to install a customised openresty on a Centos7 VM.

sudo rpm -i openresty-1.19.3.1-1.el7.x86_64.rpm

However I get this error:

        perl(Test::Nginx::Socket::Lua) is needed by openresty-1.19.3.1-1.el7.x86_64
        perl(Test::Nginx::Socket::Lua::Stream) is needed by openresty-1.19.3.1-1.el7.x86_64

But I already had those dependencies installed with cpan, and when I try to install them again, I get:

Test::Nginx is up to date (0.29).

Text::Nginx includes the socket::lua subclasses.

I'm not sure what is going on there. It seems that the rpm isn't picking up the existence of those dependencies. I did a restart, refresh ..etc, but no change.

Asalmi
  • 29
  • 5
  • Do you have more than one `perl` on your system? What is the output of `which perl`? What is the output of `perl --version` and `cpan -v` ? – Håkon Hægland Jul 01 '21 at 11:58
  • You seem to have mixed up directly installing the required modules (via cpan), and installing via the rpm package manager. You probably need to uninstall those two modules, then install the corresponding rpn packages – Dave Mitchell Jul 01 '21 at 12:31
  • @HåkonHægland which perl => /bin/perl; perl version is perl 5 version 16. cpan -v doesn't return anything although I did use it to install the above mentioned modules. – Asalmi Jul 01 '21 at 13:58
  • Your mistake is that you use `rpm` to install perl module -- `rpm` does not install dependencies. Instead you should use `yum` or `dnf`. [yum](https://www.cyberciti.biz/faq/rhel-centos-fedora-linux-yum-command-howto/), [dnf](https://linuxhint.com/centos8_package_management_dnf/). – Polar Bear Jul 01 '21 at 17:53

3 Answers3

1

Check my very similar answer about python How to include pip packages in rpm build

RPM checks what you have in rpmdb not what you have installed on disk. RPM cannot really understand all these ecosystems (python, perl, ruby, rust, java, nojs....).

You either need to package the dependency (cpan2spec is your friend) or use create-fake-rpm.

msuchy
  • 5,162
  • 1
  • 14
  • 26
0

Eventually what worked for me is to create a local repo, which installed the dependencies itself.

I also found

yum repo-pkgs my-rpms install

Much more reliable to install all packages in a repo than the other answers found through google.

Asalmi
  • 29
  • 5
0

RPM only knows about stuff that was installed using rpm. If you install a CPAN module directly from CPAN, then RPM won't know about it.

Dave Cross
  • 68,119
  • 3
  • 51
  • 97