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