一. Linux 中软件包的类型
1. DEB UBlinux DEBlinux
2. RPM redhat centOS fadora
3. bz2 | gz | xz 1. 需要源码安装需要编译
2. 绿色软件 , 直接可用
ntfs - 3g_ntfsprogs - 2017.3.23 .tgz 需要编译 "configure"
Firefox - latest - x86_64.tar.bz2 绿色
" 注意在 rhel8 中只能使用绿色软件 , 源码编译软件和 rpm 软件”
二. 软件包的名称结构
[dhcp - server] - [ 4.3.6 - 30 ].[el8].[x86_64].[rpm]
1 2 3 4 5
1. 软件名称
2. 软件版本
3. 软件的授权协议版本
4. 软件架构
5. 软件类型后缀
三. rpm 命令管理软件包
rpm
- ivh 安装参数组合 - i install - v verbose - h hash
- a 所有
- f 文件
- p 软件包
- q 查询
- l 软件安装文件列表
- e 卸载
- c 配置文件
- d 说明
-- info 软件信息
-- force 强制
-- nodeps 忽略依赖性
-- script 查询软件在安装或卸载过程中的运行脚本
装软件时一定要--script查询一下
- Kv 检测软件 md5 校验码
- V 检测已安装软件在系统中的文件被修改信息
四 本地软件仓库的搭建
系统软件仓库的作用
在系统中对软件进行管理
rpm 命令是不能解决依赖关系的
如果需要软件在安装过程中自动解决依赖关系
需要大家系统软件仓库
搭建方法
1. 在系统中加载安装系统时使用的安装镜像
mount / xxxx / rhel8 .2 - xxxxxxxx.iso / xxxx
2. 编写软件仓库文件
/ etc / yum.repos.d /
软件源指向文件配置目录
在此目录中不能有无法访问的源指向
vim / etc / yum.repos.d / xxxx.repo 软件仓库指向文件
[AppStream]
仓库名称
name = westos AppStream 描述
baseurl = file :/// westos / AppStream 地址
gpgcheck = 0
不检测 gpgkey
( 跳过授权检测 )
gpgkey = file :/// etc / pki / rpm - gpg / RPM - GPG - REDHAT - release
enabled = 1 | 0
[BaseOS]
name = westos BaseOS
baseurl = file :/// westos / BaseOS /
gpgcheck = 0
3. test
dnf install gcc - y
dnf repolit 列出软件仓库
install httpd 尝试安装httpd
共享仓库
mkdir /var/www/html/文件
mount /iso/rhel-8.2-x86_64-dvd.iso /var/www/html/ace/
vim /etc/yum.repos.d/ace.repo
五 . dnf 软件管理命令
安装管理包
dnf repolist 列出仓库信息
clean all 清除系统中已经加载的仓库缓存信息 / var / cache / dnf
list all 列出所有软件
list available 列出未安装软件
list installed 列出已安装软件
install 安装
remove 卸载
reinstall 重新安装
search 搜索
whatprovides 搜索包含文件的软件包
history dnf执行历史
history info dnf 执行历史详细信息
group list 列出软件组
group list -- installed 列出已安装软件组
group list -- available 列出未安装软件组
group list -- hidden 列出隐藏软件案组
group install 安装软件组
group info 查看软件组信息
下载安装包
yumdownloader 下载软件包到本机指定位置
yumdownloader httpd 下载仓库中指定软件的安装包到当前目录
yumdownloader -- destdir =/ mnt 下载仓库中指定软件的安装包到指定 / mnt 目录
yumdownloader httpd -- destdir =/ mnt -- resolve 下载仓库中指定软件安装包和软件依赖性到 / mnt 目录