5.8学习笔记
包管理工具rpm:
rpm -ivh 软件包名 : 安装rpm包 ---->直接安装网络资源
rpm -qa : 查询系统中所有的rpm包
rpm -e : 卸载一个rpm包
rpm -ql : 查询一个rpm包所生成的所有文件
rpm -qf : 查询某一个文件是那个rpm包生成的
rpm -qc : 查询一个rpm的配置文件
yum管理
yum源1.更换yum源创建目录 备份官方yum源curl -o /etc/yum.repos.d/CentOS-base.repo https://mirrors.aliyun.com/repo/Centos-7.repowget -o /etc/yum.repos.d/epel.repshttps://mirrors.aliyun.com2.查看yum源 : yum repolist3.清理yum源缓存 : yum clean all4.生成yum缓存 : yum makecache fast5.安装 : yum install6.更新 : yum update ---->保留旧的rpm包yum upgrade---->删除旧的rpm包7.卸载 : yum removeyum erase8.搜索 : yum search 9.列出 : yum list10.回滚: yum history--->yum history undo id11.重新安装 : yum reinstall查找命令在那个包 : yum provides 命令 :12.配置本地yum源1)备份2)挂载镜像3)mount /dev/cdrom /mnt4)编辑配置文件vim /etc/yum.repos.d/local.repo[local]name=localbaseurl=file:///mntenable=1gpgcheck=013.配置局域网内yum源[准备环境]需要两台服务器关闭防火墙并开机不自启systemctl status firewalld && systemctl disable firewalld关闭selinuxset enforce 0vim /etc/selinux/config SELINUX=enfocing修改为SELINUX=disable互ping检测网络是否通畅[yum服务端 :] 1)安装ftp服务yum -y install vsftpdmkdir /var/ftp/yumsystemctl start vsftpd2)获取rpm拷贝镜像中的rpm包3)制作yum源yum -y install createrepocreaterepo /var/ftp/yum[yum客户端 :]vim /etc/yum.repos.d/ftp.repo[ftp]name=ftp repobaseurl=ftp://服务端ip:port/路径enable=1gpgcheck=014.克隆yum源updatesyum -y install yum-utils epel-release createrepoyum -y install nginxcd /usr/share/nginx/htmlrm -rf *reposync -r base -r epel -r extras -r updatescreaterepo baseepelextrasupdates客户端:vim /etc/yum.repos.d/nginx.repo[base]name=nginx repobaseurl=http://服务端ip/basegpgcheck=0[epel]name=epel repobaseurl=http://服务端ip/epelgpgcheck=0