解压缩tar.gz文件的问题 [英] Issues uncompressing a tar.gz file

查看:340
本文介绍了解压缩tar.gz文件的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试解压缩以下文件:

I have been trying to uncompress the following file:

sudo wget http://download.oracle.com/otn-pub/java/jdk/7u21-b11/jdk-7u21-linux-x64.tar.gz

具有以下内容:

sudo tar zxvf jdk-7u21-linux-x64.tar.gz -C /usr/lib/jvm/

我收到此错误

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now

我正在使用Amazon Linux实例。默认安装jre而不是jdk,我需要能够运行jboss。我会使用 yum 安装jdk,但遗憾的是它似乎不可能。我遇到的问题是,如果我从我能够辨别出来的所有事情中做出正确的事情,那么为什么它不起作用是没有意义的。我已经下载了两个不同的版本,以确保它不仅仅是损坏的文件。任何帮助解决这个问题将不胜感激!

I am using an Amazon Linux instances. By default jre is installed instead of the jdk, which I need to be able to run jboss. I would install the jdk using yum, but unfortunately it doesn't seem to be possible. Issue I am having is that it doesn't make sense why its not working if I am doing everything right from what I have been able to discern. I have downloaded two different versions just to be sure its not just corrupted files. Any help figuring this out would be greatly appreciated!

推荐答案

文件未正确提取的原因是因为下载页面在您接受许可协议时设置cookie 。如果您在尝试下载文件时没有会话cookie,它会将您重定向到一个HTML页面,告诉您首先接受该协议。如果您打开从 wget 获得的.tar.gz,您将看到它是一个HTML文件,因为它没有获得所述cookie。

The reason the file isn't extracting properly is because the download page is setting a cookie when you accept the license agreement. If you don't have the session cookie when attempting to download the file, it redirects you to an HTML page that tells you to accept the agreement first. If you open the .tar.gz that you're getting from wget, you'll see that it's an HTML file since it's not getting said cookie.

最简单的解决方法是先使用网络浏览器下载文件,然后将其上传到网络服务器。

The easiest way to solve it is to download the file first, using your web browser, and then upload it to your web server.

这篇关于解压缩tar.gz文件的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