统信服务器操作系统上安装atop

196 篇文章 2 订阅
196 篇文章 3 订阅

原文链接:统信服务器操作系统上安装atop

hello,大家好啊,今天给大家带来一篇在统信服务器操作系统上安装atop的文章,通过这个例子给大家介绍如何安装官方仓库没有的包、不能直接使用yum安装的软件,欢迎大家浏览分享转发。

一、查找对应安装包直接安装

1、在pkgs.org网站上查找atop包

image-20230725110219016

2、下载安装包到本地

image-20230725110301841

3、查看服务器操作系统信息

[root@localhost ~]# cat /etc/os-version 
[Version] 
SystemName=UnionTech OS Server
SystemName[zh_CN]=统信服务器操作系统
ProductType=Server
ProductType[zh_CN]=服务器
EditionName=e
EditionName[zh_CN]=e
MajorVersion=20
MinorVersion=1050
OsBuild=12038.101
[root@localhost ~]# uname -a
Linux localhost.localdomain 4.19.90-2201.4.0.0135.up1.uel20.x86_64 #1 SMP Mon Feb 21 18:36:21 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost ~]# 

img

4、安装atop包

[root@localhost ~]# ll
总用量 192K
-rw------- 1 root root 1.4K  75 10:03 anaconda-ks.cfg
-rw-r--r-- 1 root root 183K  75 10:10 atop-2.7.1-1.el8.x86_64.rpm
drwxr-xr-x 2 root root   59  75 10:08 Desktop
drwxr-xr-x 2 root root    6  75 09:54 Documents
drwxr-xr-x 2 root root    6  75 09:54 Downloads
-rw------- 1 root root 1.8K  75 10:07 initial-setup-ks.cfg
drwxr-xr-x 2 root root   32  75 09:54 Music
drwxr-xr-x 3 root root   24  75 09:54 Pictures
drwxr-xr-x 2 root root    6  75 09:54 Videos
[root@localhost ~]# rpm -ivh atop-2.7.1-1.el8.x86_64.rpm 
警告:atop-2.7.1-1.el8.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 2f86d6a1: NOKEY
Verifying...                          ################################# [100%]
准备中...                          ################################# [100%]
正在升级/安装...
   1:atop-2.7.1-1.el8                 ################################# [100%]
[root@localhost ~]# 

img

5、运行atop命令

[root@localhost ~]# atop

img

二、通过源码包编译生成rpm包

1、下载源码rpm包到本地

image-20230725114043083

2、服务器上安装rpm-build工具

[root@localhost ~]# yum install rpm-build.x86_64 -y
Last metadata expiration check: 0:03:07 ago on 2023年07月05日 星期三 10时10分17秒.
Dependencies resolved.
==============================================================================================================
 Package                 Architecture  Version                  Repository                               Size
==============================================================================================================
Installing:
 rpm-build               x86_64        4.15.1-43.uel20          UnionTechOS-Server-20-everything         93 k
Upgrading:
 python3-rpm             x86_64        4.15.1-43.uel20          UnionTechOS-Server-20-everything         74 k
 rpm                     x86_64        4.15.1-43.uel20          UnionTechOS-Server-20-everything        456 k
 rpm-libs                x86_64        4.15.1-43.uel20          UnionTechOS-Server-20-everything        340 k
Installing dependencies:
 autoconf                noarch        2.69-30.uel20            UnionTechOS-Server-20-everything        609 k
 automake                noarch        1.16.2-2.uel20.03        UnionTechOS-Server-20-everything        452 k
 chrpath                 x86_64        0.16-12.uel20            UnionTechOS-Server-20-everything         26 k
 elfutils                x86_64        0.180-3.uel20            UnionTechOS-Server-20-everything        438 k
 git                     x86_64        2.27.0-12.uel20          UnionTechOS-Server-20-everything        6.1 M
 perl-Error              noarch        1:0.17028-1.uel20        UnionTechOS-Server-20-everything         30 k
 perl-Git                noarch        2.27.0-12.uel20          UnionTechOS-Server-20-everything         26 k
 perl-TermReadKey        x86_64        2.38-2.uel20             UnionTechOS-Server-20-everything         23 k

Transaction Summary
==============================================================================================================
Install  9 Packages
Upgrade  3 Packages

Total download size: 8.7 M
Downloading Packages:
(1/12): chrpath-0.16-12.uel20.x86_64.rpm                                      218 kB/s |  26 kB     00:00    
(2/12): automake-1.16.2-2.uel20.03.noarch.rpm                                 1.6 MB/s | 452 kB     00:00    
(3/12): elfutils-0.180-3.uel20.x86_64.rpm                                     253 kB/s | 438 kB     00:01    
(4/12): autoconf-2.69-30.uel20.noarch.rpm                                     312 kB/s | 609 kB     00:01    
(5/12): perl-Error-0.17028-1.uel20.noarch.rpm                                 136 kB/s |  30 kB     00:00    
(6/12): perl-Git-2.27.0-12.uel20.noarch.rpm                                   116 kB/s |  26 kB     00:00    
(7/12): perl-TermReadKey-2.38-2.uel20.x86_64.rpm                              122 kB/s |  23 kB     00:00    
(8/12): rpm-build-4.15.1-43.uel20.x86_64.rpm                                  299 kB/s |  93 kB     00:00    
(9/12): python3-rpm-4.15.1-43.uel20.x86_64.rpm                                200 kB/s |  74 kB     00:00    
(10/12): rpm-libs-4.15.1-43.uel20.x86_64.rpm                                  241 kB/s | 340 kB     00:01    
(11/12): rpm-4.15.1-43.uel20.x86_64.rpm                                       270 kB/s | 456 kB     00:01    
(12/12): git-2.27.0-12.uel20.x86_64.rpm                                       601 kB/s | 6.1 MB     00:10    
--------------------------------------------------------------------------------------------------------------
Total                                                                         825 kB/s | 8.7 MB     00:10     
UnionTechOS-Server-20-1050-everything                                          19 kB/s | 1.7 kB     00:00    
Importing GPG key 0x8DF595ED:
 Userid     : "UnionTech <security@uniontech.com>"
 Fingerprint: C822 503F 2F4C E25A 6EA0 65BE 9055 A64E 8DF5 95ED
 From       : https://euler-packages.chinauos.com/server-euler/fuyu/1050/everything/x86_64/RPM-GPG-KEY-UnionTech
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                      1/1 
  Upgrading        : rpm-libs-4.15.1-43.uel20.x86_64                                                     1/15 
  Running scriptlet: rpm-libs-4.15.1-43.uel20.x86_64                                                     1/15 
  Upgrading        : rpm-4.15.1-43.uel20.x86_64                                                          2/15 
  Running scriptlet: rpm-4.15.1-43.uel20.x86_64                                                          2/15 
  Installing       : autoconf-2.69-30.uel20.noarch                                                       3/15 
  Installing       : automake-1.16.2-2.uel20.03.noarch                                                   4/15 
  Installing       : perl-TermReadKey-2.38-2.uel20.x86_64                                                5/15 
  Installing       : perl-Error-1:0.17028-1.uel20.noarch                                                 6/15 
  Installing       : perl-Git-2.27.0-12.uel20.noarch                                                     7/15 
  Installing       : git-2.27.0-12.uel20.x86_64                                                          8/15 
  Installing       : elfutils-0.180-3.uel20.x86_64                                                       9/15 
  Installing       : chrpath-0.16-12.uel20.x86_64                                                       10/15 
  Installing       : rpm-build-4.15.1-43.uel20.x86_64                                                   11/15 
  Upgrading        : python3-rpm-4.15.1-43.uel20.x86_64                                                 12/15 
  Cleanup          : python3-rpm-4.15.1-36.uel20.x86_64                                                 13/15 
  Cleanup          : rpm-4.15.1-36.uel20.x86_64                                                         14/15 
  Running scriptlet: rpm-4.15.1-36.uel20.x86_64                                                         14/15 
  Cleanup          : rpm-libs-4.15.1-36.uel20.x86_64                                                    15/15 
  Running scriptlet: rpm-libs-4.15.1-36.uel20.x86_64                                                    15/15 
  Verifying        : autoconf-2.69-30.uel20.noarch                                                       1/15 
  Verifying        : automake-1.16.2-2.uel20.03.noarch                                                   2/15 
  Verifying        : chrpath-0.16-12.uel20.x86_64                                                        3/15 
  Verifying        : elfutils-0.180-3.uel20.x86_64                                                       4/15 
  Verifying        : git-2.27.0-12.uel20.x86_64                                                          5/15 
  Verifying        : perl-Error-1:0.17028-1.uel20.noarch                                                 6/15 
  Verifying        : perl-Git-2.27.0-12.uel20.noarch                                                     7/15 
  Verifying        : perl-TermReadKey-2.38-2.uel20.x86_64                                                8/15 
  Verifying        : rpm-build-4.15.1-43.uel20.x86_64                                                    9/15 
  Verifying        : python3-rpm-4.15.1-43.uel20.x86_64                                                 10/15 
  Verifying        : python3-rpm-4.15.1-36.uel20.x86_64                                                 11/15 
  Verifying        : rpm-4.15.1-43.uel20.x86_64                                                         12/15 
  Verifying        : rpm-4.15.1-36.uel20.x86_64                                                         13/15 
  Verifying        : rpm-libs-4.15.1-43.uel20.x86_64                                                    14/15 
  Verifying        : rpm-libs-4.15.1-36.uel20.x86_64                                                    15/15 

Upgraded:
  python3-rpm-4.15.1-43.uel20.x86_64      rpm-4.15.1-43.uel20.x86_64      rpm-libs-4.15.1-43.uel20.x86_64     

Installed:
  autoconf-2.69-30.uel20.noarch    automake-1.16.2-2.uel20.03.noarch     chrpath-0.16-12.uel20.x86_64        
  elfutils-0.180-3.uel20.x86_64    git-2.27.0-12.uel20.x86_64            perl-Error-1:0.17028-1.uel20.noarch 
  perl-Git-2.27.0-12.uel20.noarch  perl-TermReadKey-2.38-2.uel20.x86_64  rpm-build-4.15.1-43.uel20.x86_64    

Complete!
[root@localhost ~]# 

img

3、安装源码rpm包

[root@localhost ~]# ll
总用量 284K
-rw------- 1 root root 1.4K  75 10:03 anaconda-ks.cfg
-rw-r--r-- 1 root root 275K  75 10:14 atop-2.7.1-1.el8.src.rpm
drwxr-xr-x 2 root root   59  75 10:08 Desktop
drwxr-xr-x 2 root root    6  75 09:54 Documents
drwxr-xr-x 2 root root    6  75 09:54 Downloads
-rw------- 1 root root 1.8K  75 10:07 initial-setup-ks.cfg
drwxr-xr-x 2 root root   32  75 09:54 Music
drwxr-xr-x 3 root root   24  75 09:54 Pictures
drwxr-xr-x 2 root root    6  75 09:54 Videos
[root@localhost ~]# rpm -ivh atop-2.7.1-1.el8.src.rpm 
警告:atop-2.7.1-1.el8.src.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 2f86d6a1: NOKEY
正在升级/安装...
   1:atop-2.7.1-1.el8                 警告:user mockbuild does not exist - using root
警告:group mock does not exist - using root
警告:user mockbuild does not exist - using root
警告:group mock does not exist - using root
警告:user mockbuild does not exist - using root
警告:group mock does not exist - using root
警告:user mockbuild does not exist - using root
警告:group mock does not exist - using root
警告:user mockbuild does not exist - using root
警告:group mock does not exist - using root
警告:user mockbuild does not exist - using root
警告:group mock does not exist - using root
################################# [100%]

img

4、进入cd rpmbuild/SPECS/安装编译时需要的依赖包

[root@localhost ~]# ll
总用量 284K
-rw------- 1 root root 1.4K  75 10:03 anaconda-ks.cfg
-rw-r--r-- 1 root root 275K  75 10:14 atop-2.7.1-1.el8.src.rpm
drwxr-xr-x 2 root root   59  75 10:08 Desktop
drwxr-xr-x 2 root root    6  75 09:54 Documents
drwxr-xr-x 2 root root    6  75 09:54 Downloads
-rw------- 1 root root 1.8K  75 10:07 initial-setup-ks.cfg
drwxr-xr-x 2 root root   32  75 09:54 Music
drwxr-xr-x 3 root root   24  75 09:54 Pictures
drwxr-xr-x 4 root root   34  75 10:15 rpmbuild
drwxr-xr-x 2 root root    6  75 09:54 Videos
[root@localhost ~]# cd rpmbuild/SPECS/
[root@localhost SPECS]# ll
总用量 12K
-rw-r--r-- 1 root root 12K  112  2022 atop.spec
[root@localhost SPECS]# yum-builddep atop.spec 
Last metadata expiration check: 0:00:08 ago on 2023年07月05日 星期三 10时17分07秒.
Package gcc-7.3.0-20211123.43.uel20.x86_64 is already installed.
Package make-1:4.3-1.uel20.x86_64 is already installed.
Package systemd-243-50.up7.uel20.x86_64 is already installed.
Package zlib-devel-1.2.11-18.uel20.x86_64 is already installed.
Dependencies resolved.
==============================================================================================================
 Package             Arch       Version                            Repository                            Size
==============================================================================================================
Installing:
 ncurses-devel       x86_64     6.2-3.uel20.02                     UnionTechOS-Server-20-everything     642 k
Upgrading:
 cpp                 x86_64     7.3.0-2020033101.50.up1.uel20      UnionTechOS-Server-20-everything     8.1 M
 gcc                 x86_64     7.3.0-2020033101.50.up1.uel20      UnionTechOS-Server-20-everything      13 M
 gcc-c++             x86_64     7.3.0-2020033101.50.up1.uel20      UnionTechOS-Server-20-everything     8.8 M
 libgomp             x86_64     7.3.0-2020033101.50.up1.uel20      UnionTechOS-Server-20-everything     130 k
 libstdc++           x86_64     7.3.0-2020033101.50.up1.uel20      UnionTechOS-Server-20-everything     402 k
 libstdc++-devel     x86_64     7.3.0-2020033101.50.up1.uel20      UnionTechOS-Server-20-everything     1.1 M
 make                x86_64     1:4.3-2.uel20                      UnionTechOS-Server-20-everything     324 k
 minizip             x86_64     1.2.11-21.uel20.03                 UnionTechOS-Server-20-everything      28 k
 ncurses             x86_64     6.2-3.uel20.02                     UnionTechOS-Server-20-everything     921 k
 ncurses-base        noarch     6.2-3.uel20.02                     UnionTechOS-Server-20-everything      52 k
 ncurses-libs        x86_64     6.2-3.uel20.02                     UnionTechOS-Server-20-everything     282 k
 systemd             x86_64     243-59.up8.uel20                   UnionTechOS-Server-20-everything     3.2 M
 systemd-devel       x86_64     243-59.up8.uel20                   UnionTechOS-Server-20-everything     340 k
 systemd-libs        x86_64     243-59.up8.uel20                   UnionTechOS-Server-20-everything     417 k
 systemd-udev        x86_64     243-59.up8.uel20                   UnionTechOS-Server-20-everything     1.2 M
 zlib                x86_64     1.2.11-21.uel20.03                 UnionTechOS-Server-20-everything      87 k
 zlib-devel          x86_64     1.2.11-21.uel20.03                 UnionTechOS-Server-20-everything      91 k

Transaction Summary
==============================================================================================================
Install   1 Package
Upgrade  17 Packages

Total download size: 39 M
Is this ok [y/N]: y
Downloading Packages:
(1/18): ncurses-devel-6.2-3.uel20.02.x86_64.rpm                               881 kB/s | 642 kB     00:00    
(2/18): gcc-c++-7.3.0-2020033101.50.up1.uel20.x86_64.rpm                      499 kB/s | 8.8 MB     00:18    
(3/18): libgomp-7.3.0-2020033101.50.up1.uel20.x86_64.rpm                      532 kB/s | 130 kB     00:00    
(4/18): libstdc++-7.3.0-2020033101.50.up1.uel20.x86_64.rpm                    560 kB/s | 402 kB     00:00    
(5/18): cpp-7.3.0-2020033101.50.up1.uel20.x86_64.rpm                          403 kB/s | 8.1 MB     00:20    
(6/18): libstdc++-devel-7.3.0-2020033101.50.up1.uel20.x86_64.rpm              424 kB/s | 1.1 MB     00:02    
(7/18): make-4.3-2.uel20.x86_64.rpm                                           180 kB/s | 324 kB     00:01    
(8/18): minizip-1.2.11-21.uel20.03.x86_64.rpm                                 149 kB/s |  28 kB     00:00    
(9/18): ncurses-base-6.2-3.uel20.02.noarch.rpm                                 60 kB/s |  52 kB     00:00    
(10/18): ncurses-6.2-3.uel20.02.x86_64.rpm                                    416 kB/s | 921 kB     00:02    
(11/18): ncurses-libs-6.2-3.uel20.02.x86_64.rpm                               213 kB/s | 282 kB     00:01    
(12/18): systemd-devel-243-59.up8.uel20.x86_64.rpm                            176 kB/s | 340 kB     00:01    
(13/18): gcc-7.3.0-2020033101.50.up1.uel20.x86_64.rpm                         476 kB/s |  13 MB     00:28    
(14/18): systemd-libs-243-59.up8.uel20.x86_64.rpm                             256 kB/s | 417 kB     00:01    
(15/18): zlib-1.2.11-21.uel20.03.x86_64.rpm                                    86 kB/s |  87 kB     00:01    
(16/18): zlib-devel-1.2.11-21.uel20.03.x86_64.rpm                              93 kB/s |  91 kB     00:00    
(17/18): systemd-udev-243-59.up8.uel20.x86_64.rpm                             291 kB/s | 1.2 MB     00:04    
(18/18): systemd-243-59.up8.uel20.x86_64.rpm                                  372 kB/s | 3.2 MB     00:08    
--------------------------------------------------------------------------------------------------------------
Total                                                                         1.2 MB/s |  39 MB     00:33     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                      1/1 
  Running scriptlet: zlib-1.2.11-21.uel20.03.x86_64                                                       1/1 
  Upgrading        : zlib-1.2.11-21.uel20.03.x86_64                                                      1/35 
  Upgrading        : libstdc++-7.3.0-2020033101.50.up1.uel20.x86_64                                      2/35 
  Running scriptlet: libstdc++-7.3.0-2020033101.50.up1.uel20.x86_64                                      2/35 
  Upgrading        : systemd-libs-243-59.up8.uel20.x86_64                                                3/35 
  Running scriptlet: systemd-libs-243-59.up8.uel20.x86_64                                                3/35 
  Running scriptlet: systemd-243-59.up8.uel20.x86_64                                                     4/35 
  Upgrading        : systemd-243-59.up8.uel20.x86_64                                                     4/35 
  Running scriptlet: systemd-243-59.up8.uel20.x86_64                                                     4/35 
  Upgrading        : ncurses-base-6.2-3.uel20.02.noarch                                                  5/35 
  Upgrading        : ncurses-libs-6.2-3.uel20.02.x86_64                                                  6/35 
  Upgrading        : ncurses-6.2-3.uel20.02.x86_64                                                       7/35 
  Upgrading        : cpp-7.3.0-2020033101.50.up1.uel20.x86_64                                            8/35 
  Running scriptlet: cpp-7.3.0-2020033101.50.up1.uel20.x86_64                                            8/35 
  Upgrading        : libstdc++-devel-7.3.0-2020033101.50.up1.uel20.x86_64                                9/35 
  Upgrading        : libgomp-7.3.0-2020033101.50.up1.uel20.x86_64                                       10/35 
  Running scriptlet: libgomp-7.3.0-2020033101.50.up1.uel20.x86_64                                       10/35 
  Upgrading        : gcc-7.3.0-2020033101.50.up1.uel20.x86_64                                           11/35 
  Running scriptlet: gcc-7.3.0-2020033101.50.up1.uel20.x86_64                                           11/35 
  Upgrading        : gcc-c++-7.3.0-2020033101.50.up1.uel20.x86_64                                       12/35 
  Installing       : ncurses-devel-6.2-3.uel20.02.x86_64                                                13/35 
  Upgrading        : systemd-devel-243-59.up8.uel20.x86_64                                              14/35 
  Running scriptlet: systemd-udev-243-59.up8.uel20.x86_64                                               15/35 
  Upgrading        : systemd-udev-243-59.up8.uel20.x86_64                                               15/35 
  Running scriptlet: systemd-udev-243-59.up8.uel20.x86_64                                               15/35 
  Upgrading        : minizip-1.2.11-21.uel20.03.x86_64                                                  16/35 
  Upgrading        : zlib-devel-1.2.11-21.uel20.03.x86_64                                               17/35 
  Upgrading        : make-1:4.3-2.uel20.x86_64                                                          18/35 
  Running scriptlet: make-1:4.3-2.uel20.x86_64                                                          18/35 
  Cleanup          : ncurses-6.2-2.uel20.x86_64                                                         19/35 
  Cleanup          : gcc-c++-7.3.0-20211123.43.uel20.x86_64                                             20/35 
  Cleanup          : systemd-devel-243-50.up7.uel20.x86_64                                              21/35 
  Running scriptlet: gcc-7.3.0-20211123.43.uel20.x86_64                                                 22/35 
  Cleanup          : gcc-7.3.0-20211123.43.uel20.x86_64                                                 22/35 
  Running scriptlet: cpp-7.3.0-20211123.43.uel20.x86_64                                                 23/35 
  Cleanup          : cpp-7.3.0-20211123.43.uel20.x86_64                                                 23/35 
  Running scriptlet: systemd-udev-243-50.up7.uel20.x86_64                                               24/35 
  Cleanup          : systemd-udev-243-50.up7.uel20.x86_64                                               24/35 
  Running scriptlet: systemd-udev-243-50.up7.uel20.x86_64                                               24/35 
  Running scriptlet: systemd-243-50.up7.uel20.x86_64                                                    25/35 
  Cleanup          : systemd-243-50.up7.uel20.x86_64                                                    25/35 
  Cleanup          : minizip-1.2.11-18.uel20.x86_64                                                     26/35 
  Cleanup          : libstdc++-devel-7.3.0-20211123.43.uel20.x86_64                                     27/35 
  Cleanup          : zlib-devel-1.2.11-18.uel20.x86_64                                                  28/35 
  Cleanup          : ncurses-libs-6.2-2.uel20.x86_64                                                    29/35 
  Cleanup          : ncurses-base-6.2-2.uel20.noarch                                                    30/35 
  Cleanup          : zlib-1.2.11-18.uel20.x86_64                                                        31/35 
  Cleanup          : libstdc++-7.3.0-20211123.43.uel20.x86_64                                           32/35 
  Running scriptlet: libstdc++-7.3.0-20211123.43.uel20.x86_64                                           32/35 
  Cleanup          : systemd-libs-243-50.up7.uel20.x86_64                                               33/35 
  Running scriptlet: libgomp-7.3.0-20211123.43.uel20.x86_64                                             34/35 
  Cleanup          : libgomp-7.3.0-20211123.43.uel20.x86_64                                             34/35 
  Running scriptlet: libgomp-7.3.0-20211123.43.uel20.x86_64                                             34/35 
  Running scriptlet: make-1:4.3-1.uel20.x86_64                                                          35/35 
  Cleanup          : make-1:4.3-1.uel20.x86_64                                                          35/35 
  Running scriptlet: make-1:4.3-1.uel20.x86_64                                                          35/35 
  Running scriptlet: systemd-243-59.up8.uel20.x86_64                                                    35/35 
  Running scriptlet: systemd-udev-243-59.up8.uel20.x86_64                                               35/35 
  Verifying        : ncurses-devel-6.2-3.uel20.02.x86_64                                                 1/35 
  Verifying        : cpp-7.3.0-2020033101.50.up1.uel20.x86_64                                            2/35 
  Verifying        : cpp-7.3.0-20211123.43.uel20.x86_64                                                  3/35 
  Verifying        : gcc-7.3.0-2020033101.50.up1.uel20.x86_64                                            4/35 
  Verifying        : gcc-7.3.0-20211123.43.uel20.x86_64                                                  5/35 
  Verifying        : gcc-c++-7.3.0-2020033101.50.up1.uel20.x86_64                                        6/35 
  Verifying        : gcc-c++-7.3.0-20211123.43.uel20.x86_64                                              7/35 
  Verifying        : libgomp-7.3.0-2020033101.50.up1.uel20.x86_64                                        8/35 
  Verifying        : libgomp-7.3.0-20211123.43.uel20.x86_64                                              9/35 
  Verifying        : libstdc++-7.3.0-2020033101.50.up1.uel20.x86_64                                     10/35 
  Verifying        : libstdc++-7.3.0-20211123.43.uel20.x86_64                                           11/35 
  Verifying        : libstdc++-devel-7.3.0-2020033101.50.up1.uel20.x86_64                               12/35 
  Verifying        : libstdc++-devel-7.3.0-20211123.43.uel20.x86_64                                     13/35 
  Verifying        : make-1:4.3-2.uel20.x86_64                                                          14/35 
  Verifying        : make-1:4.3-1.uel20.x86_64                                                          15/35 
  Verifying        : minizip-1.2.11-21.uel20.03.x86_64                                                  16/35 
  Verifying        : minizip-1.2.11-18.uel20.x86_64                                                     17/35 
  Verifying        : ncurses-6.2-3.uel20.02.x86_64                                                      18/35 
  Verifying        : ncurses-6.2-2.uel20.x86_64                                                         19/35 
  Verifying        : ncurses-base-6.2-3.uel20.02.noarch                                                 20/35 
  Verifying        : ncurses-base-6.2-2.uel20.noarch                                                    21/35 
  Verifying        : ncurses-libs-6.2-3.uel20.02.x86_64                                                 22/35 
  Verifying        : ncurses-libs-6.2-2.uel20.x86_64                                                    23/35 
  Verifying        : systemd-243-59.up8.uel20.x86_64                                                    24/35 
  Verifying        : systemd-243-50.up7.uel20.x86_64                                                    25/35 
  Verifying        : systemd-devel-243-59.up8.uel20.x86_64                                              26/35 
  Verifying        : systemd-devel-243-50.up7.uel20.x86_64                                              27/35 
  Verifying        : systemd-libs-243-59.up8.uel20.x86_64                                               28/35 
  Verifying        : systemd-libs-243-50.up7.uel20.x86_64                                               29/35 
  Verifying        : systemd-udev-243-59.up8.uel20.x86_64                                               30/35 
  Verifying        : systemd-udev-243-50.up7.uel20.x86_64                                               31/35 
  Verifying        : zlib-1.2.11-21.uel20.03.x86_64                                                     32/35 
  Verifying        : zlib-1.2.11-18.uel20.x86_64                                                        33/35 
  Verifying        : zlib-devel-1.2.11-21.uel20.03.x86_64                                               34/35 
  Verifying        : zlib-devel-1.2.11-18.uel20.x86_64                                                  35/35 

