搭建内网yum仓库
1.挂载光盘
[root@centos ~]# mount /dev/cdrom /mnt
2.通过ftp共享软件包存放的目录
[root@centos ~]# yum install vsftpd -y
[root@centos ~]# systemctl start vsftpd
[root@centos ~]# systemctl stop firewalld
[root@centos ~]# setenforce 0
3.将光盘中的软件包都拷贝至ftp的共享目录下
[root@centos ~]# mkdir /var/ftp/centos7/
[root@centos ~]# find /mnt/ -type f -name "*.rpm" -
exec cp {} /var/ftp/centos7/ \;
4.将共享的目录设置成yum仓库
[root@centos ~]# yum install createrepo -y
[root@centos ~]# createrepo /var/ftp/centos7/
客户端
1.关闭所有的公网仓库
[root@centos yum.repos.d]# gzip /etc/yum.repos.d/
2.新建一个repo文件,文件中的baseurl指向服务端
[root@cenots ~]# cat /etc/yum.repos.d/ftp-centos7.repo
[ftp-centos7]
name = This is Base Repo
baseurl = ftp://10.0.0.200/centos7/
enable = 1
gpgcheck = 0
3.测试是否能正常安装软件
[root@cenots ~]# yum install httpd -y
源码包管理
1.congiure,生成makefile文件
[root@centos nginx-1.16.1]# ./configure --
prefix=/usr/local/nginx-1.16 --with-http_mp4_module
[root@centos nginx-1.16.1]# yum install pcre pcre-
devel -y
[root@centos nginx-1.16.1]# yum install zlib zlib-
devel -y
2.编译
[root@centos nginx-1.16.1]# make
3.安装
[root@centos nginx-1.16.1]# make install
4.测试
[root@centos nginx-1.16.1]# ln -s /usr/local/nginx-1.16/ /usr/local/nginx
/usr/local/nginx/sbin/nginx
[root@oldboy-199 ~]# cat /etc/yum.repos.d/ftp-
centos7.repo
[ftp-centos7]
name = This is Base Repo
baseurl = ftp://10.0.0.200/centos7/
enable = 1
gpgcheck = 0