Centos安装gcc
方法1: yum install gcc
方法2:上不了网的情况下,使用本地的iso文件
a. ftp上传iso安装文件到/usr/local/src下
b. 新建 /media/CentOS, 挂载iso文件到/media/CentOS
mount -t iso9660 -o loop /usr/local/src/CentOS-7-x86_64-DVD-1511.iso /media/CentOS
c. 设置开机自动挂载系统镜像文件
vim /etc/fstab添加
/usr/local/src/CentOS-7.0-1406-x86_64-DVD.iso /media/CentOS/ iso9660 defaults,ro,loop 0 0
:x #保存并退出
mount -l
d. 备份/etc/yum.repos.d/CentOS-Base.repo文件,新建CentOS-Base.repo文件
[root@localhost yum.repos.d]# cp CentOS-Base.repo CentOS-Base.repo.bak
[root@localhost yum.repos.d]# vi CentOS-Base.repo
[centos7]
name=CentOS-$releasever - centos7
baseurl=file:///media/CentOS
gpgcheck=0
enabled=1
e. 安装gcc
[root@localhost yum.repos.d]# yum clean all
[root@localhost yum.repos.d]# yum install gcc
相关推荐
wanyi0 2020-11-03
onlykg 2020-08-01
xuguiyi00 2020-07-09
FlightForever 2020-06-28
zghover 2020-06-25
zllbirdonland 2020-06-16
choupiaoyi 2020-06-13
Wonder的学习 2020-06-11
cwgxiaoguizi 2020-06-07
secondid 2020-06-06
昭君出塞 2020-06-03
fushilin 2020-06-03
jackadmi 2020-06-03
85407718 2020-05-30
wanggongzhen 2020-05-28
sunln00 2020-05-07
wangxiaoxue 2020-05-05
ningningmingming 2020-05-01