Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CentOS 7: geoipupdate conflicts GeoIP #76

Closed
neonknight opened this issue Jan 22, 2020 · 13 comments
Closed

CentOS 7: geoipupdate conflicts GeoIP #76

neonknight opened this issue Jan 22, 2020 · 13 comments

Comments

@neonknight
Copy link

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
Copy link

frayber commented Jan 28, 2020

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
Copy link
Member

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
Copy link

leem32 commented Jan 29, 2020

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

@leem32 leem32 mentioned this issue Jan 29, 2020
@oschwald
Copy link
Member

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

@whataboutpereira
Copy link

On CentOS 8 there are conflicts with:

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

@joeyhub
Copy link

joeyhub commented Feb 4, 2020

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
Copy link
Member

It appears this issue was being caused by goreleaser/nfpm#117. It should be fixed on the next release.

oschwald added a commit that referenced this issue Feb 20, 2020
oschwald added a commit that referenced this issue Feb 20, 2020
oschwald added a commit that referenced this issue Feb 20, 2020
oschwald added a commit that referenced this issue Feb 20, 2020
4.2.0

* The major version of the module is now included at the end of the module
  path. Previously, it was not possible to import the module in projects that
  were using Go modules. Reported by Roman Glushko. GitHub #81.
* The minimum Go version is now 1.13.
* A valid account ID and license key combination is now required for database
  downloads, so those configuration options are now required.
* The error handling when closing a local database file would previously
  ignore errors and, upon upgrading to `github.com/pkg/errors` 0.9.0,
  would fail to ignore expected errors. Reported by Ilya Skrypitsa and
  pgnd. GitHub #69 and #70.
* The RPM release was previously lacking the correct owner and group on files
  and directories. Among other things, this caused the package to conflict with
  the `GeoIP` package in CentOS 7 and `GeoIP-GeoLite-data` in CentOS 8. The
  files are now owned by `root`. Reported by neonknight. GitHub #76.
@lotashah
Copy link

lotashah commented Feb 24, 2020

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
Copy link
Member

@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
Copy link

sh-darshan commented May 21, 2021

@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
Copy link
Member

@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
Copy link

@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
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

8 participants