简体   繁体   English

DNF 安装找不到 Perl 依赖项,有办法弄清楚正在使用哪个@INC?

[英]DNF install cannot find Perl dependencies, there is a way to figure out which @INC is being used?

I'm installing a custom rpm for the EOL MongoDB Perl driver;我正在为 EOL MongoDB Perl 驱动程序安装自定义 rpm; The RPM build went fine (I'm using fpm): RPM 构建运行良好(我使用的是 fpm):

fpm -t rpm -s cpan --maintainer 'Jose Vicente Nunez <me@company.com>' BSON
sudo dnf install -y perl-BSON-v1.12.2-1.noarch.rpm
fpm -t rpm -s cpan --maintainer 'Jose Vicente Nunez <me@company.com>' MongoDB

And after going through the dependency hell, I tried to install it:在经历了依赖地狱之后,我尝试安装它:

sudo dnf install perl-MongoDB-v2.2.2-1.noarch.rpm
Last metadata expiration check: 0:14:46 ago on Thu 22 Dec 2022 10:21:34 AM EST.
Error:
 Problem: conflicting requests
  - nothing provides perl(BSON) >= 1.012000 needed by perl-MongoDB-v2.2.2-1.noarch
  - nothing provides perl(BSON::Bytes) needed by perl-MongoDB-v2.2.2-1.noarch
  - nothing provides perl(BSON::Code) needed by perl-MongoDB-v2.2.2-1.noarch
  - nothing provides perl(BSON::DBRef) needed by perl-MongoDB-v2.2.2-1.noarch
  - nothing provides perl(BSON::OID) needed by perl-MongoDB-v2.2.2-1.noarch
  - nothing provides perl(BSON::Raw) needed by perl-MongoDB-v2.2.2-1.noarch
  - nothing provides perl(BSON::Regex) needed by perl-MongoDB-v2.2.2-1.noarch
  - nothing provides perl(BSON::Time) needed by perl-MongoDB-v2.2.2-1.noarch
  - nothing provides perl(BSON::Timestamp) needed by perl-MongoDB-v2.2.2-1.noarch
  - nothing provides perl(BSON::Types) needed by perl-MongoDB-v2.2.2-1.noarch
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

Now here comes the odd thing: BSON and its modules are available and installed:现在奇怪的事情来了:BSON 及其模块可用并已安装:

rpm -ql perl-BSON
/usr/local/share/man/man3/BSON.3pm
/usr/local/share/man/man3/BSON::Array.3pm
/usr/local/share/man/man3/BSON::Binary.3pm
/usr/local/share/man/man3/BSON::Bool.3pm
/usr/local/share/man/man3/BSON::Bytes.3pm
/usr/local/share/man/man3/BSON::Code.3pm
/usr/local/share/man/man3/BSON::DBPointer.3pm
/usr/local/share/man/man3/BSON::DBRef.3pm
/usr/local/share/man/man3/BSON::Decimal128.3pm
/usr/local/share/man/man3/BSON::Doc.3pm
/usr/local/share/man/man3/BSON::Double.3pm
/usr/local/share/man/man3/BSON::Int32.3pm
/usr/local/share/man/man3/BSON::Int64.3pm
/usr/local/share/man/man3/BSON::MaxKey.3pm
/usr/local/share/man/man3/BSON::MinKey.3pm
/usr/local/share/man/man3/BSON::OID.3pm
/usr/local/share/man/man3/BSON::ObjectId.3pm
/usr/local/share/man/man3/BSON::PP.3pm
/usr/local/share/man/man3/BSON::Raw.3pm
/usr/local/share/man/man3/BSON::Regex.3pm
/usr/local/share/man/man3/BSON::String.3pm
/usr/local/share/man/man3/BSON::Symbol.3pm
/usr/local/share/man/man3/BSON::Time.3pm
/usr/local/share/man/man3/BSON::Timestamp.3pm
/usr/local/share/man/man3/BSON::Types.3pm
/usr/local/share/perl5/BSON.pm
/usr/local/share/perl5/BSON/Array.pm
/usr/local/share/perl5/BSON/Binary.pm
/usr/local/share/perl5/BSON/Bool.pm
/usr/local/share/perl5/BSON/Bytes.pm
/usr/local/share/perl5/BSON/Code.pm
/usr/local/share/perl5/BSON/DBPointer.pm
/usr/local/share/perl5/BSON/DBRef.pm
/usr/local/share/perl5/BSON/Decimal128.pm
/usr/local/share/perl5/BSON/Doc.pm
/usr/local/share/perl5/BSON/Double.pm
/usr/local/share/perl5/BSON/Int32.pm
/usr/local/share/perl5/BSON/Int64.pm
/usr/local/share/perl5/BSON/MaxKey.pm
/usr/local/share/perl5/BSON/MinKey.pm
/usr/local/share/perl5/BSON/OID.pm
/usr/local/share/perl5/BSON/ObjectId.pm
/usr/local/share/perl5/BSON/PP.pm
/usr/local/share/perl5/BSON/Raw.pm
/usr/local/share/perl5/BSON/Regex.pm
/usr/local/share/perl5/BSON/String.pm
/usr/local/share/perl5/BSON/Symbol.pm
/usr/local/share/perl5/BSON/Time.pm
/usr/local/share/perl5/BSON/Timestamp.pm
/usr/local/share/perl5/BSON/Types.pm

