Atjohns97
Posts: 15
Joined: Mon Jul 22, 2013 9:46 pm

How do you run tar.gz packages in Raspian?

Thu Aug 08, 2013 2:00 pm

I downloaded a tar.gz file and I was wondering if I could get it running.

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: How do you run tar.gz packages in Raspian?

Thu Aug 08, 2013 2:01 pm

tar.gz files are archives, like zip files in windows.

to un-archive the file, you run this on the command line

Code: Select all

tar -xvzf tarfile.tar.gz
Which will then extract the contents of the file.
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

User avatar
some_evil
Posts: 205
Joined: Thu Dec 18, 2014 3:16 am
Location: Albury, Australia

Re: How do you run tar.gz packages in Raspian?

Fri Jan 09, 2015 9:09 am

SirLagz wrote:
Which will then extract the contents of the file.
Is there a default extract location??? Where do the extracted files go when extracting these .gz files?
PiZeroW - May 2017
Pi 3 - Oct 2016
PiZero - June 2016
Pi 2 - Jan 2016
Pi B+ - Dec 25 2014

diederik
Posts: 394
Joined: Wed Mar 26, 2014 11:17 pm

Re: How do you run tar.gz packages in Raspian?

Fri Jan 09, 2015 12:16 pm

some_evil wrote:
SirLagz wrote:Which will then extract the contents of the file.
Is there a default extract location??? Where do the extracted files go when extracting these .gz files?
Yes, the current directory.
See man tar if you want to change that

Standarde
Posts: 1
Joined: Mon Jun 04, 2018 1:58 am

Re: How do you run tar.gz packages in Raspian?

Mon Jun 04, 2018 2:06 am

Ok so i have used tar -xvzf tarfile.tar.gz to try extracting a few tar.gz files; it seems to work as i get no error, it just scoots down to the next row waiting for another command as usual. The problem is I have no idea where the uncompressed files were extracted to. They are not in the current directory as i have read they should be.

SOCSBC
Posts: 17
Joined: Thu May 31, 2018 4:12 pm
Location: Houston, Texas, U.S.A.

Re: How do you run tar.gz packages in Raspian?

Mon Jun 04, 2018 1:15 pm

I'm still (re)learning this stuff, myself, but this may help:

https://www.howtogeek.com/248780/how-to ... -on-linux/

To wit:
Extract an Archive
Once you have an archive, you can extract it with the tar command. The following command will extract the contents of archive.tar.gz to the current directory.

tar -xzvf archive.tar.gz
It’s the same as the archive creation command we used above, except the -x switch replaces the -c switch. This specifies you want to extract an archive instead of create one.

You may want to extract the contents of the archive to a specific directory. You can do so by appending the -C switch to the end of the command. For example, the following command will extract the contents of the archive.tar.gz file to the /tmp directory.

tar -xzvf archive.tar.gz -C /tmp

User avatar
jahboater
Posts: 6715
Joined: Wed Feb 04, 2015 6:38 pm
Location: Wonderful West Dorset

Re: How do you run tar.gz packages in Raspian?

Mon Jun 04, 2018 1:23 pm

I just do:-

tar xf archive.tar.gz

which is slightly shorter (tar will work out what to do).

epoch1970
Posts: 6114
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: How do you run tar.gz packages in Raspian?

Mon Jun 04, 2018 1:29 pm

Standarde wrote:
Mon Jun 04, 2018 2:06 am
Ok so i have used tar -xvzf tarfile.tar.gz to try extracting a few tar.gz files...
Since you used "-v" the path of the extracted files was printed during execution.
It is possible (and possibly unfortunate) that the tar file was built with files referenced from their absolute path. The absolute path starts at "/" (filesystem root).
  • If you were in your homedir and the tar file contained "/usr/local/bin/somescript.sh", go to /usr/local/bin to find that file.
  • If you were in your homedir and the tar file contained "supertools/somescript.sh", go to the "supertools" directory that was created in your home directory to find the file.
Use "tar -tvf tarfile" to list the contents of a tar file before extracting it.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

Return to “Raspberry Pi OS”