[root@localhost ~]#
挂载系统ISO镜像,配置yum源
由于内网无法访问网络,所以需先挂载centos7的ISO镜像,然后配置yum源安装mysql5.6编译所需要的依赖包
创建ISO镜像存放目录并上传ISO镜像文件
1. 上传镜像到/opt
2. mount -o loop /opt/CentOS-7-x86_64-DVD-1804.iso /mnt 挂载镜像到/mnt
3. df -h #查看磁盘
#显示这一行说明已经镜像已经挂载成功
配置yum源:
4. mkdir /etc/yum.repos.d/yumbak 备份yum源
mv *.repo yumbak/ #备份原有配置文件
5. vim /etc/yum.repos.d/local.repo #新建yum源,了解到系统会先使用CentOS-Base.repo
[local]
name=local
baseurl=file:///mnt
gpgcheck=0
enabled=1
[local]
name=local
baseurl=file:///mnt #此处写镜像挂载目录
gpgcheck=0
enabled=1
6.yum clean all 清空yum缓存
Loaded plugins: fastestmirror
Cleaning repos: centos7-iso
Cleaning up everything
Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos
Cleaning up list of fastest mirrors
7.yum makecache
尝试yum安装gcc是否可以安装
8. yum -y install gcc
[root@cbp3 ~]# ll /mnt/
total 678
-rw-rw-r--. 1 root root 14 May 2 2018 CentOS_BuildTag
drwxr-xr-x. 3 root root 2048 May 4 2018 EFI
-rw-rw-r--. 1 root root 227 Aug 30 2017 EULA
-rw-rw-r--. 1 root root 18009 Dec 10 2015 GPL
drwxr-xr-x. 3 root root 2048 May 4 2018 images
drwxr-xr-x. 2 root root 2048 May 4 2018 isolinux
drwxr-xr-x. 2 root root 2048 May 4 2018 LiveOS
drwxrwxr-x. 2 root root 655360 May 4 2018 Packages 里面镜像提供的rpm包
drwxrwxr-x. 2 root root 4096 May 4 2018 repodata
-rw-rw-r--. 1 root root 1690 Dec 10 2015 RPM-GPG-KEY-CentOS-7
-rw-rw-r--. 1 root root 1690 Dec 10 2015 RPM-GPG-KEY-CentOS-Testing-7
-r--r--r--. 1 root root 2883 May 4 2018 TRANS.TBL 标签:rw,centos,May,root,yum,2018,镜像,挂载,内网 From: https://www.cnblogs.com/xgsh/p/16638727.html