How to solve âÂÂtar: invalid magicâ error on Linux Alpine

Clash Royale CLAN TAG#URR8PPP
up vote
8
down vote
favorite
I'm installing sqlite on Alpine Linux. I download sqlite-autoconf-3130000.tar.gz but tar could not open it. I tried this answer but it's not working. tar gives this message:
tar: invalid magic
tar: short read
I wrote these commands.
wget https://www.sqlite.org/2015/sqlite-autoconf-3090100.tar.gz
tar -zxvf sqlite-autoconf-3090100.tar.gz
tar alpine-linux
add a comment |Â
up vote
8
down vote
favorite
I'm installing sqlite on Alpine Linux. I download sqlite-autoconf-3130000.tar.gz but tar could not open it. I tried this answer but it's not working. tar gives this message:
tar: invalid magic
tar: short read
I wrote these commands.
wget https://www.sqlite.org/2015/sqlite-autoconf-3090100.tar.gz
tar -zxvf sqlite-autoconf-3090100.tar.gz
tar alpine-linux
Could you please update your answer with the command (and its arguments) that you tried to run.
â DarkHeart
Aug 9 '16 at 6:56
1
Did the download complete successfully? If it did,ls -l sqlite-autoconf-3090100.tar.gzshould tell you that the file is 2284128 bytes in size.
â Stephen Kitt
Aug 9 '16 at 7:50
Also, is it currently a gzip formatted file? Some browsers do on the fly decompression, meaning that it might still named sqlite-autoconf-3090100.tar.gz but that the contents might actually be sqlite-autoconf-3090100.tar. No idea if wget does equally smart things, but it is easily tested by leaving of thezflag from tar.
â Hennes
Jan 25 '17 at 9:06
add a comment |Â
up vote
8
down vote
favorite
up vote
8
down vote
favorite
I'm installing sqlite on Alpine Linux. I download sqlite-autoconf-3130000.tar.gz but tar could not open it. I tried this answer but it's not working. tar gives this message:
tar: invalid magic
tar: short read
I wrote these commands.
wget https://www.sqlite.org/2015/sqlite-autoconf-3090100.tar.gz
tar -zxvf sqlite-autoconf-3090100.tar.gz
tar alpine-linux
I'm installing sqlite on Alpine Linux. I download sqlite-autoconf-3130000.tar.gz but tar could not open it. I tried this answer but it's not working. tar gives this message:
tar: invalid magic
tar: short read
I wrote these commands.
wget https://www.sqlite.org/2015/sqlite-autoconf-3090100.tar.gz
tar -zxvf sqlite-autoconf-3090100.tar.gz
tar alpine-linux
tar alpine-linux
edited Apr 13 '17 at 12:36
Communityâ¦
1
1
asked Aug 9 '16 at 6:44
daylight
141113
141113
Could you please update your answer with the command (and its arguments) that you tried to run.
â DarkHeart
Aug 9 '16 at 6:56
1
Did the download complete successfully? If it did,ls -l sqlite-autoconf-3090100.tar.gzshould tell you that the file is 2284128 bytes in size.
â Stephen Kitt
Aug 9 '16 at 7:50
Also, is it currently a gzip formatted file? Some browsers do on the fly decompression, meaning that it might still named sqlite-autoconf-3090100.tar.gz but that the contents might actually be sqlite-autoconf-3090100.tar. No idea if wget does equally smart things, but it is easily tested by leaving of thezflag from tar.
â Hennes
Jan 25 '17 at 9:06
add a comment |Â
Could you please update your answer with the command (and its arguments) that you tried to run.
â DarkHeart
Aug 9 '16 at 6:56
1
Did the download complete successfully? If it did,ls -l sqlite-autoconf-3090100.tar.gzshould tell you that the file is 2284128 bytes in size.
â Stephen Kitt
Aug 9 '16 at 7:50
Also, is it currently a gzip formatted file? Some browsers do on the fly decompression, meaning that it might still named sqlite-autoconf-3090100.tar.gz but that the contents might actually be sqlite-autoconf-3090100.tar. No idea if wget does equally smart things, but it is easily tested by leaving of thezflag from tar.
â Hennes
Jan 25 '17 at 9:06
Could you please update your answer with the command (and its arguments) that you tried to run.
â DarkHeart
Aug 9 '16 at 6:56
Could you please update your answer with the command (and its arguments) that you tried to run.
â DarkHeart
Aug 9 '16 at 6:56
1
1
Did the download complete successfully? If it did,
ls -l sqlite-autoconf-3090100.tar.gz should tell you that the file is 2284128 bytes in size.â Stephen Kitt
Aug 9 '16 at 7:50
Did the download complete successfully? If it did,
ls -l sqlite-autoconf-3090100.tar.gz should tell you that the file is 2284128 bytes in size.â Stephen Kitt
Aug 9 '16 at 7:50
Also, is it currently a gzip formatted file? Some browsers do on the fly decompression, meaning that it might still named sqlite-autoconf-3090100.tar.gz but that the contents might actually be sqlite-autoconf-3090100.tar. No idea if wget does equally smart things, but it is easily tested by leaving of the
z flag from tar.â Hennes
Jan 25 '17 at 9:06
Also, is it currently a gzip formatted file? Some browsers do on the fly decompression, meaning that it might still named sqlite-autoconf-3090100.tar.gz but that the contents might actually be sqlite-autoconf-3090100.tar. No idea if wget does equally smart things, but it is easily tested by leaving of the
z flag from tar.â Hennes
Jan 25 '17 at 9:06
add a comment |Â
3 Answers
3
active
oldest
votes
up vote
11
down vote
Try to install the tar package (apk add tar). Busybox tar (default) doesn't support all features.
2
I ran into the same issue when running a tar command in a Dockerfile and installing tar worked for me. It's kind of confusing because if you run the command in the shell in the container, it works. But not if it's a RUN command in the Dockerfile without having installed tar first. :|
â 3cheesewheel
Oct 10 '16 at 12:06
add a comment |Â
up vote
0
down vote
tar:invalid magic means that the file is corrupted.
Please check the md5sum if matches...this is what i got:
md5sum sqlite-autoconf-3090100.tar.gz
74931054399a2d7acf35637efe8d6f45 sqlite-autoconf-3090100.tar.gz
add a comment |Â
up vote
0
down vote
This doesn't necessarily mean the Alpine version of tar is incompatible, as Francesco pointed out you should really check your file checksums.
I ran into this while doing a curl https://github.com/someproject/releases/project-1.1.0.gz | tar -xvzf in my Dockerfile.
It turns out what I had forgotten was that curl will only follow redirects if you allow it with -L, and so it was never getting to the actual file, it was literally downloading the html telling it there was a redirect. Adding the -L allowed me to save the file without bloating my container with a new tar (beyond the "bloat" added by curl).
add a comment |Â
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
11
down vote
Try to install the tar package (apk add tar). Busybox tar (default) doesn't support all features.
2
I ran into the same issue when running a tar command in a Dockerfile and installing tar worked for me. It's kind of confusing because if you run the command in the shell in the container, it works. But not if it's a RUN command in the Dockerfile without having installed tar first. :|
â 3cheesewheel
Oct 10 '16 at 12:06
add a comment |Â
up vote
11
down vote
Try to install the tar package (apk add tar). Busybox tar (default) doesn't support all features.
2
I ran into the same issue when running a tar command in a Dockerfile and installing tar worked for me. It's kind of confusing because if you run the command in the shell in the container, it works. But not if it's a RUN command in the Dockerfile without having installed tar first. :|
â 3cheesewheel
Oct 10 '16 at 12:06
add a comment |Â
up vote
11
down vote
up vote
11
down vote
Try to install the tar package (apk add tar). Busybox tar (default) doesn't support all features.
Try to install the tar package (apk add tar). Busybox tar (default) doesn't support all features.
answered Aug 9 '16 at 8:56
Jakub Jirutka
21017
21017
2
I ran into the same issue when running a tar command in a Dockerfile and installing tar worked for me. It's kind of confusing because if you run the command in the shell in the container, it works. But not if it's a RUN command in the Dockerfile without having installed tar first. :|
â 3cheesewheel
Oct 10 '16 at 12:06
add a comment |Â
2
I ran into the same issue when running a tar command in a Dockerfile and installing tar worked for me. It's kind of confusing because if you run the command in the shell in the container, it works. But not if it's a RUN command in the Dockerfile without having installed tar first. :|
â 3cheesewheel
Oct 10 '16 at 12:06
2
2
I ran into the same issue when running a tar command in a Dockerfile and installing tar worked for me. It's kind of confusing because if you run the command in the shell in the container, it works. But not if it's a RUN command in the Dockerfile without having installed tar first. :|
â 3cheesewheel
Oct 10 '16 at 12:06
I ran into the same issue when running a tar command in a Dockerfile and installing tar worked for me. It's kind of confusing because if you run the command in the shell in the container, it works. But not if it's a RUN command in the Dockerfile without having installed tar first. :|
â 3cheesewheel
Oct 10 '16 at 12:06
add a comment |Â
up vote
0
down vote
tar:invalid magic means that the file is corrupted.
Please check the md5sum if matches...this is what i got:
md5sum sqlite-autoconf-3090100.tar.gz
74931054399a2d7acf35637efe8d6f45 sqlite-autoconf-3090100.tar.gz
add a comment |Â
up vote
0
down vote
tar:invalid magic means that the file is corrupted.
Please check the md5sum if matches...this is what i got:
md5sum sqlite-autoconf-3090100.tar.gz
74931054399a2d7acf35637efe8d6f45 sqlite-autoconf-3090100.tar.gz
add a comment |Â
up vote
0
down vote
up vote
0
down vote
tar:invalid magic means that the file is corrupted.
Please check the md5sum if matches...this is what i got:
md5sum sqlite-autoconf-3090100.tar.gz
74931054399a2d7acf35637efe8d6f45 sqlite-autoconf-3090100.tar.gz
tar:invalid magic means that the file is corrupted.
Please check the md5sum if matches...this is what i got:
md5sum sqlite-autoconf-3090100.tar.gz
74931054399a2d7acf35637efe8d6f45 sqlite-autoconf-3090100.tar.gz
answered Jan 25 '17 at 8:33
Francesco Colista
177110
177110
add a comment |Â
add a comment |Â
up vote
0
down vote
This doesn't necessarily mean the Alpine version of tar is incompatible, as Francesco pointed out you should really check your file checksums.
I ran into this while doing a curl https://github.com/someproject/releases/project-1.1.0.gz | tar -xvzf in my Dockerfile.
It turns out what I had forgotten was that curl will only follow redirects if you allow it with -L, and so it was never getting to the actual file, it was literally downloading the html telling it there was a redirect. Adding the -L allowed me to save the file without bloating my container with a new tar (beyond the "bloat" added by curl).
add a comment |Â
up vote
0
down vote
This doesn't necessarily mean the Alpine version of tar is incompatible, as Francesco pointed out you should really check your file checksums.
I ran into this while doing a curl https://github.com/someproject/releases/project-1.1.0.gz | tar -xvzf in my Dockerfile.
It turns out what I had forgotten was that curl will only follow redirects if you allow it with -L, and so it was never getting to the actual file, it was literally downloading the html telling it there was a redirect. Adding the -L allowed me to save the file without bloating my container with a new tar (beyond the "bloat" added by curl).
add a comment |Â
up vote
0
down vote
up vote
0
down vote
This doesn't necessarily mean the Alpine version of tar is incompatible, as Francesco pointed out you should really check your file checksums.
I ran into this while doing a curl https://github.com/someproject/releases/project-1.1.0.gz | tar -xvzf in my Dockerfile.
It turns out what I had forgotten was that curl will only follow redirects if you allow it with -L, and so it was never getting to the actual file, it was literally downloading the html telling it there was a redirect. Adding the -L allowed me to save the file without bloating my container with a new tar (beyond the "bloat" added by curl).
This doesn't necessarily mean the Alpine version of tar is incompatible, as Francesco pointed out you should really check your file checksums.
I ran into this while doing a curl https://github.com/someproject/releases/project-1.1.0.gz | tar -xvzf in my Dockerfile.
It turns out what I had forgotten was that curl will only follow redirects if you allow it with -L, and so it was never getting to the actual file, it was literally downloading the html telling it there was a redirect. Adding the -L allowed me to save the file without bloating my container with a new tar (beyond the "bloat" added by curl).
answered Sep 24 at 23:55
dragon788
1379
1379
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f302192%2fhow-to-solve-tar-invalid-magic-error-on-linux-alpine%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Could you please update your answer with the command (and its arguments) that you tried to run.
â DarkHeart
Aug 9 '16 at 6:56
1
Did the download complete successfully? If it did,
ls -l sqlite-autoconf-3090100.tar.gzshould tell you that the file is 2284128 bytes in size.â Stephen Kitt
Aug 9 '16 at 7:50
Also, is it currently a gzip formatted file? Some browsers do on the fly decompression, meaning that it might still named sqlite-autoconf-3090100.tar.gz but that the contents might actually be sqlite-autoconf-3090100.tar. No idea if wget does equally smart things, but it is easily tested by leaving of the
zflag from tar.â Hennes
Jan 25 '17 at 9:06