Upgraded:
  cpp-7.3.0-2020033101.50.up1.uel20.x86_64           gcc-7.3.0-2020033101.50.up1.uel20.x86_64                
  gcc-c++-7.3.0-2020033101.50.up1.uel20.x86_64       libgomp-7.3.0-2020033101.50.up1.uel20.x86_64            
  libstdc++-7.3.0-2020033101.50.up1.uel20.x86_64     libstdc++-devel-7.3.0-2020033101.50.up1.uel20.x86_64    
  make-1:4.3-2.uel20.x86_64                          minizip-1.2.11-21.uel20.03.x86_64                       
  ncurses-6.2-3.uel20.02.x86_64                      ncurses-base-6.2-3.uel20.02.noarch                      
  ncurses-libs-6.2-3.uel20.02.x86_64                 systemd-243-59.up8.uel20.x86_64                         
  systemd-devel-243-59.up8.uel20.x86_64              systemd-libs-243-59.up8.uel20.x86_64                    
  systemd-udev-243-59.up8.uel20.x86_64               zlib-1.2.11-21.uel20.03.x86_64                          
  zlib-devel-1.2.11-21.uel20.03.x86_64              

Installed:
  ncurses-devel-6.2-3.uel20.02.x86_64                                                                         

Complete!
[root@localhost SPECS]#

img

5、编译atop

