在本地创建yum源,使局域网内其他电脑可以使用
可以通过createrepo创建本地yum源端(repo即repository)
如果是虚拟机需要如下设置(或非虚拟机插入光盘):
1、挂载光盘到/mnt
mount /dev/cdrom /mnt
2、复制/mnt/Packages目录下的所有软件包至/var/www/html/centos
mkdir -p /var/www/html/centos
cp /mnt/Packages/* /var/www/html/centos/
3、使用createrepo创建本地源,指定该命令会在centos目录下生成repodata目录
查看是否安装了createrepo:rpm -q createrepo
如果没有安装则先安装:yum install createrepo* -y
cd /var/www/html
createrepo centos
4、利用HTTP发布YUM本地源
查看是否安装了httpd:rpm -q httpd
如果没有安装则执行:yum install httpd httpd-devel -y
创建apache用户和组(一般已经创建好了):useradd apache -g apache
重启httpd服务:systemctl restart httpd.service
临时关闭SELinux应用级安全策略:setenf