And just to confirm system Perl knows about it:只是为了确认系统 Perl 知道它:

 for m in BSON  BSON::Bytes  BSON::Code  BSON::DBRef  BSON::OID  BSON::Raw  BSON::Regex  BSON::Time  BSON::Timestamp  BSON::Types; do
> perl -M${m} -e ';' > /dev/null 2>&1 && echo "OK: ${m}"|| echo "ERROR: ${m}"
> done
OK: BSON
OK: BSON::Bytes
OK: BSON::Code
OK: BSON::DBRef
OK: BSON::OID
OK: BSON::Raw
OK: BSON::Regex
OK: BSON::Time
OK: BSON::Timestamp
OK: BSON::Types

I can only think that then @INC used by DNF is different from the one used by Perl on the CLI.我只能认为然后DNF 使用的@INC 与CLI 上的Perl 使用的@INC 不同。 Mine looks like this (perl -V, /usr/local/share/perl5 is there):我的看起来像这样(perl -V,/usr/local/share/perl5 在那里):

  Built under linux
  Compiled at Feb 16 2021 15:25:15
  @INC:
    /usr/local/lib64/perl5
    /usr/local/share/perl5
    /usr/lib64/perl5/vendor_perl
    /usr/share/perl5/vendor_perl
    /usr/lib64/perl5
    /usr/share/perl5

Any ideas what I'm doing wrong?任何想法我做错了什么?

Thanks!谢谢!

I ended doing some trickery by borrowing a SRPM, and just commented out a boot-strapping test on BSON and re-compiled.我通过借用 SRPM 结束了一些诡计,只是在 BSON 上注释掉了引导测试并重新编译。

curl --location --url https://download-ib01.fedoraproject.org/pub/fedora/linux/releases/37/Everything/source/tree/Packages/p/perl-BSON-1.12.2-9.fc37.src.rpm --fail --output rpmbuild/SRPMS/perl-BSON-1.12.2-9.fc37.src.rpm
curl --fail --location --url https://download-ib01.fedoraproject.org/pub/fedora/linux/releases/37/Everything/source/tree/Packages/p/perl-MongoDB-2.2.2-7.fc37.src.rpm --output rpmbuild/SRPMS/perl-MongoDB-2.2.2-7.fc37.src.rpm

Hopefully someone knows the answer and can share it here, I decided to solve this using a different trick.希望有人知道答案并可以在这里分享,我决定使用不同的技巧来解决这个问题。

Thanks!谢谢!

You have several flaws there.你那里有几个缺陷。 But let's focus on the main culprit:但让我们关注罪魁祸首:

The name of the package perl-BSON-v1.12.2-1.noarch.rpm indicates that you put in: package perl-BSON-v1.12.2-1.noarch.rpm的名称表示您输入:

Version: v1.12.2

But the per-MongoDB tells you:但是per-MongoDB告诉你:

nothing provides perl(BSON) >= 1.012000 needed by perl-MongoDB-v2.2.2-1.noarch

Now let's ask rpm what it thinks - which version is higher:现在让我们问问 rpm 它是怎么想的——哪个版本更高:

$ rpmdev-vercmp v1.12.2 1.012000
v1.12.2 < 1.012000

So here it is.所以就在这里。 Your perl-MongoDB needs something higher than 1.012000.您的 perl-MongoDB 需要高于 1.012000 的版本。 Which is more trickier than it you may think.这比你想象的更棘手。 See:看:

$ rpmdev-vercmp 1.12.2 1.012000
1.12.2 < 1.012000
12$ rpmdev-vercmp 1.122 1.012000
1.122 < 1.012000
$ rpmdev-vercmp 1.0122 1.012000
1.0122 < 1.012000
$ rpmdev-vercmp 1.012200 1.012000
1.012200 > 1.012000

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM