linux中的软件管理

1.使用已知网络安装资源安装软件

vim /etc/yum.repos.d/yum.repo ##文件名称必须以repo结尾
[rhel7.2] ##仓库名称
name=rhel7.2 source ##对软件源的描述
baseurl=http://172.25.254.250/rhel7.2 ##网络安装源
gpgcheck=0 ##不检测gpgkey
enabled=1 ##此安装源语句块生效
yum clean all ##清空系统中原有的yum信息
yum repolist ##列出

yum install dhcp ##下载安装
linux中的软件管理
linux中的软件管理
linux中的软件管理


2.配置本地yum源

#1).获得一个与本机系统版本一致的系统镜像

linux中的软件管理

#2).挂载镜像

mount /abc/xxxxxx.iso /rhel7.2
linux中的软件管理

#3).设定永久挂载

vim /etc/rc.d/rc.local
mount /xxx/xxxx.iso /rhel7.2
chmod 755 /etc/rc.d/rc.local ##在系统开机时会自动
执行此脚本
linux中的软件管理
linux中的软件管理

#4).设定系统安装源指向

mkdir /etc/yum.repos.d/baskup
mv /etc/yum.repos.d/* /etc/yum.repos.d/baskup
vim /etc/yum.repos.d/yum.repo
[rhel7.2]
name=rhel7.2
baseurl=file:///rhel7.2
gpgcheck=0

yum clean all
yum install httpd -y
linux中的软件管理
linux中的软件管理
linux中的软件管理
linux中的软件管理

3.共享型yum源

#1.在一台已经连接好本地yum源的主机中安装httpd

yum install httpd
linux中的软件管理
linux中的软件管理

#2.配置网络yum源

systemctl start httpd
systemctl stop firewalld
systemctl enable httpd
systemctl disable firewalld

mkdir /var/www/html/rhel7.2
mount /xxx/xxx.iso /var/www/html/rhel7.2

测试:
在浏览器中输入地址:
http://172.25.254.16/rhel7.2 <<<<此地址就是网络yum源地址
linux中的软件管理
linux中的软件管理


4.yum命令

#1.yum 命令的使用必须是在yum源搭建成功后才能正常运行
#2.yum命令 的详细用法

yum clean all ##清除原有缓存
yum repolist ##列出仓库信息
yum install software ##安装
yum list software ##查看软件
yum list all ##查看所有软件
yum list installed ##列出已安装软件
yum list avaliable ##列出可安装软件
linux中的软件管理
yum reinstall software ##重新安装
linux中的软件管理
yum remove software ##卸载
yum info software ##查看软件信息
linux中的软件管理
yum search software信息 ##根据软件信息查找软件
yum whatprovides file ##根据文件找出包含此文件的软件
linux中的软件管理
yum groups list ##列出软件组
yum groups info ##查看软件组的信息
yum groups install sfgroup ##安装软件组
yum groups remove sfgroup##删除软件组

#3.yum软件屏蔽

vim /etc/yum.conf
exclude=.i686 ##屏蔽.i686软件

yum clean all
yum list all ##此时没有*.i686文件
linux中的软件管理
linux中的软件管理


5.用rpm命令处理软件

rpm -i ##安装
rpm -v ##显示过程
rpm -h ##hash加密
linux中的软件管理
rpm -e ##卸载
rpm -q ##查看
rpm -a ##所有
linux中的软件管理
rpm -p ##软件包
rmp -ql ##查看软件在系统中的安装文件路径
–scritps ##查看脚本
–nodeps ##安装软件忽略软件依赖
–force ##强行安装软件
–Kv ##检测软件包是否被篡改


6.第三方软件仓库的搭建

#1.把所有的rmp包放到一个目录中,这个目录只能存放rpm文件

linux中的软件管理

#2.createrepo -v /存放软件包的目录

##命令执行成功会生成repodate目录 mkdir /software
linux中的软件管理
linux中的软件管理

#3.vim /etc/yum.repos.d/yum.repo

[software]
name=software
baseurl=file:///software
gpgcheck=0
linux中的软件管理
yum clean all

#4.检测yum源中是否有添加的软件安装包

yum list linuxqq
linux中的软件管理

linux中的软件管理


1.使用已知网络安装资源安装软件