I'm trying to install JavaSE on a OpenWrt (Pandorabox) device. When I run
tar -xvf ejdk-8u65-linux-arm-sflt.tar.gz
tar: invalid tar magic.
How can I solve this problem?
Stack Exchange network consists of 181 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.Visit Stack Exchange
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
The version of tar on OpenWRT is a smaller one than the one on full-blown systems, designed to fit small devices (it's BusyBox.) To keep small, it lacks features such as the automatic detection of compressed archives.
Try declaring the compression format manually with the
tar -xvzf ejdk-8u65-linux-arm-sflt.tar.gz
Support for gzip in the
tar utility is an optional feature that may or may not be enabled on OpenWRT. If you don't have it, call
gzip -dc) explicitly:
zcat ejdk-8u65-linux-arm-sflt.tar.gz | tar -xvf -
tar: invalid tar magicDec 14, 2015 at 20:03
rt.jaris the last file in the tar archive. Maybe the
invalid tar magic messageis only an irrelevant warning? Dec 14, 2015 at 21:03
rt.jarhave the right size after extraction? This message indicates that something about the format of the tar file isn't supported, but this may well be harmless trailing garbage. Dec 14, 2015 at 21:18
I had the same problem when extracting an archive, finally I upgraded
tar and it solved the problem.
opkg update opkg upgrade tar
tardoesn't automatically recognize
gzipfiles, try adding
-zto the command