LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (http://www.linuxquestions.org/questions/red-hat-31/)
-   -   installing g++ in RHEL 5.4 (http://www.linuxquestions.org/questions/red-hat-31/installing-g-in-rhel-5-4-a-844709/)

someshpr 11-16-2010 05:36 PM

installing g++ in RHEL 5.4
 
I needed to install in g++. So I tried with yum and failed.
Code:

[root@mesozoic ~]# yum install gcc g++ gcc-c++
Loaded plugins: rhnplugin, security
Setting up Install Process
Package gcc-4.1.2-46.el5_4.2.x86_64 already installed and latest version
No package g++ available.
No package gcc-c++ available.
Nothing to do

I am pretty sure I had the subscriptions. Here is the result of repolist:
Code:

[root@mesozoic ~]# yum repolist
Loaded plugins: rhnplugin, security
repo id                          repo name                                                              status
rhel-x86_64-client-5            Red Hat Enterprise Linux Desktop (v. 5 for 64-bit x86_64)              enabled: 6,299
repolist: 6,299

I tried search and found no g++ in repositories, whereas search for c++ in repositories only gives some packages:
Code:

[root@mesozoic ~]# yum search g++
Loaded plugins: rhnplugin, security
Warning: No matches found for: g++
No Matches found
[root@mesozoic ~]# yum search c++
Loaded plugins: rhnplugin, security
================================================ Matched: c++ =================================================
qt.i386 : The shared library for the Qt GUI toolkit.
qt.x86_64 : The shared library for the Qt GUI toolkit.
qt-config.x86_64 : Grapical configuration tool for programs using Qt
tog-pegasus-devel.i386 : The OpenPegasus Software Development Kit
tog-pegasus-devel.x86_64 : The OpenPegasus Software Development Kit
ImageMagick-c++.i386 : ImageMagick Magick++ library (C++ bindings)
ImageMagick-c++.x86_64 : ImageMagick Magick++ library (C++ bindings)
agg.i386 : Anti-Grain Geometry
agg.x86_64 : Anti-Grain Geometry
antlr.x86_64 : ANother Tool for Language Recognition
boost.i386 : The Boost C++ Libraries
boost.x86_64 : The Boost C++ Libraries
boost-doc.x86_64 : The Boost C++ html docs
compat-gcc-34-c++.x86_64 : C++ support for compatibility compiler
compat-libstdc++-296.i386 : Compatibility 2.96-RH standard C++ libraries
compat-libstdc++-33.i386 : Compatibility standard C++ libraries
compat-libstdc++-33.x86_64 : Compatibility standard C++ libraries
db4.i386 : The Berkeley DB database library (version 4) for C.
db4.x86_64 : The Berkeley DB database library (version 4) for C.
db4-utils.x86_64 : Command line tools for managing Berkeley DB (version 4) databases.
festival.i386 : A free speech synthesizer
festival.x86_64 : A free speech synthesizer
frysk.x86_64 : Frysk execution analysis tool
frysk-gnome.x86_64 : The GUI frontend of Frysk.
gcc.x86_64 : Various compilers (C, C++, Objective-C, Java, ...)
gdb.x86_64 : A GNU source-level debugger for C, C++, Java and other languages.
gperf.x86_64 : A perfect hash function generator.
kdebindings.x86_64 : KDE bindings to non-C++ languages
libstdc++.i386 : GNU Standard C++ Library
libstdc++.x86_64 : GNU Standard C++ Library
libwvstreams.i386 : WvStreams is a network programming library written in C++.
libwvstreams.x86_64 : WvStreams is a network programming library written in C++.
python.x86_64 : An interpreted, interactive, object-oriented programming language.
qt4.i386 : The shared library for the Qt GUI toolkit
qt4.x86_64 : The shared library for the Qt GUI toolkit
sip.x86_64 : SIP - Python/C++ Bindings Generator
swig.x86_64 : Connects C/C++/Objective C to some high-level programming languages.

How to install g++ then?

TIA,

kbp 11-16-2010 06:25 PM

I don't have one to test but maybe you're missing the 'workstation' sub-channel of RHEL Desktop ...

hth

someshpr 11-16-2010 07:19 PM

Thanks a lot, kbp!
Yes, changing the subscription channel worked.
But now when I tried yum, it gave me dependency errors:
Code:

[root@mesozoic ~]# yum install gcc-c++
Loaded plugins: rhnplugin, security
Setting up Install Process
Resolving Dependencies
--> Running transaction check
--> Processing Dependency: gcc-c++ = 4.1.2-46.el5_4.2 for package: gcc-objc++
---> Package gcc-c++.x86_64 0:4.1.2-48.el5 set to be updated
--> Processing Dependency: libstdc++-devel = 4.1.2-48.el5 for package: gcc-c++
--> Processing Dependency: libstdc++ = 4.1.2-48.el5 for package: gcc-c++
--> Processing Dependency: gcc = 4.1.2-48.el5 for package: gcc-c++
--> Running transaction check
---> Package gcc-c++.x86_64 0:4.1.2-48.el5 set to be updated
--> Processing Dependency: libstdc++ = 4.1.2-48.el5 for package: gcc-c++
--> Processing Dependency: gcc = 4.1.2-48.el5 for package: gcc-c++
---> Package gcc-objc++.x86_64 0:4.1.2-48.el5 set to be updated
--> Processing Dependency: gcc-objc = 4.1.2-48.el5 for package: gcc-objc++
---> Package libstdc++-devel.x86_64 0:4.1.2-48.el5 set to be updated
--> Processing Dependency: libstdc++ = 4.1.2-48.el5 for package: libstdc++-devel
--> Running transaction check
---> Package gcc-c++.x86_64 0:4.1.2-48.el5 set to be updated
--> Processing Dependency: libstdc++ = 4.1.2-48.el5 for package: gcc-c++
--> Processing Dependency: gcc = 4.1.2-48.el5 for package: gcc-c++
---> Package gcc-objc.x86_64 0:4.1.2-48.el5 set to be updated
--> Processing Dependency: libobjc = 4.1.2-48.el5 for package: gcc-objc
--> Processing Dependency: gcc = 4.1.2-48.el5 for package: gcc-objc
---> Package libstdc++-devel.x86_64 0:4.1.2-48.el5 set to be updated
--> Processing Dependency: libstdc++ = 4.1.2-48.el5 for package: libstdc++-devel
--> Finished Dependency Resolution
libstdc++-devel-4.1.2-48.el5.x86_64 from rhel-x86_64-client-workstation-5 has depsolving problems
  --> Missing Dependency: libstdc++ = 4.1.2-48.el5 is needed by package libstdc++-devel-4.1.2-48.el5.x86_64 (rhel-x86_64-client-workstation-5)
gcc-c++-4.1.2-48.el5.x86_64 from rhel-x86_64-client-workstation-5 has depsolving problems
  --> Missing Dependency: libstdc++ = 4.1.2-48.el5 is needed by package gcc-c++-4.1.2-48.el5.x86_64 (rhel-x86_64-client-workstation-5)
gcc-c++-4.1.2-48.el5.x86_64 from rhel-x86_64-client-workstation-5 has depsolving problems
  --> Missing Dependency: gcc = 4.1.2-48.el5 is needed by package gcc-c++-4.1.2-48.el5.x86_64 (rhel-x86_64-client-workstation-5)
gcc-objc-4.1.2-48.el5.x86_64 from rhel-x86_64-client-workstation-5 has depsolving problems
  --> Missing Dependency: gcc = 4.1.2-48.el5 is needed by package gcc-objc-4.1.2-48.el5.x86_64 (rhel-x86_64-client-workstation-5)
gcc-objc-4.1.2-48.el5.x86_64 from rhel-x86_64-client-workstation-5 has depsolving problems
  --> Missing Dependency: libobjc = 4.1.2-48.el5 is needed by package gcc-objc-4.1.2-48.el5.x86_64 (rhel-x86_64-client-workstation-5)
Error: Missing Dependency: libstdc++ = 4.1.2-48.el5 is needed by package gcc-c++-4.1.2-48.el5.x86_64 (rhel-x86_64-client-workstation-5)
Error: Missing Dependency: libobjc = 4.1.2-48.el5 is needed by package gcc-objc-4.1.2-48.el5.x86_64 (rhel-x86_64-client-workstation-5)
Error: Missing Dependency: gcc = 4.1.2-48.el5 is needed by package gcc-objc-4.1.2-48.el5.x86_64 (rhel-x86_64-client-workstation-5)
Error: Missing Dependency: libstdc++ = 4.1.2-48.el5 is needed by package libstdc++-devel-4.1.2-48.el5.x86_64 (rhel-x86_64-client-workstation-5)
Error: Missing Dependency: gcc = 4.1.2-48.el5 is needed by package gcc-c++-4.1.2-48.el5.x86_64 (rhel-x86_64-client-workstation-5)
 You could try using --skip-broken to work around the problem
 You could try running: package-cleanup --problems
                        package-cleanup --dupes
                        rpm -Va --nofiles --nodigest

I tried all the suggestions given at the end, but no avail! I also tried reinstalling gcc, libstdc++, gcc-objc.

How do I sort this version issue?
Any idea, please?

TIA

kbp 11-16-2010 07:36 PM

I'm not sure .. maybe try removing gcc-objc then installing gcc-g++ ..

Just a thought, how did you change the subscription channel ? ...

kbp 11-16-2010 07:45 PM

Sorry, just noticed the version difference that you mentioned, can you uninstall gcc and friends then just install gcc-c++, this should pull in the correct version of the dependencies

John VV 11-16-2010 08:16 PM

there is the "groupinstall" - " Development Tools" that should have been used to install gcc and all the tools needed
then the "groupinstall" - " Development Librarys" for the devel rpms

for a list run
Code:

su -
yum grouplist

-- then install them ---
yum groupinstall  "Development Tools" "Development Librarys"

you MIGHT want to read the "man" page for yum and the yum help page
Code:

yum --help
-- and --
man yum


someshpr 11-16-2010 09:21 PM

1 Attachment(s)
Quote:

Originally Posted by kbp (Post 4161291)
I'm not sure .. maybe try removing gcc-objc then installing gcc-g++ ..

Just a thought, how did you change the subscription channel ? ...

Quote:

Originally Posted by kbp (Post 4161297)
Sorry, just noticed the version difference that you mentioned, can you uninstall gcc and friends then just install gcc-c++, this should pull in the correct version of the dependencies

Thanks kbp! I tried removing gcc-objc, gcc, and reinstalled gcc, libstdc++. Same error.

On changing subscription channel: I logged in to my rhn.redhat.com account and chose my system. In the system page, there was a link for alter channel subscriptions which gives available channels.


Quote:

Originally Posted by John VV (Post 4161317)
there is the "groupinstall" - " Development Tools" that should have been used to install gcc and all the tools needed
then the "groupinstall" - " Development Librarys" for the devel rpms

for a list run
Code:

su -
yum grouplist

-- then install them ---
yum groupinstall  "Development Tools" "Development Librarys"

you MIGHT want to read the "man" page for yum and the yum help page
Code:

yum --help
-- and --
man yum


Thanks John! I did try groupinstall earlier, with both "Development Tools" and "Development Libraries". It returns lots of missing dependencies. When run with --skip-broken, it tries to install few packages, skipping a lot more! gcc-c++, gcc-gfortran all are in the to be skipped list. Attached is the list.

someshpr 11-16-2010 10:28 PM

From the error message I posted on third post of this thread, as far as I understand, instead of 4.1.2-46 version it is going to update 4.1.2-48 version of gcc-c++.
What is confusing me is that the dependency error starts with
Code:

Package gcc-c++.x86_64 0:4.1.2-48.el5 set to be updated
And this 4.1.2-48 version is causing problem.

John VV 11-16-2010 10:51 PM

well seeing as you are using RHEL 5.4
Then you ARE paying for tech support and access to the RHN
call red hat -- that is one of the reasons you ARE paying for the license , right .

Quote:

It returns lots of missing dependencies.
??? odd that should NOT happen with RHN ,those groups ARE IN THERE

please post the output of
Code:

yum repolist all

someshpr 11-17-2010 09:03 AM

Quote:

Originally Posted by John VV (Post 4161406)
well seeing as you are using RHEL 5.4
Then you ARE paying for tech support and access to the RHN
call red hat -- that is one of the reasons you ARE paying for the license , right .


??? odd that should NOT happen with RHN ,those groups ARE IN THERE

please post the output of
Code:

yum repolist all

My free (one year) subscription came with the machine. So I should utilize that before it expires, and call them!

On the issue: I finally got g++ installed by using gcc-c++4.1.2-46 rpm from rpm.pbone.net. And it is working.

But still the same dependency issue is still there, and if I want to do <yum update> it exists giving same error (missing dependency for gcc-c++4.1.2-48). Here is the output of <yum repolist all>
Code:

[root@mesozoic ~]# yum repolist all
Loaded plugins: rhnplugin, security
repo id                                                repo name                                                                        status
rhel-debuginfo                                        Red Hat Enterprise Linux 5Client - x86_64 - Debug                                disabled
rhel-x86_64-client-5                                  Red Hat Enterprise Linux Desktop (v. 5 for 64-bit x86_64)                        enabled: 6,299
rhel-x86_64-client-workstation-5                      RHEL Desktop Workstation (v. 5 for 64-bit x86_64)                                enabled: 4,243
repolist: 10,542

I'll update on what Redhat has to say about it after I get an answer from them.

goodGOD 10-25-2011 06:18 AM

@John VV

thanks so much for this. Do have a great day!!



Please where is the best resource for learning c++ on fedora 15. thanks


All times are GMT -5. The time now is 11:37 AM.