Centos 7 and spamassin installation.

rpr

Verified User
Joined
Oct 20, 2010
Messages
65
Hi,

I've followed the guide:
https://help.directadmin.com/item.php?id=36

If I use the centos yum install option I get 3 errors:
Code:
No package perl-IP-Country available.
No package perl-Razor2 available.
No package perl-Net-Ident available.

When I run sa-update -D I get some modules that aren't installed.
Code:
Jul 31 00:34:17.504 [12480] dbg: diag: [...] module not installed: Digest::SHA1 ('require' failed)
Jul 31 00:34:17.504 [12480] dbg: diag: [...] module not installed: Geo::IP ('require' failed)
Jul 31 00:34:17.504 [12480] dbg: diag: [...] module not installed: Net::CIDR::Lite ('require' failed)
Jul 31 00:34:17.505 [12480] dbg: diag: [...] module not installed: Net::Patricia ('require' failed)
Jul 31 00:34:17.505 [12480] dbg: diag: [...] module not installed: Net::DNS::Nameserver ('require' failed)

When I cpan everything behind the yum update the modules aren't installed either.
Anyone know the correct installation?
 
When you try to install them with CPAN

Code:
cpan -i IP::Country Mail::SpamAssassin::Plugin::Razor2 Razor2::Client::Agent Net::Ident  Digest::SHA1 Geo::IP Net::CIDR::Lite Net::Patricia Net::DNS::Nameserver

what happens?
 
I had to force install a couple of them because the at least the Razor2 modules kept giving errors. So you might keep that in mind when trying to install the modules via CPAN.
 
Code:
cpan -i IP::Country Mail::SpamAssassin::Plugin::Razor2 Razor2::Client::Agent Net::Ident  Digest::SHA1 Geo::IP Net::CIDR::Lite Net::Patricia Net::DNS::Nameserver
Reading '/root/.cpan/Metadata'
  Database was generated on Mon, 30 Jul 2018 15:17:02 GMT
IP::Country is up to date (2.28).
Mail::SpamAssassin::Plugin::Razor2 is up to date (undef).
Razor2::Client::Agent is up to date (undef).
Net::Ident is up to date (1.24).
Digest::SHA1 is up to date (2.13).
Geo::IP is up to date (1.51).
Net::CIDR::Lite is up to date (0.21).
Net::Patricia is up to date (1.22).
Net::DNS::Nameserver is up to date (1692).

Also when I don't use the yum install way sa-update -D results in:
Code:
[root@vs-web-01-18 custombuild]# sa-update -D
Can't locate Net/DNS.pm in @INC (@INC contains: /usr/share/perl5 /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5) at /bin/sa-update line 84.
BEGIN failed--compilation aborted at /bin/sa-update line 84.
 
Last edited:
Faulty documentation

This is how to fix it with yum:
yum install perl-Net-CIDR* perl-Net-DNS-Nameserver perl-Net-Patricia perl-Geo-IP perl-Digest-Sha1

and everything is installed.
 
That should indeed work. If Spamassassin keeps complaining after that, install it via CPAN:
cpan -i Net::DNS
and you should be fine.
 
Oh, I greatly discourage you to install some packages using the repository and others with CPAN. It will be a potential dependencies mess in future (for example you install module with yum, then you update it via cpan and the yum manager does not know about it and it reupdates, etc).

The advantage of yum is that the modules should be guaranteed to work properly on the specific OS while there can be potentially something not working properly when you install them via cpan (for example OS specific paths preconfigured differently). For example it deals with dependecies on non-Perl libraries - a perl module depending on non-perl lib (cpan does not handle that situation - it just fails to install and ask you to do manually). However when you are installing via cpan, it normally unit tests everything and the module is not installing if there is something wrong (unless you force it of course).

The advantage of cpan is that you have all possible perl modules and they can always be up to date (you can upgrade them anytime with cpan -u).

So my personal preference is to always keep everything installed via cpan. I don't mix cpan and repo (FreeBSD ports in my case) because it sometimes break things after future updates.
 
Oh, I greatly discourage you to install some packages using the repository and others with CPAN. It will be a potential dependencies mess in future (for example you install module with yum, then you update it via cpan and the yum manager does not know about it and it reupdates, etc).
I don't fully agree. I've also worked with CPAN and it's working fine. But I agree you have to take care of what you're doing. Don't install the same modules indeed.

But if you would like to go and work with Razor2, you can't get around it because these are not available in yum.
As you can see from the help.directadmin.com link for spamassassin "required modules":
Mail::SpamAssassin::plugin::Razor2 Razor2::Client::Agent
These are not available in Yum so if you have to use CPAN.

I agree, that it's better to use either one. In earlier days we even installed spamassassin itself via CPAN. But nowaydays it's done via Custombuild which also installs some modules if I'm not mistaken.

Anyway, suddenly in the passed some errors occured, a bug in CPAN which also took some time to get things working again.

The way I'm doing it now is this.
I install all modules via yum and keep them updated via yum.
After that I install **only the missing modules** like the Razor2 modules, so the modules yum does not provide, via CPAN.

This way there is no mix of modules and no issues upgrading anything.

But ofcourse that's everybody's choice. I had too many issues in the passed using only CPAN which is the reason I switched to yum since almost all modules came available there.
 
Should... I had a case that it did not want to see the yum installed module. Very odd. So I hadd to install the Cpan module.
Could also be the application only looked at cpan, I don't remember.

So if Cpan sees everything installed from Yum, then I rather keep doing what I do and use Yum and only install the cpan modules which are not present in cpan. Also easier with updating. :)
 
Back
Top