CentOS6 安装gcc编译器,解决【configure: error: no acceptable C compiler found in $PATH】问题
生活随笔
收集整理的這篇文章主要介紹了
CentOS6 安装gcc编译器,解决【configure: error: no acceptable C compiler found in $PATH】问题
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
前言:
????????編譯文件 ntfs-3g_ntfsprogs-2021.8.22 時報缺少C編譯器錯誤,所以需要安裝gcc編譯器。綠色字體標注即是錯誤提示。
[root@localhost ntfs-3g_ntfsprogs-2021.8.22]# ./configure checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu checking target system type... x86_64-pc-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking whether to enable maintainer-specific portions of Makefiles... no checking whether make supports the include directive... yes (GNU style) checking for gcc... no checking for cc... no checking for cl.exe... no configure: error: in `/usr/local/src/ntfs-3g_ntfsprogs-2021.8.22': configure: error: no acceptable C compiler found in $PATH See `config.log' for more details安裝方式:
????????1、yum在線安裝,需要配置CentOS-Base.repo(本次未采用此方法)
? ? ? ? 2、配置本地yum源,進行安裝(采用)
?配置本地yum源直通車:
CentOS6 搭建本地光盤yum源_走向運維的老男孩的博客-CSDN博客
安裝步驟:
第一步、查看本地gcc安裝包
[root@localhost yum.repos.d]# yum list | grep gcc libgcc.x86_64 4.4.7-17.el6 @anaconda-CentOS-201605220104.x86_64/6.8 compat-gcc-34.x86_64 3.4.6-19.el6 c6-media compat-gcc-34-c++.x86_64 3.4.6-19.el6 c6-media compat-gcc-34-g77.x86_64 3.4.6-19.el6 c6-media gcc.x86_64 4.4.7-17.el6 c6-media gcc-c++.x86_64 4.4.7-17.el6 c6-media gcc-gfortran.x86_64 4.4.7-17.el6 c6-media gcc-gnat.x86_64 4.4.7-17.el6 c6-media gcc-java.x86_64 4.4.7-17.el6 c6-media gcc-objc.x86_64 4.4.7-17.el6 c6-media gcc-objc++.x86_64 4.4.7-17.el6 c6-media libgcc.i686 4.4.7-17.el6 c6-media? ? ? ? 說明:我們這里需要安裝兩個安裝包:gcc.x86_64和gcc-c++.x86_64,從上面的代碼塊中可以看出安裝包來源【c6-media】,而這正是我們配置本地光盤yum源的名字,反向證明我們的yum源已經正是啟用。
第二步,安裝gcc.x86_64
[root@localhost yum.repos.d]# yum -y install gcc 已加載插件:fastestmirror, security 設置安裝進程 Loading mirror speeds from cached hostfile 解決依賴關系 --> 執行事務檢查 ---> Package gcc.x86_64 0:4.4.7-17.el6 will be 安裝 --> 處理依賴關系 cpp = 4.4.7-17.el6,它被軟件包 gcc-4.4.7-17.el6.x86_64 需要 --> 處理依賴關系 cloog-ppl >= 0.15,它被軟件包 gcc-4.4.7-17.el6.x86_64 需要 --> 執行事務檢查 ---> Package cloog-ppl.x86_64 0:0.15.7-1.2.el6 will be 安裝 --> 處理依賴關系 libppl_c.so.2()(64bit),它被軟件包 cloog-ppl-0.15.7-1.2.el6.x86_64 需要 --> 處理依賴關系 libppl.so.7()(64bit),它被軟件包 cloog-ppl-0.15.7-1.2.el6.x86_64 需要 ---> Package cpp.x86_64 0:4.4.7-17.el6 will be 安裝 --> 處理依賴關系 libmpfr.so.1()(64bit),它被軟件包 cpp-4.4.7-17.el6.x86_64 需要 --> 執行事務檢查 ---> Package mpfr.x86_64 0:2.4.1-6.el6 will be 安裝 ---> Package ppl.x86_64 0:0.10.2-11.el6 will be 安裝 --> 完成依賴關系計算依賴關系解決=====================================================================================================================================軟件包 架構 版本 倉庫 大小 ===================================================================================================================================== 正在安裝:gcc x86_64 4.4.7-17.el6 c6-media 10 M 為依賴而安裝:cloog-ppl x86_64 0.15.7-1.2.el6 c6-media 93 kcpp x86_64 4.4.7-17.el6 c6-media 3.7 Mmpfr x86_64 2.4.1-6.el6 c6-media 157 kppl x86_64 0.10.2-11.el6 c6-media 1.3 M事務概要 ===================================================================================================================================== Install 5 Package(s)總下載量:15 M Installed size: 33 M 下載軟件包: ------------------------------------------------------------------------------------------------------------------------------------- 總計 16 MB/s | 15 MB 00:00 warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 Importing GPG key 0xC105B9DE:Userid : CentOS-6 Key (CentOS 6 Official Signing Key) <centos-6-key@centos.org>Package: centos-release-6-8.el6.centos.12.3.x86_64 (@anaconda-CentOS-201605220104.x86_64/6.8)From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 運行 rpm_check_debug 執行事務測試 事務測試成功 執行事務正在安裝 : mpfr-2.4.1-6.el6.x86_64 1/5 正在安裝 : cpp-4.4.7-17.el6.x86_64 2/5 正在安裝 : ppl-0.10.2-11.el6.x86_64 3/5 正在安裝 : cloog-ppl-0.15.7-1.2.el6.x86_64 4/5 正在安裝 : gcc-4.4.7-17.el6.x86_64 5/5 Verifying : ppl-0.10.2-11.el6.x86_64 1/5 Verifying : gcc-4.4.7-17.el6.x86_64 2/5 Verifying : cpp-4.4.7-17.el6.x86_64 3/5 Verifying : cloog-ppl-0.15.7-1.2.el6.x86_64 4/5 Verifying : mpfr-2.4.1-6.el6.x86_64 5/5 已安裝:gcc.x86_64 0:4.4.7-17.el6 作為依賴被安裝:cloog-ppl.x86_64 0:0.15.7-1.2.el6 cpp.x86_64 0:4.4.7-17.el6 mpfr.x86_64 0:2.4.1-6.el6 ppl.x86_64 0:0.10.2-11.el6 完畢!第三步、安裝gcc-c++.x86_64?
[root@localhost yum.repos.d]# yum -y install gcc-c++ 已加載插件:fastestmirror, security 設置安裝進程 Loading mirror speeds from cached hostfile 解決依賴關系 --> 執行事務檢查 ---> Package gcc-c++.x86_64 0:4.4.7-17.el6 will be 安裝 --> 處理依賴關系 libstdc++-devel = 4.4.7-17.el6,它被軟件包 gcc-c++-4.4.7-17.el6.x86_64 需要 --> 執行事務檢查 ---> Package libstdc++-devel.x86_64 0:4.4.7-17.el6 will be 安裝 --> 完成依賴關系計算依賴關系解決=====================================================================================================================================軟件包 架構 版本 倉庫 大小 ===================================================================================================================================== 正在安裝:gcc-c++ x86_64 4.4.7-17.el6 c6-media 4.7 M 為依賴而安裝:libstdc++-devel x86_64 4.4.7-17.el6 c6-media 1.6 M事務概要 ===================================================================================================================================== Install 2 Package(s)總下載量:6.3 M Installed size: 20 M 下載軟件包: ------------------------------------------------------------------------------------------------------------------------------------- 總計 31 MB/s | 6.3 MB 00:00 運行 rpm_check_debug 執行事務測試 事務測試成功 執行事務正在安裝 : libstdc++-devel-4.4.7-17.el6.x86_64 1/2 正在安裝 : gcc-c++-4.4.7-17.el6.x86_64 2/2 Verifying : gcc-c++-4.4.7-17.el6.x86_64 1/2 Verifying : libstdc++-devel-4.4.7-17.el6.x86_64 2/2 已安裝:gcc-c++.x86_64 0:4.4.7-17.el6 作為依賴被安裝:libstdc++-devel.x86_64 0:4.4.7-17.el6 完畢!第四步、驗證
[root@localhost yum.repos.d]# gcc --version gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-17) Copyright ? 2010 Free Software Foundation, Inc.????????驗證成功!
小結:
? ? ? ? 配置yum源存在gcc.x86_64和gcc-c++.x86_64兩個安裝包以及安裝必須的依賴,那么安裝必然流暢!
總結
以上是生活随笔為你收集整理的CentOS6 安装gcc编译器,解决【configure: error: no acceptable C compiler found in $PATH】问题的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: linux stopped 进程,lin
- 下一篇: 笔试 | 大疆2021秋招笔试题及题解