一,软件包的类型
DEB UBlinux DEBlinux系统中用的软件包
RPM redhat centOS fadora 系统中用的软件包
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命令
wget + 网址 下栽
rpm -ivh linuxqq_2.0.0-b2-1082_x86_64.rpm 安装参数组合 -i install -v verbose -h hash
rpm -q linuxqq 查看QQ
rpm -qa 查看系统中所有安装的软件
rpm -ql linuxqq 查看QQ的安装文件列表
rpm -qf /mnt/ 查看QQ文件
rpm -qc filesystem-3.8-2.el8.x86_64 查看配置文件
rpm -qd filesystem-3.8-2.el8.x86_64 查看说明文件
rpm -e linuxqq 卸载
rpm -ivh linuxqq_2.0.0-b2-1082_x86_64.rpm 安装
rpm -q linuxqq --info 查看qq软件信息
rpm -qlp wps-office-11.1.0.9505-1.x86_64.rpm 查看wps的所有文件列表
rpm -qp wps-office-11.1.0.9505-1.x86_64.rpm 查询wps软件包
rpm -qp wps-office-11.1.0.9505-1.x86_64.rpm --info 查看软件包信息
rpm -ivh linuxqq_2.0.0-b2-1082_x86_64.rpm --force 重新安装
rpm -ivh wps-office-11.1.0.9505-1.x86_64.rpm --nodeps 忽略依赖性
rpm -qp FluffyMcAwesome-A-6.4.0-11.r19335.x86_64.rpm --script 查询软件在安装或卸载过程中的运行脚本
cp linuxqq_2.0.0-b2-1082_x86_64.rpm 复制Linuxqq
echo hello westos>> linuxqq_2.0.0-b2-1082_x86_64.rpm
rpm -Kv linuxqq_2.0.0-b2-1082_x86_64.rpm 检测软件md5校验码
rpm -V linuxqq 检测已安装软件在系统中的文件被修改信息
四,本地软件仓库的搭建
1.在系统统中加载安装系统时使用的安装镜像
[root@westos_student50 Desktop]# mkdir /westos 建立/westos
[root@westos_student50 Desktop]# ls /westos
[root@westos_student50 Desktop]# mount /iso/rhel-8.2-x86_64-dvd.iso /westos 安装镜像
2.编写软件仓库文件
[root@westos_student50 software]# cd /etc/yum.repos.d/ 进入软件源指向文件配置目录
[root@westos_student50 yum.repos.d]# vim westos.repo 软件仓库指向文件
[AppStream] #仓库名称
name=local AppStream
baseurl=file:///westos/AppStream 地址
gpgcheck=0
enable=0
[BaseOS]
name=local BaseOS
baseurl=file:///westos/BaseOS
gpgcheck=0
[root@westos_student50 yum.repos.d]# cd /software 进入这个目录
[root@westos_student50 software]# dnf install wps-office-11.1.0.9505-1.x86_64.rpm 测试安装wps,是否解决依赖性
五,网络共享仓库
[root@westos_student50 ~]# dnf install httpd -y 下载http
[root@westos_student50 ~]# systemctl enable --now httpd 运行httpd
[root@westos_student50 ~]# systemctl disable --now firewalled 关闭防火墙
mkdir /var/www/html/westos 在/var/www/html下建立目录westos
umount /westos 卸载挂栽
mount /iso/rhel-8.2-x86_64-dvd.iso /var/www/html/westos/ 挂栽到这个 /var/www/html/westos/
vim /etc/yum.repos.d/westos.repo 编辑
[AppStream]
name=local APPStream.
baseurl=http://192.168.155.72/westos/AppStream
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
enabled=1
[BaseOS]
name=local BaseOS
baseurl=http://192.168.155.72/westo/ BaseOS
gpgcheck=0
cat /etc/yum.repos.d/westos
dnf list
vim /etc/rc.d/rc.local 编辑开机时自动启动
chmod +x /etc/rc.d/rc.local 添加权限
cat /etc/rc.d/rc.local
#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.
touch /var/lock/subsys/local
mount /iso/rhel-8.2-x86_64-dvd.iso /var/www/html/westos/
六,dnf命令管理
var/chche/dnf 储存位置
dnf repolist 列出仓库信息
cd /var/cache/dnf 进入
dnf clean all 清除系统中已经加载的仓库缓存信息 /var/cache/dnf
ls /var/cache/dnf/
dnf list httpd
dnf list all 列出所有软件
dnf list all | wc -l 列出所有软件并统计行数
rpm -qa | wc -l 查看所有软件并统计行数
dnf list installed 列出已安装软件
dnf list available 列出未安装软件
dnf list available | wc -l 列出未安装软件并统计行数
rpm -q firefox 查看火狐
dnf install firefox -y 安装火狐并不询问
dnf reinstall firefox -y 从重新安装火狐并不询问
dnf remove firefox -y 卸载火狐并不询问
dnf search firefox 搜索火狐
dnf search "Web browwser"
rm -rf /bin/ls
ls
rpm -qf /bin/ls
dnf whatprovides /bin/ls 搜索包含文件的软件包
dnf reinstall coreutils-8.30-6.el8.x86_64 -y
dnf history 看安装历史
dnf history info 15 #dnf执行历史详细信息
dnf group list #列出软件组
dnf group list "Development Tools"
dnf group info "Development Tools" 查看软件组信息
dnf group install "Development Tools" 安装软件组
dnf group list --installed 列出已安装软件组
dnf group list --available 列出未安装软件组
dnf group list --hidden 列出隐藏软件案组
dnf group install "Java Platform" --downloadonly --destdir=/mnt -y 下载仓库中指定软件的安装包到指定/mnt目录