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

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

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 ‘+’


相关文章
|
Linux
Centos6配置阿里云yum源报错
在CentOS 6配置阿里云Yum源时,可能出现EPEL仓库访问报错(404 Not Found)。解决方法:编辑`/etc/yum.repos.d/epel.repo`文件,将`enabled`和`gpgcheck`参数设为0 ``` 此设置可解决仓库无法访问的问题。
2490 29
|
缓存 Ubuntu Linux
Linux中yum、rpm、apt-get、wget的区别,yum、rpm、apt-get常用命令,CentOS、Ubuntu中安装wget
通过本文,我们详细了解了 `yum`、`rpm`、`apt-get`和 `wget`的区别、常用命令以及在CentOS和Ubuntu中安装 `wget`的方法。`yum`和 `apt-get`是高层次的包管理器,分别用于RPM系和Debian系发行版,能够自动解决依赖问题;而 `rpm`是低层次的包管理工具,适合处理单个包;`wget`则是一个功能强大的下载工具,适用于各种下载任务。在实际使用中,根据系统类型和任务需求选择合适的工具,可以大大提高工作效率和系统管理的便利性。
1827 25
|
监控 iOS开发 容器
安装ipa到iphone和查看iphone上的活跃进程
本内容介绍应用管理功能,包括用户应用与系统应用的操作。用户应用支持安装、卸载、启动、查看实时日志及详细信息(如版本、签名、路径等)。以WhatsApp为例,展示其详细信息结构。系统应用为Apple官方自带应用,不可安装或卸载,但可运行、查看日志和详情。活跃程序模块可监控并管理设备上所有正在运行的进程,包括用户和系统进程。
1554 2
|
应用服务中间件 nginx
Nginx进程配置指令详解
Nginx进程配置指令主要包括:`worker_processes`设置工作进程数;`worker_cpu_affinity`绑定CPU核心;`worker_rlimit_nofile`设置最大文件描述符数量;`worker_priority`设置进程优先级;`worker_connections`设置最大连接数;`daemon`控制守护进程模式;`master_process`启用主进程模式;`pid`设置PID文件路径;`user`指定用户和组;`error_log`配置错误日志。这些指令在`nginx.conf`中配置,用于优化和控制Nginx的运行行为。
671 10
|
存储 Linux Docker
CentOS 7.6安装Docker实战案例及存储引擎和服务进程简介
关于如何在CentOS 7.6上安装Docker、介绍Docker存储引擎以及服务进程关系的实战案例。
957 3
CentOS 7.6安装Docker实战案例及存储引擎和服务进程简介
OpenEuler配置本地yum源
本文档介绍了如何在服务器和虚拟机上挂载光盘镜像并配置本地Yum仓库,包括创建挂载点、编辑repo文件、实现挂载持久化以及通过FTP共享本地仓库的方法。适用于需要频繁安装软件包或管理多台机器的场景。
3851 0
OpenEuler配置本地yum源
|
Unix Linux Go
Linux 使用Yum安装Go和配置环境
Linux 使用Yum安装Go和配置环境
|
缓存 Serverless Docker
函数计算产品使用问题之怎么修改Docker守护进程配置
函数计算产品作为一种事件驱动的全托管计算服务,让用户能够专注于业务逻辑的编写,而无需关心底层服务器的管理与运维。你可以有效地利用函数计算产品来支撑各类应用场景,从简单的数据处理到复杂的业务逻辑,实现快速、高效、低成本的云上部署与运维。以下是一些关于使用函数计算产品的合集和要点,帮助你更好地理解和应用这一服务。
|
存储 缓存 Linux
【Linux】另一种基于rpm安装yum的方式
通过本文的方法,您可以在离线环境中使用RPM包安装YUM并进行必要的配置。这种方法适用于无法直接访问互联网的服务器或需要严格控制软件源的环境。通过配置本地YUM仓库,确保了软件包的安装和更新可以顺利进行。希望本文能够为您在特定环境中部署YUM提供实用的指导。
2491 0
|
Linux Android开发 开发者
【Linux】yum的认识与简单配置
【Linux】yum的认识与简单配置
464 0