Updating file and magic

Good day, I have no easy document or search results for this:

File 5.43 supports only version 18 magic files. `/usr/share/misc/magic.mgc' is version 16

The magic file it references is from:

ls -sal /usr/share/misc/magic*
609 -r--r--r-- 1 root wheel 1315267 Sep 17 2022 /usr/share/misc/magic
665 -r--r--r-- 1 root wheel 7254168 Sep 17 2022 /usr/share/misc/magic.mgc

How do I upgrade the magic info? (Man page was reading overload with no simple example)

Thank you!

Paul
 
Hi,

I can't take credit for this. I found it elsewhere but I believe this simple method will help others going forward:

go to temp directory:

cat /usr/src/contrib/file/magic/Header \
/usr/src/contrib/file/magic/Localstuff \
/usr/src/contrib/file/magic/Magdir/* >magic


Then compile it;

file -C magic


Now install both in their default location. This needs to be done as root;

install -m 644 magic magic.mgc /usr/share/misc/

That's it. The executable 'file' will read the magic number database correctly.

This can be closed.
 
Back
Top