Debian Linux 上的 tar 错误

Debian Linux 上的 tar 错误

我下载了 Firefox tarball。当我尝试Firefox-latest.tar.bz2通过以下方式提取时:

sudo tar -jxvf Firefox-latest.tar.bz2

终端上出现一些错误:

tar: .: Not found in archive
tar: Exiting with failure status due to previous errors

然后我尝试命令:

sudo tar -jxf Firefox-latest.tar.bz2

还是错误!

那么,我该如何解决此错误?为什么会发生这种情况?

答案1

如果下载不完整,错误应该是这样的

$ tar jxvf firefox-12.0.tar.bz2
firefox/
firefox/mozilla-xremote-client
firefox/platform.ini
firefox/libsoftokn3.chk
firefox/libnssckbi.so
firefox/libxul.so

bzip2: Compressed file ends unexpectedly;
    perhaps it is corrupted?  *Possible* reason follows.
bzip2: Inappropriate ioctl for device
    Input file = (stdin), output file = (stdout)

It is possible that the compressed file(s) have become corrupted.
You can use the -tvv option to test integrity of such files.

You can use the `bzip2recover' program to attempt to recover
data from undamaged sections of corrupted files.

tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now

然而,您描述的输出正是执行以下命令所获得的输出:

$ tar jxvf firefox-12.0.tar.bz2 .
tar: .: Not found in archive
tar: Exiting with failure status due to previous errors

我相信你出于某种原因有一个尾随.。也许因为你认为你必须以这种方式指定提取目录(你-C如果需要,可以用 指定它,但这.是默认的)。

答案2

尝试重新下载该文件。tar -jxvf firefox-12.0.tar.bz2从这里下载后,它在我的系统上有效:http://www.mozilla.org/en-US/firefox/all.html

答案3

文件下载是否完整且无错误,大小是否正确?如果运行“file Firefox-latest.tar.bz2”,返回什么?

相关内容