How To Install psacct on CentOS 8

psacct is Utilities for monitoring process activities

Introduction

In this tutorial we learn how to install psacct on CentOS 8.

What is psacct

The psacct package contains several utilities for monitoring process activities, including ac, lastcomm, accton and sa. The ac command displays statistics about how long users have been logged on. The lastcomm command displays information about previous executed commands. The accton command turns process accounting on or off. The sa command summarizes information about previously executed commands.

We can use yum or dnf to install psacct on CentOS 8. In this tutorial we discuss both methods but you only need to choose one of method to install psacct.

Install psacct on CentOS 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install psacct using dnf by running the following command:

sudo dnf -y install psacct

Install psacct on CentOS 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install psacct using yum by running the following command:

sudo yum -y install psacct

How To Uninstall psacct on CentOS 8

To uninstall only the psacct package we can use the following command:

sudo dnf remove psacct

psacct Package Contents on CentOS 8

/etc/logrotate.d/psacct
/usr/bin/ac
/usr/bin/lastcomm
/usr/lib/.build-id
/usr/lib/.build-id/32
/usr/lib/.build-id/32/ade5389f1447f5d2f26ac48736e97ce0e77a12
/usr/lib/.build-id/34
/usr/lib/.build-id/34/af578e96e9a96b701f42695c3ebbb5676190f0
/usr/lib/.build-id/4d
/usr/lib/.build-id/4d/2f2361a222e63c45673a2217c67b4ede0fda8f
/usr/lib/.build-id/62
/usr/lib/.build-id/62/3580b6ab09f63a0da07fc9a9787196ff3638bb
/usr/lib/.build-id/90
/usr/lib/.build-id/90/6a1c22b7f3fa916f228ad6c70677e8c8ca8320
/usr/lib/.build-id/c2
/usr/lib/.build-id/c2/2b4314df0fc31cbae23ebd78d1db519a1289fd
/usr/lib/systemd/system/psacct.service
/usr/libexec/psacct/accton-create
/usr/sbin/accton
/usr/sbin/dump-acct
/usr/sbin/dump-utmp
/usr/sbin/sa
/usr/share/doc/psacct
/usr/share/doc/psacct/COPYING
/usr/share/doc/psacct/README
/usr/share/info/accounting.info.gz
/usr/share/man/man1/ac.1.gz
/usr/share/man/man1/lastcomm.1.gz
/usr/share/man/man8/accton.8.gz
/usr/share/man/man8/dump-acct.8.gz
/usr/share/man/man8/dump-utmp.8.gz
/usr/share/man/man8/sa.8.gz
/var/account
/var/account/pacct

References

Summary

In this tutorial we learn how to install psacct on CentOS 8 using yum and dnf.