[root@localhost SPECS]# rpmbuild -ba atop.spec 
正在执行(%prep):/bin/sh -e /var/tmp/rpm-tmp.fsMjmJ
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd /root/rpmbuild/BUILD
+ rm -rf atop-2.7.1
+ /usr/bin/gzip -dc /root/rpmbuild/SOURCES/atop-2.7.1.tar.gz
+ /usr/bin/tar -xof -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd atop-2.7.1
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ echo 'Patch #0 (nvme_support.patch):'
Patch #0 (nvme_support.patch):
+ /usr/bin/patch --no-backup-if-mismatch -p0 -b --suffix .nvme --fuzz=0
patching file ./photosyst.c
Hunk #1 succeeded at 1972 (offset 435 lines).
+ echo 'Patch #1 (atop-sysconfig.patch):'
Patch #1 (atop-sysconfig.patch):
+ /usr/bin/patch --no-backup-if-mismatch -p0 -b --suffix .sysconfig --fuzz=0
patching file atop.daily
Hunk #1 succeeded at 8 (offset 1 line).
+ echo 'Patch #2 (atop-2.3.0-newer-gcc.patch):'
Patch #2 (atop-2.3.0-newer-gcc.patch):
+ /usr/bin/patch --no-backup-if-mismatch -p1 -b --suffix .newer-gcc --fuzz=0
patching file photosyst.c
Hunk #1 succeeded at 69 (offset -115 lines).
Hunk #2 succeeded at 1897 (offset 415 lines).
+ sed -i 's|/etc/default/atop|/etc/sysconfig/atop|g' atop.service
+ RPM_EC=0
++ jobs -p
+ exit 0
正在执行(%build):/bin/sh -e /var/tmp/rpm-tmp.sVlFrZ
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd atop-2.7.1
+ make -j4 'CFLAGS=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/UnionTech/UnionTech-hardened-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection '
cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/UnionTech/UnionTech-hardened-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection    -c -o atop.o atop.c
cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/UnionTech/UnionTech-hardened-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection    -c -o version.o version.c
cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/UnionTech/UnionTech-hardened-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection    -c -o various.o various.c
cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/UnionTech/UnionTech-hardened-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection    -c -o deviate.o deviate.c
cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/UnionTech/UnionTech-hardened-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection    -c -o procdbase.o procdbase.c
cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/UnionTech/UnionTech-hardened-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection    -c -o acctproc.o acctproc.c
cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/UnionTech/UnionTech-hardened-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection    -c -o photoproc.o photoproc.c
cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/UnionTech/UnionTech-hardened-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection    -c -o photosyst.o photosyst.c
cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/UnionTech/UnionTech-hardened-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection    -c -o rawlog.o rawlog.c
cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/UnionTech/UnionTech-hardened-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection    -c -o ifprop.o ifprop.c
cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/UnionTech/UnionTech-hardened-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection    -c -o parseable.o parseable.c
photosyst.c: In function 'photosyst':
photosyst.c:82:17: warning: '%s' directive output may be truncated writing up to 255 bytes into a region of size 231 [-Wformat-truncation=]
 #define NUMADIR "/sys/devices/system/node"
                 ^
photosyst.c:866:28: note: in expansion of macro 'NUMADIR'
    snprintf(fn, sizeof fn, NUMADIR "/%s/meminfo", dentry->d_name);
                            ^~~~~~~
photosyst.c:992:38: note: format string is defined here
    snprintf(fn, sizeof fn, NUMADIR "/node%d/cpumap", j);
                                      ^~
In file included from /usr/include/stdio.h:873:0,
                 from photosyst.c:33:
/usr/include/bits/stdio2.h:67:10: note: '__builtin___snprintf_chk' output between 34 and 289 bytes into a destination of size 256
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/UnionTech/UnionTech-hardened-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection    -c -o showgeneric.o showgeneric.c
showgeneric.c: In function 'generic_init':
showgeneric.c:2828:4: warning: ignoring return value of 'dup', declared with attribute warn_unused_result [-Wunused-result]
    (void) dup(1);
    ^~~~~~~~~~~~~
cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/UnionTech/UnionTech-hardened-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection    -c -o showlinux.o showlinux.c
cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/UnionTech/UnionTech-hardened-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection    -c -o showsys.o showsys.c
cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/UnionTech/UnionTech-hardened-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection    -c -o showprocs.o showprocs.c
cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/UnionTech/UnionTech-hardened-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection    -c -o atopsar.o atopsar.c
cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/UnionTech/UnionTech-hardened-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection    -c -o netatopif.o netatopif.c
cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/UnionTech/UnionTech-hardened-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection    -c -o gpucom.o gpucom.c
cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/UnionTech/UnionTech-hardened-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection    -c -o atopacctd.o atopacctd.c
cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/UnionTech/UnionTech-hardened-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection    -c -o netlink.o netlink.c
cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/UnionTech/UnionTech-hardened-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection    -c -o atopconvert.o atopconvert.c
cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/UnionTech/UnionTech-hardened-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection    -c -o atopcat.o atopcat.c
cc atopacctd.o netlink.o -o atopacctd 
cc atopcat.o -o atopcat 
cc atop.o version.o various.o  deviate.o   procdbase.o acctproc.o photoproc.o photosyst.o  rawlog.o ifprop.o parseable.o showgeneric.o          showlinux.o  showsys.o showprocs.o atopsar.o  netatopif.o gpucom.o -o atop -lncursesw -lz -lm -lrt 
cc atopconvert.o -o atopconvert -lz 
ln -sf atop atopsar
+ RPM_EC=0
++ jobs -p
+ exit 0
正在执行(%install):/bin/sh -e /var/tmp/rpm-tmp.vFlRUk
+ umask 022
+ cd /root/rpmbuild/BUILD
+ '[' /root/rpmbuild/BUILDROOT/atop-2.7.1-1.x86_64 '!=' / ']'
+ rm -rf /root/rpmbuild/BUILDROOT/atop-2.7.1-1.x86_64
++ dirname /root/rpmbuild/BUILDROOT/atop-2.7.1-1.x86_64
+ mkdir -p /root/rpmbuild/BUILDROOT
+ mkdir /root/rpmbuild/BUILDROOT/atop-2.7.1-1.x86_64
+ cd atop-2.7.1
+ install -Dp -m 0755 atop /root/rpmbuild/BUILDROOT/atop-2.7.1-1.x86_64/usr/bin/atop
+ install -Dp -m 0755 atopconvert /root/rpmbuild/BUILDROOT/atop-2.7.1-1.x86_64/usr/bin/atopconvert
+ ln -s atop /root/rpmbuild/BUILDROOT/atop-2.7.1-1.x86_64/usr/bin/atopsar
+ install -Dp -m 0644 man/atop.1 /root/rpmbuild/BUILDROOT/atop-2.7.1-1.x86_64/usr/share/man/man1/atop.1
+ install -Dp -m 0644 man/atopsar.1 /root/rpmbuild/BUILDROOT/atop-2.7.1-1.x86_64/usr/share/man/man1/atopsar.1
+ install -Dp -m 0755 atop.daily /root/rpmbuild/BUILDROOT/atop-2.7.1-1.x86_64/usr/share/atop/atop.daily
+ install -Dp -m 0644 atop.default /root/rpmbuild/BUILDROOT/atop-2.7.1-1.x86_64/etc/sysconfig/atop
+ install -Dp -m 0755 /root/rpmbuild/SOURCES/atop.d /root/rpmbuild/BUILDROOT/atop-2.7.1-1.x86_64/usr/bin/atopd
+ install -Dp -m 0644 atop.service /root/rpmbuild/BUILDROOT/atop-2.7.1-1.x86_64/usr/lib/systemd/system/atop.service
+ install -d /root/rpmbuild/BUILDROOT/atop-2.7.1-1.x86_64/var/log/atop
+ install -Dp -m 0755 atopacctd /root/rpmbuild/BUILDROOT/atop-2.7.1-1.x86_64/usr/sbin/atopacctd
+ install -Dp -m 0644 atopacct.service /root/rpmbuild/BUILDROOT/atop-2.7.1-1.x86_64/usr/lib/systemd/system/atopacct.service
+ install -Dp -m 0644 atop-rotate.service atop-rotate.timer /root/rpmbuild/BUILDROOT/atop-2.7.1-1.x86_64/usr/lib/systemd/system/
+ /usr/lib/rpm/find-debuginfo.sh -j4 --strict-build-id -i --build-id-seed 2.7.1-1 --unique-debug-suffix -2.7.1-1.x86_64 --unique-debug-src-base atop-2.7.1-1.x86_64 -S debugsourcefiles.list /root/rpmbuild/BUILD/atop-2.7.1
explicitly decompress any DWARF compressed ELF sections in /root/rpmbuild/BUILDROOT/atop-2.7.1-1.x86_64/usr/sbin/atopacctd
explicitly decompress any DWARF compressed ELF sections in /root/rpmbuild/BUILDROOT/atop-2.7.1-1.x86_64/usr/bin/atopconvert
explicitly decompress any DWARF compressed ELF sections in /root/rpmbuild/BUILDROOT/atop-2.7.1-1.x86_64/usr/bin/atop
extracting debug info from /root/rpmbuild/BUILDROOT/atop-2.7.1-1.x86_64/usr/bin/atop
extracting debug info from /root/rpmbuild/BUILDROOT/atop-2.7.1-1.x86_64/usr/sbin/atopacctd
extracting debug info from /root/rpmbuild/BUILDROOT/atop-2.7.1-1.x86_64/usr/bin/atopconvert
1842 blocks
+ /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/UnionTech/brp-ldconfig
/sbin/ldconfig: Warning: ignoring configuration file that cannot be opened: /etc/ld.so.conf: No such file or directory
+ /usr/lib/rpm/brp-compress
+ /usr/lib/rpm/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/brp-python-bytecompile /usr/bin/python 1 1
+ /usr/lib/rpm/brp-python-hardlink
处理文件:atop-2.7.1-1.x86_64
正在执行(%doc):/bin/sh -e /var/tmp/rpm-tmp.t7dBnH
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd atop-2.7.1
+ DOCDIR=/root/rpmbuild/BUILDROOT/atop-2.7.1-1.x86_64/usr/share/doc/atop
+ export LC_ALL=C
+ LC_ALL=C
+ export DOCDIR
+ /usr/bin/mkdir -p /root/rpmbuild/BUILDROOT/atop-2.7.1-1.x86_64/usr/share/doc/atop
+ cp -pr AUTHOR /root/rpmbuild/BUILDROOT/atop-2.7.1-1.x86_64/usr/share/doc/atop
+ cp -pr README /root/rpmbuild/BUILDROOT/atop-2.7.1-1.x86_64/usr/share/doc/atop
+ RPM_EC=0
++ jobs -p
+ exit 0
正在执行(%license):/bin/sh -e /var/tmp/rpm-tmp.ShYRR3
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd atop-2.7.1
+ LICENSEDIR=/root/rpmbuild/BUILDROOT/atop-2.7.1-1.x86_64/usr/share/licenses/atop
+ export LC_ALL=C
+ LC_ALL=C
+ export LICENSEDIR
+ /usr/bin/mkdir -p /root/rpmbuild/BUILDROOT/atop-2.7.1-1.x86_64/usr/share/licenses/atop
+ cp -pr COPYING /root/rpmbuild/BUILDROOT/atop-2.7.1-1.x86_64/usr/share/licenses/atop
+ RPM_EC=0
++ jobs -p
+ exit 0
Provides: atop = 2.7.1-1 atop(x86-64) = 2.7.1-1 config(atop) = 2.7.1-1
Requires(interp): /bin/sh /bin/sh /bin/sh
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires(post): /bin/sh systemd
Requires(preun): /bin/sh systemd
Requires(postun): /bin/sh systemd
Requires: /bin/bash /bin/sh libc.so.6()(64bit) libc.so.6(GLIBC_2.14)(64bit) libc.so.6(GLIBC_2.2.5)(64bit) libc.so.6(GLIBC_2.28)(64bit) libc.so.6(GLIBC_2.3)(64bit) libc.so.6(GLIBC_2.3.4)(64bit) libc.so.6(GLIBC_2.4)(64bit) libc.so.6(GLIBC_2.7)(64bit) libm.so.6()(64bit) libm.so.6(GLIBC_2.2.5)(64bit) libncursesw.so.6()(64bit) librt.so.1()(64bit) librt.so.1(GLIBC_2.2.5)(64bit) libtinfo.so.6()(64bit) libz.so.1()(64bit) rtld(GNU_HASH)
处理文件:atop-debuginfo-2.7.1-1.x86_64
Provides: atop-debuginfo = 2.7.1-1 atop-debuginfo(x86-64) = 2.7.1-1
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Recommends: atop-debugsource(x86-64) = 2.7.1-1
处理文件:atop-debugsource-2.7.1-1.x86_64
Provides: atop-debugsource = 2.7.1-1 atop-debugsource(x86-64) = 2.7.1-1
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
检查未打包文件:/usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/atop-2.7.1-1.x86_64
已写至:/root/rpmbuild/SRPMS/atop-2.7.1-1.src.rpm
已写至:/root/rpmbuild/RPMS/x86_64/atop-2.7.1-1.x86_64.rpm
已写至:/root/rpmbuild/RPMS/x86_64/atop-debugsource-2.7.1-1.x86_64.rpm
已写至:/root/rpmbuild/RPMS/x86_64/atop-debuginfo-2.7.1-1.x86_64.rpm
正在执行(%clean):/bin/sh -e /var/tmp/rpm-tmp.ud9Emr
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd atop-2.7.1
+ /usr/bin/rm -rf /root/rpmbuild/BUILDROOT/atop-2.7.1-1.x86_64
+ RPM_EC=0
++ jobs -p
+ exit 0
[root@localhost SPECS]# 

