CentOS 5.4 下gcc和gcc-c++的光碟片 rpm 安裝方式

來源:互聯網
上載者:User

不能上網,利用光碟片安裝 gcc 和 gcc-c++的方法如下:

首先把光碟片放入光碟機內,虛擬機器內的話就用 iso 光碟片鏡像就可以了。

然後如下:

[root@localhost ~]# more gcc_install.sh

#!/bin/bash
mount /dev/cdrom /mnt
cd /mnt/CentOS/
rpm -ivh glibc-common-2.5-42.i386.rpm
rpm -ivh kernel-headers-2.6.18-164.el5.i386.rpm
rpm -ivh libgcc-4.1.2-46.el5.i386.rpm
rpm -ivh glibc-2.5-42.i686.rpm
rpm -ivh cpp-4.1.2-46.el5.i386.rpm
rpm -ivh libgomp-4.4.0-6.el5.i386.rpm
rpm -ivh nscd-2.5-42.i386.rpm
rpm -ivh glibc-headers-2.5-42.i386.rpm
rpm -ivh glibc-devel-2.5-42.i386.rpm
rpm -ivh gcc-4.1.2-46.el5.i386.rpm
echo "gcc is installed successful!!!"
rpm -ivh libstdc++-4.1.2-46.el5.i386.rpm
rpm -ivh libstdc++-devel-4.1.2-46.el5.i386.rpm
rpm -ivh gcc-c++-4.1.2-46.el5.i386.rpm
echo "gcc-c++ is installed successful!!!"

[root@localhost ~]# chmod +x gcc_install.sh


[root@localhost ~]# ./gcc_install.sh
mount: block device /dev/cdrom is write-protected, mounting read-only
warning: glibc-common-2.5-42.i386.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing...                ########################################### [100%]
package glibc-common-2.5-42.i386 is already installed
warning: kernel-headers-2.6.18-164.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing...                ########################################### [100%]
   1:kernel-headers         ########################################### [100%]
warning: libgcc-4.1.2-46.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing...                ########################################### [100%]
package libgcc-4.1.2-46.el5.i386 is already installed
warning: glibc-2.5-42.i686.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing...                ########################################### [100%]
package glibc-2.5-42.i686 is already installed
warning: cpp-4.1.2-46.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing...                ########################################### [100%]
package cpp-4.1.2-46.el5.i386 is already installed
warning: libgomp-4.4.0-6.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing...                ########################################### [100%]
   1:libgomp                ########################################### [100%]
warning: nscd-2.5-42.i386.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing...                ########################################### [100%]
package nscd-2.5-42.i386 is already installed
warning: glibc-headers-2.5-42.i386.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing...                ########################################### [100%]
   1:glibc-headers          ########################################### [100%]
warning: glibc-devel-2.5-42.i386.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing...                ########################################### [100%]
   1:glibc-devel            ########################################### [100%]
warning: gcc-4.1.2-46.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing...                ########################################### [100%]
   1:gcc                    ########################################### [100%]
gcc is installed successful!!!
warning: libstdc++-4.1.2-46.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing...                ########################################### [100%]
package libstdc++-4.1.2-46.el5.i386 is already installed
warning: libstdc++-devel-4.1.2-46.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing...              

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.