Linux tar:错误不可恢复:现在退出
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3950839/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
tar: Error is not recoverable: exiting now
提问by udo
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.
untar 操作有效,但我总是收到此错误消息。
Any clues what I do wrong?
任何线索我做错了什么?
采纳答案by Peter G.
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
回答by Aram
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
,我在通过浏览器下载档案时遇到了同样的问题。比我只是复制存档链接并在终端中使用命令:
wget http://PATH_TO_ARCHIVE
回答by Axelfoley
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:
通过添加点和斜线确保 tar 知道您正在谈论当前目录:
[me@server ~]$ tar -xvf ./nameOfMyTar.tar -C ./someSubDirectory/
./foo/
./bar/
[me@server ~]$
回答by Jose Caicedo
The problem is that you do not have bzip2 installed. The tar program relies upon this external program to do compression. For installing bzip2, it depends on the system you are using. For example, with Ubuntu that would be on Ubuntu
问题是你没有安装 bzip2。tar 程序依赖这个外部程序进行压缩。对于安装 bzip2,这取决于您使用的系统。例如,在 Ubuntu 上的 Ubuntu
sudo apt-get install bzip2
The GNU tar program does not know how to compress an existing file such as user-logs.tar (bzip2 does that). The tar program can use external compression programs gzip, bzip2, xz by opening a pipe to those programs, sending a tar archive via the pipe to the compression utility, which compresses the data which it reads from tar and writes the result to the filename which the tar program specifies.
GNU tar 程序不知道如何压缩诸如 user-logs.tar 之类的现有文件(bzip2 可以做到这一点)。tar 程序可以使用外部压缩程序 gzip、bzip2、xz,通过打开这些程序的管道,通过管道将 tar 存档发送到压缩实用程序,压缩实用程序压缩从 tar 读取的数据并将结果写入文件名tar 程序指定。
Alternatively, the tar and compression utility could be the same program. BSD tar does its compression using lib archive (they're not really distinct except in name).
或者,tar 和压缩实用程序可以是同一个程序。BSD tar 使用 lib 存档进行压缩(除了名称之外,它们并没有真正不同)。