LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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

Reply
 
LinkBack Search this Thread
Old 02-26-2013, 07:47 AM   #16
baloon68
LQ Newbie
 
Registered: Sep 2012
Location: Slovakia
Distribution: Mint 13, Ubuntu 12, opensuse 12.3
Posts: 11

Rep: Reputation: Disabled
could not extract the ipk file


I did as colucix write : ar t filename.ipk and it says file format not recognized
or ar x filename.ipk and it did that too. What am I doing wrong?
 
Old 02-27-2013, 12:46 AM   #17
grail
Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 7,185

Rep: Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784
Please start your own question and reference this one as it is well out dated and you have not provided any information on what you are trying to do and what , if any, are your errors.
 
Old 02-27-2013, 01:40 AM   #18
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 1,632

Rep: Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729
Quote:
Originally Posted by chrism01 View Post
I would have said

tar -jxf *.tar.bz2

According to this http://linux.die.net/man/1/tar there's no -a flag and -j is for bzip2 files
But that is an outdated and incomplete man page and does not show all the options (look at 'tar --help' on your distro and see the 'Compression options' section or look at GNU tar's info page, or at the 8.1.1 Creating and Reading Compressed Archives section of the online GNU tar HTML manual). Modern versions of GNU tar (from 1.20, which was released on 2008-04-14 and all subsequent versions) do indeed support the 'a' flag to automatically decide on what compressor to use based on file extension. That said, 'a' is only supposed to used for compression, GNU tar will automatically use the right decompressor based on extension (and/or magic number) in any case (that feature was added in 1.15, back in 2004-12-20), hence there is no need for either 'j' or 'a' in decompression examples (or '-' to specify flags for that matter).

You can decompress bzip2 compressed files as simply as the following if using a GNU tar from the last 8 years (this is also true for recent versions of BSD tar based on libarchive):

Code:
tar xf file.tar.bz2
If you are using some other tar variant the way that will always work is:

Code:
bzip2 -cd file.tar.bz2 | tar -xf-
P.S. If you want to confirm the dates when these automatic compression and decompression features where added, see the releases section of the GNU tar page.

Last edited by ruario; 02-27-2013 at 02:34 AM. Reason: Added link to changelog for GNU tar; added the detail about magic number
 
Old 02-27-2013, 02:18 AM   #19
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 1,632

Rep: Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729
Quote:
Originally Posted by colucix View Post
Regarding the IPK files, they are archived and compressed debian packages meant to be used on embedded systems with limited storage capacity. Usually the archives were created using ar (not tar) so that you can try to list or extract their content using
Code:
ar t file.ipk
ar x file.ipk
respectively. Nowadays ipk packages are managed by opkg.
Actually, although based on deb file format the outer container is not ar (like deb) but a gzipped tar, e.g. inspect the following ipkg-opt_0.99.163-10_arm.ipk.

So to extract the contents you would actually do the following:

Code:
tar xf filename.ipk
To the OP, installing it is another matter and would only be appropriate if you use a system that actually uses .ipk files. What are you actually trying to install, what are you trying to achieve by doing this and what is your distro?
 
Old 02-27-2013, 02:29 AM   #20
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 1,632

Rep: Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729
If all else fails, when trying to extract from some archive you know little about I would try installing BSD Tar (it is readily available on most distros) and using that. It uses libarchive and can extract from a wide range of formats, tar, cpio, ar, zip, rpm, ISO_9660, etc. and automatically detects a variety of compression methods. It supports most of the same command line options as GNU tar. So to inspect the contents of an archive:

Code:
bsdtar tf archive
For a more detailed overview with a summary showing archive format and compression at the end:

Code:
bsdtar tvvf archive
Or to extract

Code:
bsdtar xf archive
If this doesn't work you could always try to gather more information about what the file actually is using the file command:

Code:
file archive
and if that doesn't work search on the internet using the file extension as one of your keywords.

That all said, when asking questions it is better to include what your 'end goal' is as it may allow someone to suggest an alternative method to achieve what you desire.

EDIT: I only just realised this was a dead thread that was resurrected by baloon68. Sorry about that!

Last edited by ruario; 03-06-2013 at 03:56 AM. Reason: Added comment about this being an old thread; changed tar to bsdtar in examples
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
a tough question 4 u, problem in extracting tar & tar.gz files p_garg Linux - General 5 11-08-2010 11:02 AM
need help with installing *.tar.bz2 files YberDo Linux - Software 22 05-08-2007 04:46 PM
installing tar.bz2 files M O L8ingN2dust Mandriva 2 03-26-2005 03:46 AM
extracting tar.bz2.gz files crank Linux - Newbie 5 04-18-2004 11:33 PM
extracting .bz2 files mjkramer Linux - Newbie 4 10-16-2003 09:23 PM


All times are GMT -5. The time now is 01:20 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration