I am running Amazon Linux centos however the version of the file which gets installed is 5.30. I require a later version.

file: Compiled magic version [534] does not match with shared library magic version [530]

steps to reproduce:

wget -m ftp://ftp.astron.com/pub/file/file-5.34.tar.gz
cd ftp.astron.com/pub/file/
tar -zxf file-5.34.tar.gz 
cd file-5.34
./configure --prefix=/usr
make install

on my ubuntu machine, I can follow which involved removing libmagic before doing the install. What's the equivalent on centos / amazon linux?

Or is there an easier way to yum install file 5.34 other than by compiling it?


I also had to purge the compiled magic file itself for libmagic to update correctly when compiling this manually. At this time, only the bugged version (5.32) is available from Canonical's repos so, it's your only route at this point in time. Make sure you apt purge /both/ libmagic1 and libmagic-mgc before you compile/install file. Then libmagic should update appropriately for you.

  • I'm looking for a centos equivalent. Whenever I do it on centos I get an error see this output as an example: pastebin.com/q1VjLYhD – bob dylan Aug 21 '18 at 8:11

When you build file from scratch, it installs the shared libraries in /usr/lib/. Debian based Linuxes, and I believe CentOS falls into this category, install the file shared libraries in /usr/lib/x86_64-linux-gnu/ or whatever *-linux-gnu is appropriate for your architecture. You'll need to either set the appropriate config options (--libdir=/usr/lib/x86_64-linux-gnu--I think) to overwrite, or overwrite by hand, or delete the old files by hand.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.