linux 简单记录1 --系统安装,rpm,yum

linux 简单记录1---记录常用、简单的命令

1 操作系统安装
虚拟机--在安装完虚拟机之后,不能立即安装linux,因为还要在虚拟机中设置操作系统的硬件标准。
--安装客户机操作系统(选择“稍后安装操作系统”)
如果选择了安装程序光盘镜像文件,虚拟机会通过默认的安装策略部署最精简的linux系统。
--安装磁盘选择和分区大小
----installtion destination
----选择磁盘--“i will configure partitioning",进行分区
----进入分区界面,选择“+”
----1 创建/boot分区,/boot用于存储linux内核文件,大小设置2-4GB,文件系统格式选择ext4,device_type=standard partition
----2 创建/home分区,一般会把用户自己文件放里面,大小2-4GB,ext4,device_type=LVM
----3 创建/swap分区,虚拟内存,大小2-4GB,文件系统为swap,device_type=LVM
----4 创建/根目录,用于存储文件系统,100GB,ext4,device_type=LVM
[root@iscsi ~]# df -Th
[root@iscsi ~]# cat /etc/redhat-release 
CentOS Linux release 7.4.1708 (Core)

rpm 管理

rpm -ivh xxx.rpm 安装rpm包
rpm -Uvh xxx.rpm 升级rpm包
rpm -e xxx.rpm 卸载rpm包
rpm -qpi xxx.rpm 查询软件描述信息
rpm -qpl xxx.rpm 列出软件文件信息
rpm -qf xxx.rpm 查询文件属于哪个rpm

yum 管理

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 软件包组 查询指定的软件包组信息

systemd 初始化进程

开机--BIOS开始,boot loader,加载系统内核,内核初始化,启动初始化进程,centos 7 用systemd替代system v init

systemctl 管理服务的启动、重启、停止、重载、查看状态等常用命令

service foo start //systemctl start foo.service 启动服务
service foo restart //systemctl restart foo.service 重启服务
service foo stop //systemctl stop foo.service 停止服务
service foo reload //systemctl reload foo.service 重新加载配置文件(不终止服务)
service foo status //systemctl status foo.service 查看服务状态

systemctl 设置服务开机启动、不启动、查看各级别下服务启动状态等常用命令

chkconfig foo on //systemctl enable foo.service 开机自动启动
chkconfig foo off //systemctl disable foo.service 开机不自动启动
chkconfig foo //systemctl is-enabled foo.service 查看特定服务是否为 开机自动启动
chkconfig --list //systemctl list-unit-files --type=service 查看各个级别下服务的启动与禁用情况
原文地址:https://www.cnblogs.com/yhq1314/p/13158585.html