img

6、进入/root/rpmbuild/RPMS/x86_64安装atop

[root@localhost SPECS]# cd ../RPMS/x86_64/
[root@localhost x86_64]# pwd
/root/rpmbuild/RPMS/x86_64
[root@localhost x86_64]# ll
总用量 620K
-rw-r--r-- 1 root root 165K  75 10:18 atop-2.7.1-1.x86_64.rpm
-rw-r--r-- 1 root root 286K  75 10:18 atop-debuginfo-2.7.1-1.x86_64.rpm
-rw-r--r-- 1 root root 163K  75 10:18 atop-debugsource-2.7.1-1.x86_64.rpm
[root@localhost x86_64]# rpm -ivh *.rpm
Verifying...                          ################################# [100%]
准备中...                          ################################# [100%]
正在升级/安装...
   1:atop-debugsource-2.7.1-1         ################################# [ 33%]
   2:atop-debuginfo-2.7.1-1           ################################# [ 67%]
   3:atop-2.7.1-1                     ################################# [100%]
[root@localhost x86_64]# 

img

7、运行atop

[root@localhost x86_64]# atop

img

img

三、修改标识

1、编辑/etc/rpm/macros.dist文件

[root@localhost SPECS]# pwd
/root/rpmbuild/SPECS
[root@localhost SPECS]# ll
总用量 12K
-rw-r--r-- 1 root root 12K  112  2022 atop.spec
[root@localhost SPECS]# vi /etc/rpm/macros.dist 
[root@localhost SPECS]# cat /etc/rpm/macros.dist 
# dist macros.

%dist .pdsyw
[root@localhost SPECS]#

img

2、编译atop

[root@localhost SPECS]# rpmbuild -ba atop.spec 
正在执行(%prep):/bin/sh -e /var/tmp/rpm-tmp.SrNTde
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd /root/rpmbuild/BUILD
+ rm -rf atop-2.7.1
+ /usr/bin/gzip -dc /root/rpmbuild/SOURCES/atop-2.7.1.tar.gz
+ /usr/bin/tar -xof -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd atop-2.7.1
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ echo 'Patch #0 (nvme_support.patch):'

img

3、进入/root/rpmbuild/RPMS/x86_64安装atop

[root@localhost SPECS]# cd ../RPMS/x86_64/
[root@localhost x86_64]# ll
总用量 620K
-rw-r--r-- 1 root root 165K  75 10:28 atop-2.7.1-1.pdsyw.x86_64.rpm
-rw-r--r-- 1 root root 286K  75 10:28 atop-debuginfo-2.7.1-1.pdsyw.x86_64.rpm
-rw-r--r-- 1 root root 164K  75 10:28 atop-debugsource-2.7.1-1.pdsyw.x86_64.rpm
[root@localhost x86_64]# rpm -Uvh atop-*
Verifying...                          ################################# [100%]
准备中...                          ################################# [100%]
正在升级/安装...
   1:atop-debugsource-2.7.1-1.pdsyw   ################################# [ 17%]
   2:atop-debuginfo-2.7.1-1.pdsyw     ################################# [ 33%]
   3:atop-2.7.1-1.pdsyw               ################################# [ 50%]
正在清理/删除...
   4:atop-debuginfo-2.7.1-1           ################################# [ 67%]
   5:atop-debugsource-2.7.1-1         ################################# [ 83%]
   6:atop-2.7.1-1                     ################################# [100%]
[root@localhost x86_64]# 

img

4、运行atop

[root@localhost x86_64]# atop

img

img

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

鹏大圣运维

编写不易,还请支持

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值