第一章 部署虚拟环境安装Linux 系统
1.1-1.4 虚拟机及系统安装
省略。。。
1.5 RPM
- Redhat Package Manager(红帽软件包管理器),作用是降低安装的难度,能详细记录软件信息并自动分析依赖关系;
- 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 |
1.6 Yum软件仓库
- Yum软件仓库可以根据用户的要求分析出所需软件包及其相关的依赖关系,然后自动从服务器下载软件包并安装到系统;
- RPM虽然能帮助用户查询软件依赖关系,但是问题还是要用户自己解决;而Yum仓库则将大量RPM聚集到一起,进一步降低安装难度,解决软件的依赖关系;
作用 | 命令 |
---|---|
列出所有仓库 | yum repolist all |
列出仓库中所有的软件包 | yum list all |
查看软件包信息 | yum info 软件包名称 |
安装软件包 | yum install 软件包名称 |
重新安装软件包 | 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 – 加载系统内核 – 内核初始化 – 启动初始化进程; - RHEL 5,6 初始化进程为
init
,而RHEL7系统初始化进程为systemd
用systemctl
命令来管理服务
作用 | 命令 |
---|---|
启动服务 | systemctl start foo.service(服务名称) |
重启服务 | systemctl restart foo.service |
重新加载配置文件(并不终止服务,PID不变,作用与restart类似) | systemctl reload foo.service |
停止服务 | systemctl stop foo.service |
查看服务状态 | systemctl status foo.service |
用systemctl
命令来查看启动设置
作用 | 命令 |
---|---|
开机自动启动 | systemctl enable foo.service |
开机不自动启动 | systemctl disable foo.service |
查看服务是否开机自启动 | systemctl is-enabled foo.service |
查看各个级别下服务的启动与禁止情况 | systemctl list-unit-files --type=service |