LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how do i install gcc from a tar.bz2 file when i have no C/C++ compiler installed (https://www.linuxquestions.org/questions/linux-newbie-8/how-do-i-install-gcc-from-a-tar-bz2-file-when-i-have-no-c-c-compiler-installed-659982/)

sagitalk 08-02-2008 02:04 PM

how do i install gcc from a tar.bz2 file when i have no C/C++ compiler installed
 
hello , i'm new to linux..i have installed Red Hat Linux Enterprise Edition 5 on my PC....but only the basic installation has been done so i have no software packages installed......i want to install gcc so that i can start writing C/C++ programs....i downloaded a tar.bz2 file which i extracted and have now got a folder....i am not understanding as to how do i proceed further with the installation......there is a html document that states a lengthy procedure for installation which i could not understand......pl guide me......
regards,
sagitalk

lazlow 08-02-2008 02:14 PM

You cannot do it that way. You have to have a compiler in order to compile.

RH is based on rpms. Yum is the package manager for RHEL5. So " yum install gcc " (as root) should get you started.

sagitalk 08-02-2008 02:16 PM

thank u i will begin right way but will get back in case of a problem

rahilmaknojia 08-02-2008 02:17 PM

You can get gcc++ from ur cds or DVD, if u have created yum server then u can type command "yum install gcc*"

sagitalk 08-02-2008 02:18 PM

Loading "installonlyn" plugin
Loading "rhnplugin" plugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Setting up repositories
No Repositories Available to Set Up
Reading repository metadata in from local files
Parsing package install arguments
Setting up repositories
No Repositories Available to Set Up
Reading repository metadata in from local files
No Match for argument: gcc
Nothing to do


this is the message i got after typing the yum install gcc command

sagitalk 08-02-2008 02:20 PM

i do not have any CD/DVD for this........i have extracted the tar.bz2 file and there is a lenghty installation process which requires configuration, build, testing and final install....but reading the file is proving to be of no use

sagitalk 08-02-2008 02:23 PM

what exactly is yum and how will it help me install a C/C++ compiler

lazlow 08-02-2008 02:35 PM

Ok, from post number 5, it is showing that you have not registered you install with RH. You do understand that RHEL requires you to pay for a subscription?

Ok there are three main ways to installs software. 1. compile it(but you need a compilers to compile). 2. Some (mostly RH based) systems use rpms to install binary packages. 3. Some (Debian based) systems use debs to install binary packages. The short answer is that debs and rpms are just two ways of doing the same thing.

Debs and rpms both use repos(repositories) of software on remote servers (and their mirros) to store their software. The vast majority of software an ordinary user will require is in these repos (Thunderbird, FF, OOoffice, gcc/gcc++, etc). Currently RHEL uses yum to access those repos. So "yum install software_package" is how one generally installs software.

rahilmaknojia 08-02-2008 02:55 PM

The error u found is that you dont have RH subscription you have to register to rhn.redhat.com or use CentOS its same as rhel5 no diff just logos are diff and you can get any updates.

rahilmaknojia 08-02-2008 02:59 PM

Quote:

Originally Posted by sagitalk (Post 3234521)
i do not have any CD/DVD for this........i have extracted the tar.bz2 file and there is a lenghty installation process which requires configuration, build, testing and final install....but reading the file is proving to be of no use

Go to command prompt then go to directory where u have extracted ur file then run ./configure then after completed this run make then make install it will work

TITiAN 08-02-2008 05:01 PM

Quote:

Originally Posted by rahilmaknojia (Post 3234547)
Go to command prompt then go to directory where u have extracted ur file then run ./configure then after completed this run make then make install it will work

no it won't >_>
dito (he doesn't have a compiler [needed for the *.tar.bz2] to begin with)

marsques 08-02-2008 06:30 PM

Couldn't he just download the gcc rpm package from the CentOS site and install it?

sagitalk 08-03-2008 12:10 AM

hello, thank you all for the prompt replies.......but i am still confused as to how do i install a C/C++ compiler....is there something that is already compiled and i can copy it to my PC and get started with C/C++ is there a C/C++ in any other format which may help my case....pl do let me know

lazlow 08-03-2008 12:25 AM

Yes. rpms are already compiled. You can register your RHEL and get it from RH via yum. You can switch the repos and use Centos' rpm. You can look through Centos' repo and install it (the rpm) manually.

rahilmaknojia 08-03-2008 12:36 AM

As I told you download CentOS its same as RH only logos are different and very thing like services are same as RH, if u dont blive I was the one who used RH the switch to CentOS bcoz of subscription, So go ahead and download CentOS.

ehawk 08-03-2008 12:41 AM

The previous posts tried to explain that because you installed RHEL 5, but probably are not paying a subscription, you cannot use the RHEL repositories for installing software. Since Centos 5 aims, and is pretty successful, at being 100% binary compatible with RHEL 5, you can change the software repository used by the yum package manager to refer to Centos 5 sites instead of the official RHEL 5 sites with minimal, if any, disruption. The following site shows how to do this. It is merely a matter of changing the contents of the file stored in /etc/yum.repos.d/ using a text editor:

http://www.centos.org/modules/newbb/...?topic_id=7905

You will then be able to issue the yum commands to install all the normal software packages as suggested in the posts above.

Hope this helps. Keep posting with questions and problems you experience.

The CentOS people take advantage of the fact that Red Hat releases their software under the General Public License to just blatantly copy all the source code for you free use. They just have to remove the other aspects of the Red Hat's intellectual property that are not covered by the GPL (trademarks). They host the blatantly copied source code on their own servers.

This is why you need to change the contents of the file in the /etc/yum.repos.d/ directory. You need to tell yum to stop looking at the offical RHEL servers for software and instead look at Centos' servers.

sagitalk 08-03-2008 12:45 AM

i have downloaded a rpm package for gcc named gcc-4.3.1-6.ppc.rpm
i typed rpm -i gcc-4.3.1-6.ppc.rpm on the command prompt and got the following error....

error: Failed dependencies:
binutils >= 2.17.50.0.17-3 is needed by gcc-4.3.1-6.ppc
cpp = 4.3.1-6 is needed by gcc-4.3.1-6.ppc
glibc-devel >= 2.2.90-12 is needed by gcc-4.3.1-6.ppc
libgcc >= 4.3.1-6 is needed by gcc-4.3.1-6.ppc
libgomp = 4.3.1-6 is needed by gcc-4.3.1-6.ppc
libgomp.so.1 is needed by gcc-4.3.1-6.ppc

how do i install these subordinate things required

rahilmaknojia 08-03-2008 12:50 AM

Quote:

Originally Posted by sagitalk (Post 3234831)
i have downloaded a rpm package for gcc named gcc-4.3.1-6.ppc.rpm
i typed rpm -i gcc-4.3.1-6.ppc.rpm on the command prompt and got the following error....

error: Failed dependencies:
binutils >= 2.17.50.0.17-3 is needed by gcc-4.3.1-6.ppc
cpp = 4.3.1-6 is needed by gcc-4.3.1-6.ppc
glibc-devel >= 2.2.90-12 is needed by gcc-4.3.1-6.ppc
libgcc >= 4.3.1-6 is needed by gcc-4.3.1-6.ppc
libgomp = 4.3.1-6 is needed by gcc-4.3.1-6.ppc
libgomp.so.1 is needed by gcc-4.3.1-6.ppc

how do i install these subordinate things required

Ist you will need to have dependencies file to install gcc++ u can find it from ur linux CDs or DVDs or type file name in google which u needed and u will find it or go to rpmfinder.net

lazlow 08-03-2008 12:52 AM

Ok, rpms come in 4 basic types for each distro and version.

.src.rpms= source rpms
.ppc.rpms for ppc computers (macs until recently)
.i386(or i686) rpms for 32bit computers or 32bit OS running on 64 bit computer.
.x86_64 (or some variant thereof) for 64 bit computers.

You probably need the i386 rpm depending on what you have installed.

sagitalk 08-03-2008 12:55 AM

i have the RedHat Enterprise Linx 5 so which package do i reqire for that the .i386??

lazlow 08-03-2008 12:59 AM

Yes, but there is a .ppc rhel5, .i386 rhel5, and a .i686 rhel5.

Post the results of "uname -a". That should tell us.

sagitalk 08-03-2008 01:01 AM

this is the result of the uname -a command

Linux localhost.localdomain 2.6.18-8.el5 #1 SMP Fri Jan 26 14:15:21 EST 2007 i686 i686 i386 GNU/Linux

lazlow 08-03-2008 01:10 AM

Ok, that says that you are using the 32bit version. So you need to use rpms with i386 (or i586 or i686) in the name.

Quote:

gcc-4.1.2-42.el5.i386.rpm

sagitalk 08-03-2008 01:12 AM

i downloaded the package gcc-3.2.2-5.i386.rpm

now when i run the command rpm -i gcc-3.2.2-5.i386.rpm

i got the following error

warning: gcc-3.2.2-5.i386.rpm: Header V3 DSA signature: NOKEY, key ID db42a60e
error: Failed dependencies:
cpp = 3.2.2-5 is needed by gcc-3.2.2-5.i386
glibc-devel >= 2.2.90-12 is needed by gcc-3.2.2-5.i386

sagitalk 08-03-2008 01:19 AM

now i have the following packages on my desktop

gcc-3.2.2-5.i386.rpm

the above package required something more so i downloaded the following:

glibc-devel-2.2.93-5.i386.rpm
cpp-3.2.2-5.i386.rpm

now how do i proceed from here

sagitalk 08-03-2008 01:28 AM

this is the error when i tried installing gcc-4.1.2-42.el5.i386.rpm


Missing Dependency: libgcc >= 4.1.2-42.el5 is needed by package gcc
Missing Dependency: cpp = 4.1.2-42.el5 is needed by package gcc
Missing Dependency: glibc-devel >= 2.2.90-12 is needed by package gcc
Missing Dependency: libgomp = 4.1.2-42.el5 is needed by package gcc
Missing Dependency: libgomp.so.1 is needed by package gcc

sagitalk 08-03-2008 01:43 AM

where can i download this file

glibc-devel-2.2.90-12

only this file is causing a lot of dependency problem

rahilmaknojia 08-03-2008 01:50 AM

Quote:

Originally Posted by sagitalk (Post 3234867)
where can i download this file

glibc-devel-2.2.90-12

only this file is causing a lot of dependency problem

go to this website u can download devel file from here

http://rpm.pbone.net/index.php3/stat...ch/glibc-devel

ehawk 08-03-2008 02:06 AM

Is pursuing dependencies worth the effort as opposed to getting yum working? Even if this application is installed via manual rpm'ing, wouldn't yum pay off considering all the future packages to be installed? Not meaning to deride the progress made...

lazlow 08-03-2008 02:13 AM

Ehawk is right. This is why they invented yum. I am going to guess that Centos has the more current version of glibc (which is why your system is asking for the older version of the -devel). All these dependencies are interconnected. If you change just one piece you may have to change ten more just to make sure that the mesh of the system is maintained (thus yum).

sagitalk 08-03-2008 02:13 AM

glibc-devel-2.2.90-12 is not available on

http://rpm.pbone.net/index.php3/stat...ch/glibc-devel

sagitalk 08-03-2008 02:15 AM

so where do i move from here now and what exactly is yum what do i have to install to use yum to get a C/C++ compiler

rahilmaknojia 08-03-2008 02:19 AM

Quote:

Originally Posted by sagitalk (Post 3234895)
so where do i move from here now and what exactly is yum what do i have to install to use yum to get a C/C++ compiler

You dont have any idea of yum, if you dont please read tutorial of yum then go ahead to install ur problem.

rahilmaknojia 08-03-2008 02:20 AM

Quote:

Originally Posted by sagitalk (Post 3234893)
glibc-devel-2.2.90-12 is not available on

http://rpm.pbone.net/index.php3/stat...ch/glibc-devel

Download any package like redhat9 or fedoracore7,8,9 anyone of this try it it will work

sagitalk 08-03-2008 02:27 AM

does yum require a registration to the RHN if yes then that is not possible for me......is there any other way i can install a C/C++ compiler

rahilmaknojia 08-03-2008 02:35 AM

Quote:

Originally Posted by sagitalk (Post 3234908)
does yum require a registration to the RHN if yes then that is not possible for me......is there any other way i can install a C/C++ compiler

See very easiest way for you get CentOS its like RH but only logos and themes are different and everything is same as RH and you can get updates from internet its very go to use CentOS u not get any problem, See members tried to tell u use CentOS but u havent listen to then, just tried one time u will be happy to Use as Im happy lolz...

ehawk 08-03-2008 02:37 AM

Read post #16. Yum is a package management system. That means it determines all of the required dependencies and downloads, then installs and configures them from a collection of rpm's called a repository. All you need to do I think is change the file that tells yum where to look for the repository from the RHEL servers to the Centos servers, because they are the exact same rpms. There is a link in that post that refers to a thread that tells you what to change in the file. You can also post to the Centos help forum for more help in this.

Linux used to be hard because of all this "dependency hell". Package management systems were created to remove this burden. Red Hat/Fedora/Centos uses yum as the package manager. Debian based systems typically uses apt-get and the associated gui interface synaptic.

Centos help forum

http://centos.org/modules/newbb/index.php?cat=8

Keep up your efforts...you are learning...keep asking questions and posting results as you progress

RHEL charges you a subscription fee to use their repository on their servers. Centos copies all of this and makes it free on their servers. Just change the file that tells yum where to look for all those rpms, and it will handle the rest.

Yum is already installed on your linux installation.

sagitalk 08-03-2008 02:38 AM

is there any one package that i can download and get a C/C++ compiler instead of struggling with individual packages and without using yum.......i am a newbie and want to start off with writing C/C++ programs....i do not have a registration to the RHN....i am using Red Hat Enterprise Linux 5

rahilmaknojia 08-03-2008 02:45 AM

Quote:

Originally Posted by sagitalk (Post 3234920)
is there any one package that i can download and get a C/C++ compiler instead of struggling with individual packages and without using yum.......i am a newbie and want to start off with writing C/C++ programs....i do not have a registration to the RHN....i am using Red Hat Enterprise Linux 5

PLease read Ehawk post he has given u very good explanation

sagitalk 08-03-2008 02:51 AM

this is the content of the file /etc/yum.repos.d/rhel-debuginfo.repo

[rhel-debuginfo]
name=Red Hat Enterprise Linux $releasever - $basearch - Debug
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/$basearch/Debuginfo/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[CentOS5 base]
name=CentOS-5-Base
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=0
enabled=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5


when i typed

yum list gcc-4.1.2-42.el5.i386.rpm

this is what i got


Loading "installonlyn" plugin
Loading "rhnplugin" plugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up repositories
CentOS5 base 100% |=========================| 1.1 kB 00:00
Reading repository metadata in from local files
primary.xml.gz 100% |=========================| 853 kB 00:05
################################################## 2458/2458


then i typed yum install gcc-4.1.2-42.el5.i386.rpm

this is wht i got

Loading "installonlyn" plugin
Loading "rhnplugin" plugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Parsing package install arguments
No Match for argument: gcc-4.1.2-42.el5.i386.rpm
Nothing to do



what do i do now

sagitalk 08-03-2008 02:54 AM

by seeing the contents of my /etc/yum.repos.d/rhel-debuginfo.repo file will i be now always directed to the centos server for yum commands ??

ehawk 08-03-2008 03:01 AM

I understand what you are saying and what you are asking. Once you have the compiler installed, the answer will be yes, you can just download a source code file of the form package.tar.gz, then unzip it, un-tar it, and them issue the commands

./configure
make
make install

That tells the compiler to compile the source code into machine language that the computer can execute directly.

Unfortunately, you don't yet have a compiler installed. That is what you are trying to do, so you can't compile your compiler from source code....exasperating, huh?

The next step up in simplicity is to download a package of the form package.rpm and use the rpm command to install it. rpm's are already compiled. Unfortunately, they don't contain all of the source code necessary to get the application running. People use rpms to break all the code of the computer into pieces for easier handling and to avoid duplication of code/effort. The rpm lists the other pieces of code they need to talk to in order to get the application working. These pieces are other rpm files called dependencies, as the one rpm depends on the other. The rpm command tells you what other rpms it needs, and you have to find them download them, and install them in the order necessary so that all dependencies are met sequentially.

Package management systems, like yum, were made to ease this burden. The entire collection of all rpms, the whole "web" of them that has to hang together, is stored in one place called a repository, hosted on some web server. yum has access to all of the rpms, and all the rpms describe their dependencies, so yum can figure out which rpms it needs to install the application you want, and the order they have to be installed in, and then does all this for you. Without package management, life is tough and you become a book-keeping accountant and scrounger looking for rpms, as you have noticed.

There is a file associated with yum that tells it where to find this repository on the internet. The link in post 16 shows what the entries should look like if you want to use the free centos repository, which is a blatant copy of the red hat network one that Red Hat won't let you use without paying them a subscription fee.

I hope this is beginning to make sense. keep posting here or on the centos forums.

As one person has said...you wouldn't have to even change the yum repository file if you are not too far into RHEL yet and would just instead install Centos 5 at the outset. It is a 100% copy of RHEL 5 without the red hat name (trademarked) and the red fedora man logo.

It is up to you...change the yum repository file as in post 16 link, or just download, burn and install centos 5 and be done with it.

you can even use a net-installer within windows to download centos, as well as many other linux distributions:

http://en.wikipedia.org/wiki/Unetbootin

you just download it if you are dual booting windows, open it like any other wizard installation app, and let it do the rest of the linux dual booting installation.

Otherwise download and burn a cd of centos5 and install it...it is actually up to 5.1 now.

keep posting...we want to help you.

ehawk 08-03-2008 03:05 AM

you are doing great and almost there...it may be that the particular version of the c/c++ compiler you are trying to install is not actually the one in either the RHEL 5 or Centos5 repositories.

I hope someone else will pipe in and tell him how to search the repository using yum to find a suitable c/c++ package that is actually in the repository. I am used to Debian and apt-get.

try reading the man page for yum by typing

"man yum"

at the command line and then read the instructions for how to carry out a search of the repository for a particular application. Also try a google search for something like

yum search package

It should be a simple command like

yum locate gcc

or

yum find gcc

or

yum package gcc

and then it should tell you the name of the actually package. Then you can just type

yum install whatever_package_is_called

yes, once you changed and saved that repo file, it should now always look to the centos servers for rpms. You are doing great.

ehawk 08-03-2008 03:14 AM

ok I think I found how you can install all the developer packages at one time (including of course the compiler)

issue the command

# yum groupinstall 'Development Tools' (without the #, that is just an example of a prompt)

at the terminal prompt. It may take awhile...because it is a lot of packages...but very helpful for development...including support for the following

make
=> pkgconfig
=> gettext
=> automake
=> strace64
=> gdb
=> bison
=> libtool
=> autoconf
=> gcc-c++
=> binutils and all dependencies.

rahilmaknojia 08-03-2008 03:24 AM

Quote:

Originally Posted by ehawk (Post 3234943)
ok I think I found how you can install all the developer packages at one time (including of course the compiler)

issue the command

# yum groupinstall 'Development Tools'

at the terminal prompt. It may take awhile...because it is a lot of packages...but very helpful for development...including support for the following

make
=> pkgconfig
=> gettext
=> automake
=> strace64
=> gdb
=> bison
=> libtool
=> autoconf
=> gcc-c++
=> binutils and all dependencies.


gr8 Ehawk, U explain him very well, I think u should be teacher..wht u say

ehawk 08-03-2008 03:33 AM

Yeah, I just feel bad when people are confused and despairing...intense sense of empathy...I want him to be successful and happy! I actually am a physics teacher....the desire to help is the same.

rahilmaknojia 08-03-2008 03:37 AM

Quote:

Originally Posted by ehawk (Post 3234955)
Yeah, I just feel bad when people are confused and despairing...intense sense of empathy...I want him to be successful and happy! I actually am a physics teacher....the desire to help is the same.

Kool ur teacher now next time I have to say "sir" to you, Anyway you did good, you I was also having same problem like him, I wasnt able to install any packages, bcoz RHN block my yum service then I decided to use CentOS bcoz its with free updates and i like it..

ehawk 08-03-2008 03:46 AM

No, no one has to call me sir! =)

My name is Eric, and that is fine...

rahilmaknojia 08-03-2008 03:53 AM

Quote:

Originally Posted by ehawk (Post 3234962)
No, no one has to call me sir! =)

My name is Eric, and that is fine...

I was just kiddin, I got some problem with yum server, I have created repo file in /etc/yum.repos.d/server.repo, and I have done createrepo /var/ftp/pub/CentOS/ and restarted vsftpd service

configuration file of repo is below

[server installer]
name=CentOS Linux
baseurl=ftp://172.16.19.66/pub/CentOS/
enabled=1
gpgcheck=0


when I run yum install packagename I get this error below

[root@rahil /]# yum install bind
ftp://172.16.19.66/pub/CentOS/repodata/repomd.xml: [Errno 4] IOError: [Errno ftp error] 550 Failed to change directory.
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: server installer. Please verify its path and try again


Let me know any solution with this.

rahilmaknojia 08-03-2008 04:03 AM

I found the solution of this error, but i have to disable SElinux to run yum install package name, is there any other way to run yum command wen SElinux is ON


All times are GMT -5. The time now is 07:51 PM.