tar: Error is not recoverable: exiting now

2019-03-17 19:42发布

when I untar doctrine

-rw-r--r-- 1 root root 660252 2010-10-16 23:06 Doctrine-1.2.0.tgz

I always get this error messages

root@X100e:/usr/local/lib/Doctrine/stable# tar -xvzf Doctrine-1.2.0.tgz

.
.
.

Doctrine-1.2.0/tests/ViewTestCase.php
Doctrine-1.2.0/CHANGELOG

gzip: stdin: decompression OK, trailing garbage ignored
Doctrine-1.2.0/COPYRIGHT
Doctrine-1.2.0/LICENSE
tar: Child returned status 2
tar: Error is not recoverable: exiting now

The untar operation works, but I always get this error messages.

Any clues what I do wrong?

3条回答
Luminary・发光体
2楼-- · 2019-03-17 20:21

I got the error when extracting files on a server subdirectory.

[me@server ~]$ tar -xvf nameOfMyTar.tar -C /someSubDirectory/
tar: /someSubDirectory: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
[me@server ~]$

My solution was rather simple.

Make sure tar knows you are talking about the current directory by adding dots and slashes:

[me@server ~]$ tar -xvf ./nameOfMyTar.tar -C ./someSubDirectory/
./foo/
./bar/
[me@server ~]$ 
查看更多
老娘就宠你
3楼-- · 2019-03-17 20:28

Try to get your archive using wget, I had the same issue when I was downloading archive through browser. Than I just copy archive link and in terminal use the command:

wget http://PATH_TO_ARCHIVE
查看更多
兄弟一词,经得起流年.
4楼-- · 2019-03-17 20:33

I would try to unzip and untar separately and see what happens:

mv Doctrine-1.2.0.tgz Doctrine-1.2.0.tar.gz
gunzip Doctrine-1.2.0.tar.gz
tar xf Doctrine-1.2.0.tar
查看更多
登录 后发表回答