快速学会rpm安装yum本地源配置,源码安装,查看用户进程

下·

提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档


1.使用rpm安装zsh(忽略依赖关系安装)

RPM是红帽包管理(Redhat Package Manager)的缩写。
由Red Hat公司提出的一种软件包管理标准。
是Linux各发行版中应用最广泛的软件包格式之一(还有debian的发行版deb安装包)。
RPM功能通过rpm命令使用不同参数来实现。

查询是否已安装


```powershell
[root@ls_nfqZ8Onc ~]# rpm -q zsh
zsh-5.5.1-6.el8_1.2.x86_64

## 卸载zsh

```powershell
[root@ls_nfqZ8Onc ~]# rpm -e zsh
[root@ls_nfqZ8Onc ~]# rpm -q zsh
package zsh is not installed

查询所有已安装软件

rpm -qa

查询date命令所在软件包

[root@ls_nfqZ8Onc ~]# whereis date
date: /usr/bin/date /usr/share/man/man1/date.1.gz /usr/share/man/man1p/date.1p.gz

查询未安装的zsh的文件信息

[root@ls_nfqZ8Onc ~]# rpm -qpl zsh-5.8.1-2.mga9.x86_64.rpm 
error: open of zsh-5.8.1-2.mga9.x86_64.rpm failed: No such file or directory

2.yum本地网络源配置

yum本地源配置

[root@WHL ~]# mount /dev/sr0 /mnt/
mount: /mnt: /dev/sr0 already mounted on /run/media/lr/RHEL-8-5-0-BaseOS-x86_64.
[root@WHL ~]# cd /etc/yum.repos.d/
[root@WHL yum.repos.d]# ls
[root@WHL yum.repos.d]# vim redhat.repo
[root@WHL yum.repos.d]# yum clean all

Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

0 files removed
[root@WHL yum.repos.d]# 
[root@WHL yum.repos.d]# yum makecache 
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

BaseOS                                                                                     104 MB/s | 2.4 MB     00:00    
AppStream                                                                                  116 MB/s | 7.2 MB     00:00    
Metadata cache created.
[root@WHL yum.repos.d]# yum install httpd
Updating Subscription Management repositories.
Unable to read consumer identity

yum网络源配置

[root@WHL yum.repos.d]# ll
total 8
-rw-r--r--. 1 root root 2519 Jul 28 19:32 Centos-vault-8.5.2111.repo
-rw-r--r--. 1 root root  128 Jul 28 19:27 redhat.repo
[root@WHL yum.repos.d]# yum clean all

[root@WHL yum.repos.d]# yum makecache 

安装httpd软件

[root@WHL yum.repos.d]# yum install httpd -y
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

Last metadata expiration check: 0:00:06 ago on Thu 28 Jul 2022 07:40:08 PM CST.
Package httpd-2.4.37-41.module+el8.5.0+11772+c8e0c271.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!

查看vim命令属于哪个软件包

[root@WHL yum.repos.d]# whereis vim
vim: /usr/bin/vim /usr/share/vim /usr/share/man/man1/vim.1.g

yum卸载httpd

[root@WHL yum.repos.d]# yum remove httpd

清理缓存

[root@WHL yum.repos.d]# yum clean all

重新创建缓存

[root@WHL yum.repos.d]# yum makecache 

安装postgresql模块中的版本13

[root@WHL yum.repos.d]# yum install @postgresql:13

3.源码安装: httpd

4.查看root用户带有终端的进程

[root@WHL yum.repos.d]# ps -l
F S   UID     PID    PPID  C PRI  NI ADDR SZ WCHAN  TTY          TIME CMD
0 S     0    3484    3477  0  80   0 -  6987 -      pts/0    00:00:00 bash
0 R     0   35628    3484  0  80   0 - 11370 -      pts/0    00:00:00 ps
[root@WHL yum.repos.d]# 

显示没有终端的进程

[root@WHL yum.repos.d]# ps -x

显示所有进程

[root@WHL yum.repos.d]# ps -aux

查看1分钟内占用CPU时间前10的进程(使用top命令)

top - 19:45:16 up 25 min,  2 users,  load average: 0.05, 0.11, 0.14
Tasks: 299 total,   3 running, 296 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.0 us,  6.2 sy,  0.0 ni, 93.8 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
MiB Mem :   1790.2 total,    165.6 free,   1049.8 used,    574.8 buff/cache
MiB Swap:   1908.0 total,   1796.2 free,    111.8 used.    579.0 avail Mem 

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                            
      1 root      20   0  176016  13652   8812 S   0.0   0.7   0:03.12 systemd                                            
      2 root      20   0       0      0      0 S   0.0   0.0   0:00.01 kthreadd                                           
      3 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 rcu_gp                                             
sort: invalid number at field start: invalid count at start of ‘+
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值