Centos6离线安装gcc等软件编译环境 - 管理猿 2019 年 08 月 15 日 |访问: 118 次

Centos离线安装deltarpm gcc gcc-c++ make cmake autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel libaio readline-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5-devel libidn libidn-devel openssl openssl-devel libxslt-devel libicu-devel libevent-devel libtool libtool-ltdl bison gd-devel vim-enhanced pcre-devel zip unzip ntpdate sysstat patch bc expect rsync git lsof lrzsz
适用环境:centos服务器没有网络,又需要编译环境去安装应用软件
准备工具:光盘或U盘一个
离线资源1:http://mirrors.163.com/centos/6.10/isos/x86_64/
离线资源2:http://mirrors.aliyun.com/centos/6.10/os/x86_64/Packages/
处理方案:将资源下载后放置到U盘或光盘,临时修改yum的默认指向。从本地读取安装。
一.临时修改yum的默认指向

mkdir -p /root/yumback
mv /etc/yum.repos.d/* /root/yumback
cp /root/yumback/Centos-Media.repo /etc/yum.repos.d/
vi /etc/yum.repos.d/Centos-Media.repo

QQ截图20190815104736.png
修改默认指向,用#注释掉检测。check为0不检测,enable为1启用
QQ截图20190815105134.png
三.插入优盘或光盘
优盘格式化为fat32,NTFS要装软件才能挂

fdisk -l

使用上面命令查看已经连接的介质,光盘和软盘默认的是/dev/cdrom或/dev/cdrom1
创建挂载点并挂载文件

mkdir -p /root/package
mount -t auto /dev/cdrom /root/package/

QQ截图20190815105557.png
应用源

yum clean all

QQ截图20190815105729.png

四.安装软件

yum -y install deltarpm gcc gcc-c++ make cmake autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel libaio readline-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5-devel libidn libidn-devel openssl openssl-devel libxslt-devel libicu-devel libevent-devel libtool libtool-ltdl bison gd-devel vim-enhanced pcre-devel zip unzip ntpdate sysstat patch bc expect rsync git lsof lrzsz

测试只安装了vim工具
QQ截图20190815110046.png
五.恢复yum源指向

rm -rf /etc/yum.repos.d/*
cp -r /root/yumback/* /etc/yum.repos.d/
yum clean all

配置一个Ip试下恢复(没配DNS)
QQ截图20190815110527.png

标签:none

添加新评论