maxmind / geoipupdate

GeoIP update client code
Apache License 2.0
726 stars 142 forks source link

CentOS 7: geoipupdate conflicts GeoIP #76

Closed neonknight closed 4 years ago

neonknight commented 4 years ago

It is not possible to install geoipupdate-4.1.5 on CentOS7 as it conflicts with GeoIP - which is a dependency of crucial core networking tools such as bind-utils:

Transaction check error:
  file /usr/share/GeoIP conflicts between attempted installs of GeoIP-1.5.0-14.el7.x86_64 and geoipupdate-4.1.5-1.x86_64
frayber commented 4 years ago

I confirm this behaviour, but I think it could be easily bypassed. This is file list in rpm:

 rpm -ql GeoIP-1.5.0-14.el7.x86_64
/etc/GeoIP.conf
/usr/bin/geoipupdate
/usr/share/GeoIP
/usr/share/doc/geoipupdate/CHANGELOG.md
/usr/share/doc/geoipupdate/GeoIP.conf
/usr/share/doc/geoipupdate/GeoIP.conf.md
/usr/share/doc/geoipupdate/LICENSE-APACHE
/usr/share/doc/geoipupdate/LICENSE-MIT
/usr/share/doc/geoipupdate/README.md
/usr/share/doc/geoipupdate/geoipupdate.md

The directory /usr/share/GeoIP is in conflict with the one contained in GeoIP:

rpm -qlp geoipupdate_4.1.5_linux_amd64.rpm
/usr/bin/geoiplookup
/usr/bin/geoiplookup6
/usr/lib64/libGeoIP.so.1
/usr/lib64/libGeoIP.so.1.5.0
/usr/share/GeoIP
/usr/share/GeoIP/GeoIP-initial.dat
/usr/share/GeoIP/GeoIP.dat
/usr/share/GeoIP/GeoIPASNum.dat
/usr/share/GeoIP/GeoIPASNumv6.dat
/usr/share/GeoIP/GeoIPCity.dat
/usr/share/GeoIP/GeoIPCityv6.dat
/usr/share/GeoIP/GeoIPCountry.dat
/usr/share/GeoIP/GeoIPCountryv6.dat
/usr/share/GeoIP/GeoIPv6-initial.dat
/usr/share/GeoIP/GeoIPv6.dat
/usr/share/doc/GeoIP-1.5.0
/usr/share/doc/GeoIP-1.5.0/AUTHORS
/usr/share/doc/GeoIP-1.5.0/COPYING
/usr/share/doc/GeoIP-1.5.0/ChangeLog
/usr/share/doc/GeoIP-1.5.0/LICENSE.txt
/usr/share/doc/GeoIP-1.5.0/README
/usr/share/doc/GeoIP-1.5.0/TODO
/usr/share/doc/GeoIP-1.5.0/fetch-geoipdata-city.pl
/usr/share/doc/GeoIP-1.5.0/fetch-geoipdata.pl
/usr/share/man/man1/geoiplookup.1.gz
/usr/share/man/man1/geoiplookup6.1.gz

but why geoipupdate wants to create /usr/share/GeoIP folder? it doesn't put any file in it. It could be possibile remove it from rpm? Thank you

oschwald commented 4 years ago

I agree that this is an issue, but not creating the directory would be less than ideal. /usr/share/GeoIP is in the RPM because that is the default location to store the databases. Without it, you would need to explicitly create the directory before using geoipupdate or specify another directory.

leem32 commented 4 years ago

Same issue here, with CentOS 7.

sudo rpm -i https://github.com/maxmind/geoipupdate/releases/download/v4.1.5/geoipupdate_4.1.5_linux_amd64.rpm

file /etc/GeoIP.conf from install of geoipupdate-4.1.5-1.x86_64 conflicts with file from package GeoIP-1.5.0-13.el7.x86_64
file /usr/bin/geoipupdate from install of geoipupdate-4.1.5-1.x86_64 conflicts with file from package GeoIP-1.5.0-13.el7.x86_64
file /usr/share/GeoIP from install of geoipupdate-4.1.5-1.x86_64 conflicts with file from package GeoIP-1.5.0-13.el7.x86_64

Any ideas for a workaround??

I've also tried to install geoipupdate version 2.5.0 from the base repo, but get the following conflicts:

Transaction check error:
file /etc/GeoIP.conf from install of geoipupdate-2.5.0-1.el7.x86_64 conflicts with file from package GeoIP-1.5.0-13.el7.x86_64
file /usr/bin/geoipupdate from install of geoipupdate-2.5.0-1.el7.x86_64 conflicts with file from package GeoIP-1.5.0-13.el7.x86_64
file /usr/share/man/man1/geoipupdate.1.gz from install of geoipupdate-2.5.0-1.el7.x86_64 conflicts with file from package GeoIP-1.5.0-13.el7.x86_64
oschwald commented 4 years ago

