一、3 RPM(红帽软件包管理器)Yum软件仓库

1.4RPM(红帽软件包管理器)

RPM类似于Windows系统中的控制面板,会建立统一的数据库文件,详细记录软件信息并自动分析依赖关系。

常见的RPM软件包命令
安装软件的命令格式 rpm -ivh filename.rpm
升级软件的命令格式 rpm -Uvh filename.rpm
卸载软件的命令格式 rpm -e filename.rpm
查询软件描述信息的命令格式 rpm -qpi filename.rpm
列出软件文件信息的命令格式 rpm -qpl filename.rpm
查询文件属于哪个RPM命令格式 rpm -qf filename.rpm

Yum软件仓库

通过RPM能够查询到软件的依赖关系,但是当遇到一些大型软件时,由于依赖关系十分复杂,这时候安装软件就显得十分麻烦。

Yum软件仓库的出现时为了降低软件安装的难度和复杂度,并且根据用户的要求分析出所需要的软件包以及相关的依赖关系,然后自动从服务器下载软件包并且安装到系统中。

Yum软件仓库的RPM软件包可以由红帽官方发布,也可以由第三方发布,也能够自己编写。

常见的Yum命令
命令 作用
yum repolist all 列出所有的仓库
yum list all 列出仓库中所有的软件包
yum info 软件包名称 查看软件包信息
yum intstall 软件包名称 安装软件包
yum reinstall 软件包名称 重新安装软件包
yum update 软件包名称 升级软件包
yum remove 软件包名称 移除软件包
yum clean all 清楚所有仓库缓存
yum check-update 检查可更新的软件包
yum grouplist 查看系统中已经安装的软件包组
yum groupinstall 软件包组 安装指定的软件包组
yum groupremove 软件包组 移除指定的软件包组
yum groupinfo 软件包组 查询指定的软件包组信息

1.7 systemd 初始化进程

Linux操作系统的开机过程:
BIOS >> Boot Loader >> 系统内核 >> 内核初始化 >> 启动初始化进程

初始化进程是Linux操作系统的第一个进程,systemd初始化进程采用了并发启动机制,开机速度很快。

在之前的RHEL-5 或RHEL-6系统中,都采用了System V init 初始化进程服务,systemd用目标(target)代替了System V init中运行级别的概念,以下是systemd 和 System V init 的区别以及作用

System V init 运行级别 systemd 目标名称 作用
0 runlevel0.target, poweroff.target 关机
1 runlevel1.target, rescue.target 单用户模式
2 runlevel2.target, multi-user.target 等同于级别 3
3 runlevel3.target, multi-user.target 多用户的文本界面
4 runlevel4.target, multi-user.target 等同于级别 3
5 runlevel5.target, graphical.target 多用户的图形界面
6 runlevel6.target, reboot.target 重启
emergency emergency.target 紧急 Shell

例如:想要将系统默认的运行目标修改为“多用户,无图形”模式,可以直接用ln命令吧多用户目标文件连接到/etc/systemd/system/目录:
[root@jun ~]# ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system.default.target

必会systemctl命令
systemctl管理服务的启动、重启、停止、重载、查看状态等常用命令
System V init 命令【RHEL 6】 systemctl命令【RHEL7】 作用
service foo start systemctl start foo.service 启动服务
service foo restert systemctl restert foo.service 重启服务
service foo stop systemctl stop foo.service 停止服务
sever foo reload systemctl reload foo.service 重新加载配置文件
service foo status systemctl status foo.service 查看服务状态
————————————————————————————————————————————
system 设置服务开机启动、不启动、查看各级别下服务启动状态等常用命令
system V init 命令【RHEL6】 systemctl 命令【RHEL7】 作用
chkconfig foo on systemctl enable foo.service 开机自动启动
chkconfig foo off systemctl disable foo.service 开机不自动启动
chkconfig foo systemctl is-enable foo.service 查看特定服务是否为开机自动启动
chkconfig --list sustemctl list-unit-files --type=service 查看各个级别下服务的启动与禁用情况
发布了7 篇原创文章 · 获赞 0 · 访问量 296

猜你喜欢

转载自blog.csdn.net/weixin_44924446/article/details/105052100