87

Today installed CentOs 6.4 fresh new on my workstation.

I wanted to install g++. With my surprise I didn't succeed by using

 yum install gcc-g++

The thing is that even by doing a search I don't get any result.

 # No package available
 yum search g++

On top of that I installed successfully gcc.

Do you know whether I am using the wrong package name or what should I do?

4 Answers 4

172

Have you tried:
yum install gcc-c++

2
  • 3
    Wow... silly me, too. That's c++ not g++!
    – Joe Hansen
    Jun 29, 2016 at 20:20
  • This worked for me, after searched lot......Thanks again Nov 14, 2017 at 9:51
10

I was successful with on CentOS 6.4

    yum install gcc-c++.x86_64
1
  • 3
    Also worked for me on CentOS 7.
    – Steve HHH
    Nov 11, 2014 at 0:45
2

I ran into this post because installing node with regular gcc-c++ it will complain;

but to workaround the issue you can install gcc-g++ from Linuxsoft: Software Repository

curl http://linuxsoft.cern.ch/cern/scl/slc6-scl.repo > /etc/yum.repos.d/slc6-scl.repo

rpm --import http://ftp.mirrorservice.org/sites/ftp.scientificlinux.org/linux/scientific/obsolete/51/i386/RPM-GPG-KEYs/RPM-GPG-KEY-cern

yum install -y devtoolset-3

scl enable devtoolset-3 bash

and node will be happy !

0

One thing I have realized is that many packages give that error because package names are usually different than most tutorials out there on the net.

Normally when I get stuck I just use this command:

yum list | grep <packagename>

This gets a list of all packages like the one we are searching for and it always lists the full name which we should use to install the package.

Also the <packagename> is case-sensitive, geoip and GeoIP will return different list of packages.

2
  • 1
    You can make the match insensitive by using grep -i <packagename> instead. Feb 25, 2016 at 16:42
  • yum has its own search command which looks in descriptions and urls as well as package names.
    – user201267
    Jul 16, 2017 at 13:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.