LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   extracting .bz2 and .gz files (https://www.linuxquestions.org/questions/linux-software-2/extracting-bz2-and-gz-files-4175460622/)

jwsmith 05-03-2013 04:37 PM

extracting .bz2 and .gz files
 
My Fedora 16 didn't come with gcc or gdb ... I want to learn ANSI C
I downloaded the compiler and debugger into my downloads directory as:
gcc-4.8.0.tar.bz2
gdb-7.6.tar.gz

I created new directories in /user/local --- gcc --- gdb
Then I moved gcc-4.8.0.tar.bz2 over to my directory /user/local/gcc
Then I placed myself in /user/local/gcc (where gcc-4.8.0.tar.bz2 is present) ---and issued this command:

$ tar -xjv gcc-4.8.0.tar.bz2
and the cursor dropped a line and "hung" with no text or result
until I entered ^C and was returned to the Command Prompt

QUESTION:
a) What's wrong with my command format?
b) Will 'tar' and the same switches work for the filename ending in .gz
c) When these files "unwrap" will I have a ready-to-go compiler?
OR--will I be given source-code that I will have to 'build'
and compile..??...and How would I do THAT, since I don't have
a compiler..??..

gilead 05-03-2013 04:42 PM

Just to get the extract working, try the following:
Code:

tar -xjvf gcc-4.8.0.tar.bz2
tar -xzvf gdb-7.6.tar.gz

You should be able to install those from the Fedora repositories - I'm not a Fedora user though so that's just my assumption.

TobiSGD 05-03-2013 04:43 PM

If you want to untar a file you have to use the -f option, in your case
Code:

tar -xjvf gcc-4.8.0.tar.bz2
The problem here is that you will end up with the source code for the compiler, for which you would need a compiler to get it running.

Why don't you just install a compiler using your package manager (after the upgrade to a supported version of Fedora, which is recommended)?

ruario 05-03-2013 05:07 PM

Quote:

Originally Posted by gilead (Post 4944422)
You should be able to install those from the Fedora repositories

Quote:

Originally Posted by TobiSGD (Post 4944423)
Why don't you just install a compiler using your package manager

+1 to the above two comments. Use the package manager!

Quote:

Originally Posted by TobiSGD (Post 4944423)
after the upgrade to a supported version of Fedora, which is recommended

And another +1 to this. Fedora 16 stopped being supported as of 2013-02-12 and hence receives no security updates.

As a final side note, to extract compressed tar packages like this in the future you could just issue 'tar xf packagename'. The 'v' option is just to show a list of files as they extract (it isn't needed) and neither 'j' nor 'z' is required unless you are extracting through a pipe (GNU tar will just work out the right compressor for you). Finally you don't need any '-' unless you start to use more complex options.

P.S. I know I didn't really need to comment on this last part as the extraction commands you received from the others will work but it is a pet peeve of mine that everyone insists on using old (and now redundant) extraction options and making things appear more complex than they need be. Modern, maintained, implementations of tar (e.g. the GNU and BSD versions) just don't need all these options for a simple extraction. 'xf' (extract, file) and you are done.

snowday 05-03-2013 05:12 PM

Fedora 16 reached its "end of life" back in February. It is obsolete and completely unsupported.

Once you have upgraded to a supported Fedora (17 or newer) you should consider using "yum groupinstall" to install gcc and other essential development tools:

Code:

yum groupinstall “Development Tools”

jwsmith 05-03-2013 05:12 PM

Mechanics of upgrade
 
Gilead and TobiSGD...thank you both

I saw the 'f' switch ion my "Mark Sobell" ref. book but was unsure what it would do.

I'm very new to LINUX

Can I upgrade from within Fedora-16?
Otherwise, what are the mechanics of upgrading an existing OS?
(When I leave this screen I will be looking at the desktop to see if an "upgrade" icon exists)

snowday 05-03-2013 05:18 PM

This page will help you upgrade to a newer Fedora release: https://fedoraproject.org/wiki/Upgrading

jwsmith 05-03-2013 05:39 PM

upgrade & 'Development Tools'
 
My questions have been answered.
Thank you.
jwsmith

John VV 05-04-2013 01:58 PM

the old fedora 16 used "preupgrade" .That never worked well
Starting in Fedora 18 they are using "Fedup" .A very different system


going from fedora 16 to 18 will almost never work -- it might but with problems

doing a NEW clean install ( reformatting the drive to ext4, the default for fedora ) is the best way to upgrade fedora


All times are GMT -5. The time now is 02:42 AM.