软件安装
一、软件名称识别
1、[firefox]-[38.3.0-2].[el7_1].[x86_64].rpm
[firefox]—— 软件名称
[38.3.0-2]——软件版本
[el7_1]——软件适用系统
[x86_64]——64位
rpm结尾的适用与redhat操作系统
2、rpm及其参数
二、本地yum源及其配置
yum能够投入使用的前提是必须要有yum源,以及配置源的指向文件
1、从网络上下本机系统版本匹配的iso镜像文件
rhel-server-7.2-x86_64-dvd.iso
2、把rhel-server-7.2-x86_64-dvd.iso挂在到/mnt以便访问镜像中的文件
mount /home/kiosk/Desktop/rhel-server-7.2-x86_64-dvd.iso /rhel7.2/
3、ls /rhel7.2 可以看到挂载的镜像中的内容
4、配置本机yum源指向
rm -fr /etc/yum.repos.d/*
vim /etc/yum.repos.d/yum.repo
[rhel7.2] ##yum源名称,自定义
name=rhel7.2 ##简单描述
baseurl=file:///rhel7.2 ##软件存在位置,file:// 表示本地协议
gpgcheck=0 ## =0,享有安装第三方软件的权利,=1则需要专门的key
5、如下就可以安装软件l
三、搭建网络yum源
1、主机安装资源共享服务httpd
yum install httpd -y
2、关闭防火墙,开启http服务
systemctl stop firewalld
systemctl disable firewalld
systemctl start httpd
systemctl enable httpd
查看http服务,显示开启
3、建立共享目录,并挂在镜像文件到共享目录上
mkdir /var/www/html/rhel7.2
umount /rhel7.2
mount /home/kiosk/Desktop/rhel-server-7.2-x86_64-dvd.iso /var/www/html/rhel7.2
4、修改本机yum源指向
[server]
name=rhel7.2
baseurl=file:///var/www/html/rhel7.2
gpgcheck=0
5、测试
在浏览器中输入:http://本机ip/rhel7.2
可以看到镜像中的内容
6、开机自动挂载,永久性挂载
vim /etc/rc.d/rc.local
chmod +x /etc/rc.d/rc.local
mount rhel-server-7.2-x86_64-dvd.iso /var/www/html/rhel7.2
主机配置完成
7、配置其他linux系统的主机(这里选择了虚拟机)
(1)、配置文件
vim /etc/yum.repos.d/yum.repo
(2)软件下载,可以看到在没有镜像的情况下可以安装软件
四、第三方软件仓库的搭建
把所有的rpm软件包放到一个目录中,这个目录中只能存在rpm文件
createrepo -v /rpm存放目录
vim /etc/yum.repos.d/yum.repo
[Software]
name=software
baseurl=file:///rpm存放目录
gpgcheck=0
yum clean all##清空yum缓存识别新配置
yum和rpm的区别:
yum和rpm都是安装软件需要的命令,它们最大的区别在于rpm只能发现软件的依赖性而不能解决依赖关系
使用rpm -ivh --nodeps --force 可以忽略依赖性强制安装软件 ,但是安装后的软件无法正常使用
yum是上层软件管理工具,最重要的功能是可以解决软件的倚赖关系并下载
yum及其参数: