Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Is there a simple method of converting a tar.xz into a tar.gz from the terminal? Maybe there is a free application that I can download that someone here is aware of? I would rather not use online converters... not sure why but I dont trust them lol.
Is there a simple method of converting a tar.xz into a tar.gz from the terminal? Maybe there is a free application that I can download that someone here is aware of? I would rather not use online converters... not sure why but I dont trust them lol.
Is there some reason you don't just run "xz -d <file>.tar.gz && gzip *.tar"? Or just uncompress the file, and re-compress it with "tar xvfz"???
Well I am working with a make file designed to unpack .gz files and my C/Makefile skills are almost non-existent.
This makes no sense.
tar does not need any flags to create the proper zipped file type, it will detect based on the filename extension.
tar will not block you for different file types, it will contend with the files based on their extensions.
What I mean is/are:
Code:
To Create:
$ tar cvf new-filename.tar.bz2 [list of files]
This creates a tar with the bz2 extension and does the compression properly
Code:
To Extract:
$ tar xvf filename.tar.gz
$ tar xvf filename.tar.bz2
These extract those various tar file names with no special flags or actions done in advance of calling the tar command. No need to unzip in advance
Recommend you just use the tar command in your Makefile.
Why doesn't the command suggested by TB0ne work for you? Have you not tried it? Or better yet, if you've tried and it doesn't work, what is the continued problem?
Quote:
Originally Posted by TB0ne
Is there some reason you don't just run "xz -d <file>.tar.gz && gzip *.tar"? Or just uncompress the file, and re-compress it with "tar xvfz"???
We most certainly know plenty of things, please try not be taunt other users, we don't know exactly what you're trying to do.
Quote:
Originally Posted by vysero
I mean if you dont know the answer to the question that's fine. Anyone else know?
And also realize that there are many different ways to do the same thing.
Quote:
Originally Posted by vysero
Well I am working with a make file designed to unpack .gz files and my C/Makefile skills are almost non-existent.
Perhaps you ought to be more direct and post representative code from your Makefile, and then say exactly something like, "I have <this> and I need it to be converted to <that>"
Once again, tar will unpack gz files, why don't you try it?
Perhaps where you can benefit from is a description about how to include a call to tar from within your Makefile. Because that is exactly what can be done.
That's the problem. Why are we wasting time trying to figure out my motivations for wanting to convert a file type? All I want to know is if there is a simple command, method or application for converting a tar.gz into a tar.xz.
That's the problem. Why are we wasting time trying to figure out my motivations for wanting to convert a file type? All I want to know is if there is a simple command, method or application for converting a tar.gz into a tar.xz.
OK, sorry for wasting your time.
There is no one, simple command.
There is no application which will do this in one call.
The only method I know of is exactly what TB0ne suggested.
I mean if you dont know the answer to the question that's fine. Anyone else know?
You were given the answer. And as was said...your post makes no sense, in the context in which you framed it. You said:
Quote:
Originally Posted by vysero
Well I am working with a make file designed to unpack .gz files and my C/Makefile skills are almost non-existent.
...indicating you're developing/deploying software, you have some knowledge of C/Makefile, and you ALREADY know how to unpack a .gz file. Seems very odd, then, that you can't use another command, read a man page on the xz, gzip, or tar commands. Specifically, "tar -cJF", which extracts a .tar.xz file, providing you have the xz-utils installed.
We don't know your skill level, or what you've done/tried unless you tell us and provide details. You asked a question, and I gave you an exact answer. Whether you know how to use it past that point is unknown.
He didn't suggest a method for changing the file types. He suggested a method for unpacking tar files.
No offense but you sound as if you're objecting merely for the sake of raising an objection.
There is no known method to directly convert.
Since you seem to be developing code, perhaps you can write some which will fulfill this functional need you have and then you can share that as a contribution for the community at large.
Sorry, but at present the only way to perform what you wish to accomplish would be to extract the files from the first file and then repack them into a newly created archive file of your desired format.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.