快速学会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 ‘+’


目录
打赏
0
0
0
0
1
分享
相关文章
安装ipa到iphone和查看iphone上的活跃进程
本内容介绍应用管理功能,包括用户应用与系统应用的操作。用户应用支持安装、卸载、启动、查看实时日志及详细信息(如版本、签名、路径等)。以WhatsApp为例,展示其详细信息结构。系统应用为Apple官方自带应用,不可安装或卸载,但可运行、查看日志和详情。活跃程序模块可监控并管理设备上所有正在运行的进程,包括用户和系统进程。
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的运行行为。
80 10
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`则是一个功能强大的下载工具,适用于各种下载任务。在实际使用中,根据系统类型和任务需求选择合适的工具,可以大大提高工作效率和系统管理的便利性。
203 25
|
2月前
|
yum install -y net-snmp-devel 安装不成功 zabbix项目安装,Errors during downloading metadata for repository ‘extras-common’:问题解决方案-优雅草卓伊凡
yum install -y net-snmp-devel 安装不成功 zabbix项目安装,Errors during downloading metadata for repository ‘extras-common’:问题解决方案-优雅草卓伊凡
79 13
yum install -y net-snmp-devel 安装不成功 zabbix项目安装,Errors during downloading metadata for repository ‘extras-common’:问题解决方案-优雅草卓伊凡
【Linux】另一种基于rpm安装yum的方式
通过本文的方法,您可以在离线环境中使用RPM包安装YUM并进行必要的配置。这种方法适用于无法直接访问互联网的服务器或需要严格控制软件源的环境。通过配置本地YUM仓库,确保了软件包的安装和更新可以顺利进行。希望本文能够为您在特定环境中部署YUM提供实用的指导。
481 0
Linux 使用Yum安装Go和配置环境
Linux 使用Yum安装Go和配置环境
Linux 安装 mysql【使用yum源进行安装】
这篇文章介绍了在Linux系统中使用yum源安装MySQL数据库的步骤,包括配置yum源、安装MySQL服务、启动服务以及修改root用户的默认密码。
Linux 安装 mysql【使用yum源进行安装】
在CentOS上使用yum安装与使用MySQL
在CentOS操作系统上使用yum包管理器安装和配置MySQL数据库的详细步骤,包括下载MySQL的yum源配置、安装MySQL服务、启动和停止服务、设置开机自启动、获取临时密码、修改root用户密码、授权用户以及处理相关问题。同时,文章还包含了一些操作的截图,帮助用户更直观地理解安装和配置过程。
2255 0
在CentOS上使用yum安装与使用MySQL
Linux中yum、rpm、apt-get、wget的区别,yum、rpm、apt-get常用命令,CentOS、Ubuntu中安装wget
Linux中yum、rpm、apt-get、wget的区别,yum、rpm、apt-get常用命令,CentOS、Ubuntu中安装wget
365 11
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等