In the meantime, I would recommend using the non-RPM binary. I suppose you could also try installing the RPM with --force.

whataboutpereira commented 4 years ago

On CentOS 8 there are conflicts with:

geolite2-country-20180605-1.el8.noarch geolite2-city-20180605-1.el8.noarch

joeyhub commented 4 years ago

The problem as I see it is with the GeoIP package providing both data and the library. That means that removing it leave you without a library.

In an ideal situation either these would be separate packages or there would be a package providing both lib and data to replace it.

Is the GeoIP package using a legacy format? I also can't find a lib package for latest lib geoip.

I suspect if more thought out it might end up with its own namespace, IE, geoip2 or geolite.

The geolite and geoip packages look like two different things, one with mmdb and one with dat. The GeoIP package is legacy.

libmaxminddb looks like the replacement package which also differs from the geoip package as it's pure lib with out the utils (such as geoiplookup).

For my use case I think it's enough to remove GeoIP and the geolite packages then just go with libmaxminddb and geoipupdate (which also provides geoiplookup according to above list).

For people who need both at the same time it might be a problem.

geoiplookup appears to only be in maxmind/geoip-api-c which is legacy.

oschwald commented 4 years ago

It appears this issue was being caused by https://github.com/goreleaser/nfpm/pull/117. It should be fixed on the next release.

lotashah commented 4 years ago

this is still broken for me.

# rpm -i geoipupdate_4.2.2_linux_amd64.rpm 
    file /etc/GeoIP.conf from install of geoipupdate-0:4.2.2-1.x86_64 conflicts with file from package GeoIP-1.5.0-13.el7.x86_64
    file /usr/bin/geoipupdate from install of geoipupdate-0:4.2.2-1.x86_64 conflicts with file from package GeoIP-1.5.0-13.el7.x86_64

using

# cat /etc/centos-release
CentOS Linux release 7.6.1810 (Core) 
oschwald commented 4 years ago

@lotashah, please upgrade GeoIP to 1.5.0-14. The version you are using included its own copy of geoipupdate, causing a conflict.

sh-darshan commented 3 years ago

@oschwald

quick question :

we have java based code written for geoipupdate-4.1.4 .. (our code queries the generated mmdb file) maven version - geoip-0.7.2

if we completely switch to geoip 1.5.0-14 will all operations work well??

(the db file format is different right? and will we be able to update this weekly via a cron job?)

oschwald commented 3 years ago

@sh-darshan, my comment about was for the C-based libGeoIP package for CentOS. It sounds like you are using the geoip2 Java package for reading MMDB files. 0.7.2 of geoip2 was released in 2014 and I would recommend that you upgrade to the latest version, 2.15.0. There have been many performance improvements and bug fixes in the past 7 years. 2.15.0 uses the same database format as 0.7.2 and should behave similarly in terms of geoipupdate.

sh-darshan commented 3 years ago

@oschwald thanks for the super quick response..

so we will upgrade geoip2 maven version to 2.15.0

on the instance, we will remove all of geoip and geoipupdate and install "GeoIP 1.5.0-14"

which geoipupdate version is compatible with this (GeoIP 1.5.0-14) so that it can generate geoip2 dbs of mmdb types?

apologies in advance if the question seems trivial but couldn't find a straightforward answer to this online.

trying GeoIP-1.5.0.11 (installed as dependency by bind-utils) along with GeoIP-update-1.5.0.11 doesn't seem to work. (sanity check database_info string failed)

Thanks

oschwald commented 3 years ago

All versions of geoipupdate are compatible with libGeoIP 1.5.0. However, libGeoIP uses the legacy database formats so you need to the dat database editions rather than the mmdb editions. The legacy dat format will be end of lifed in approximately one year. See our blog post. It looks like newer versions of BIND do support using libmaxminddb with the mmdb format, but this may not yet be available for your OS.

mjparme commented 1 week ago

What is the actual resolution for this? Trying to update my centos 7 system and get the following:

Transaction check error:
  file /etc/GeoIP.conf from install of geoipupdate-2.5.0-2.el7.x86_64 conflicts with file from package GeoIP-1.5.0-13.el7.x86_64
  file /usr/bin/geoipupdate from install of geoipupdate-2.5.0-2.el7.x86_64 conflicts with file from package GeoIP-1.5.0-13.el7.x86_64
  file /usr/share/man/man1/geoipupdate.1.gz from install of geoipupdate-2.5.0-2.el7.x86_64 conflicts with file from package GeoIP-1.5.0-13.el7.x86_64

I have read all the comments above and there doesn't appear to be a resolution mentioned.

rickmaz commented 1 week ago

you need to upgrade centos7. its obsolete and not supported anymore.