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 |
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. |
thank u i will begin right way but will get back in case of a problem
|
You can get gcc++ from ur cds or DVD, if u have created yum server then u can type command "yum install gcc*"
|
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 |
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
|
what exactly is yum and how will it help me install a C/C++ compiler
|
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. |
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.
|
Quote:
|
Quote:
dito (he doesn't have a compiler [needed for the *.tar.bz2] to begin with) |
Couldn't he just download the gcc rpm package from the CentOS site and install it?
|
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
|
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.
|
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.
|
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. |
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 |
Quote:
|
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. |
i have the RedHat Enterprise Linx 5 so which package do i reqire for that the .i386??
|
Yes, but there is a .ppc rhel5, .i386 rhel5, and a .i686 rhel5.
Post the results of "uname -a". That should tell us. |
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 |
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:
|
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 |
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 |
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 |
where can i download this file
glibc-devel-2.2.90-12 only this file is causing a lot of dependency problem |
Quote:
http://rpm.pbone.net/index.php3/stat...ch/glibc-devel |
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...
|
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).
|
|
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
|
Quote:
|
Quote:
|
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
|
Quote:
|
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. |
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
|
Quote:
|
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 |
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 ??
|
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. |
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. |
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. |
Quote:
gr8 Ehawk, U explain him very well, I think u should be teacher..wht u say |
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.
|
Quote:
|
No, no one has to call me sir! =)
My name is Eric, and that is fine... |
Quote:
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. |
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. |