安裝yum源和gcc編譯器遇到的問題

來源:互聯網
上載者:User

標籤:

這兩天我試著在VMware虛擬機器裡安裝gcc,遇到了不少問題

1、   安裝yum源

我搭建的是光碟片yum源(有兩種方法搭建yum源,另外一種是網路yum源,但至今沒弄懂我的網路yum源為什麼不成功)

1)   掛載光碟片

[[email protected]~]#mount/dee/cdrom /mnt/cdrom/

2)   讓網路yum源失效

     [[email protected]~]#cd /etc/yum.repos.d/

     [[email protected]  yum.repos.d]#mv CentOS-Base.repo  CentOS-Base.repo.bak

     [[email protected]  yum.repos.d]#mv CentOS-Debuginfo.repo  CentOS- Debuginfo.repo.bak

     [[email protected]  yum.repos.d]#mv CentOS-Vault.repo  CentOS- Vault.repo.bak

3)  修改光碟片yum源檔案

     [[email protected]  yum.repos.d]#vim CentOS-Media.repo

     [c6-media]

name= CentOS-$releasever-Media

baseurl=file:///mnt/cdrom

#地址為你自己的光碟片掛載地址

 

gpgcheck=1

enabled=1

gpgkey=file:///etc/pki/rpm-gpg/RPG-GPG-KEY- CentOS-6

 

 

2、   yum源搭建成功之後就可以安裝gcc了

[[email protected]~]#yum –y install gcc

 

按理說執行這一條命令之後就可以自動安裝gcc了,可是我卻遇到了這個問題

 

warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL


GPG key retrieval failed: [Errno 14] Could not open/readfile:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
======================================================================

摸索了好長時間,終於在網上找到瞭解決方案:

[[email protected]~]#rpm --import /etc/pki/rpm-gpg/RPM*

[[email protected]~]#rpm--import /etc/pki/rpm-gpg/RPM*

 

十分感謝互連網~~

 

安裝yum源和gcc編譯器遇到的問題

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.