在CentOS 6.5上安装软件包

时间:2016-04-13 20:48:08

标签: g++ centos6 yum

很抱歉发布了一般性问题。我正在尝试安装' rest-client'对于ruby on rails项目为gem install rest-client,但没有说

make: g++: Command not found 
make: *** [unf.o] Error 127
make failed, exit code 2

所以我检查了是否安装了g ++。显然安装了gcc(gcc(GCC)4.4.7 20120313)但不是g ++。我试着用yum安装它,但没有成功。以下是我使用的命令。

yum install gcc-c++
yum groupinstall "Development Tools"

稍后我添加了http://people.centos.org/tru/devtools-2/devtools-2.repo个回购并尝试运行yum install devtoolset-2-gcc,但未能说Requires: policycoreutils-python 所以我试着用yum安装它,但没有运气!然后我尝试手动安装g ++及其依赖项(下载rpm' s),但我觉得我要走下一个兔子洞。

请帮忙!!我不知道从哪里开始。

这是输出

adobe-linux-x86_64                                   Adobe Systems Incorporated                                                                             2
base                                                 CentOS-6 - Base                                                                                      352
centosplus                                           CentOS-6 - Plus                                                                                       68
contrib                                              CentOS-6 - Contrib                                                                                     0
couchbase                                            Couchbase package repository                                                                           7
epel                                                 Extra Packages for Enterprise Linux 6 - x86_64                                                    12,214
extras                                               CentOS-6 - Extras                                                                                     62
fasttrack                                            CentOS - fasttrack                                                                                    66
ius                                                  IUS Community Packages for Enterprise Linux 6 - x86_64                                               362
ius-debuginfo                                        IUS Community Packages for Enterprise Linux 6 - x86_64 - Debug                                        71
ius-dev                                              IUS Community Packages for Enterprise Linux 6 - x86_64 - Dev                                          11
ius-dev-debuginfo                                    IUS Community Packages for Enterprise Linux 6 - x86_64 - Dev Debug Info                                5
ius-dev-source                                       IUS Community Packages for Enterprise Linux 6 - x86_64 - Dev Source                                    0
ius-source                                           IUS Community Packages for Enterprise Linux 6 - x86_64 - Source                                        0
mysql-connectors-community                           MySQL Connectors Community                                                                            21
mysql-tools-community                                MySQL Tools Community                                                                                 33
mysql56-community                                    MySQL 5.6 Community Server                                                                           229
remi                                                 Les RPM de remi pour Enterprise Linux 6 - x86_64                                                   3,230
remi-safe                                            Safe Remi's RPM repository for Enterprise Linux 6 - x86_64                                           590
rpmforge                                             Red Hat Enterprise 6 - RPMforge.net - dag                                                          4,718
slc6-scl                                             Scientific Linux CERN (SLC6) - SCL addons                                                          2,472
testing-devtools-2-centos-6                          testing 2 devtools for CentOS 6                                                                      119
updates                                              CentOS-6 - Updates                                                                                 1,555
webtatic                                             Webtatic Repository EL6 - x86_64   

另一个奇怪的事情是当我yum search all policycoreutils它返回结果但是当试图安装它时说没有找到包

1 个答案:

答案 0 :(得分:0)

如果你想安装ruby(并准备在rails和其他人上使用ruby(在干净的VM最小安装上使用centos 6.x,在这种情况下使用32位),请按照以下步骤操作:

curl -O https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.1.tar.bz2
tar -xjvf ruby-2.3.1.tar.bz2
cd ruby-2.3.1
sudo yum install -y gcc gcc-c++ zlib-devel gdbm-devel readline-devel openssl-devel libffi-devel sqlite-devel
sudo yum install -y http://mirror.compevo.com/epel/6/i386/epel-release-6-8.noarch.rpm
sudo yum install -y v8
./configure --disable-install-doc --disable-install-rdoc --disable-install-capi
make
sudo make install
gem update --system --no-ri --no-rdoc
sudo /usr/local/bin/gem install rails --no-ri --no-rdoc

在这种情况下,gcc-c ++不是必需的,但其他宝石需要像rest-client