getfattr: command not found | Install getfattr command Linux

How to Install getfattr command on CentOS 7 / RHEL 7 Server

Follow the below steps to install getfattr command on your centos 7 / RHEL 7 server.

ERROR :

-bash: getfattr: command not found

FIX :

attr package might not the installed on the server and that is the reason why it shows the error “getfattr: command not found”

1. Log into your Linux Server as ‘root’ user

2. Run the below command to check whether ‘attr’ package is installed or not.
 

root@server [/]# rpm -qa | grep -i attr
root@server [/]#

 
‘attr’ package wasn’t installed on my Linux server.

3. Install attr package using yum command

command to install ‘attr’ :

# yum install attr

 

root@server [/]# yum install attr

Resolving Dependencies
–> Running transaction check
—> Package attr.x86_64 0:2.4.46-12.el7 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================================================================
Package Arch Version Repository Size
========================================================================================================================================================================
Installing:
attr x86_64 2.4.46-12.el7 base 66 k

Transaction Summary
========================================================================================================================================================================
Install 1 Package

Total download size: 66 k
Installed size: 169 k
Is this ok [y/d/N]: y
Downloading packages:
attr-2.4.46-12.el7.x86_64.rpm | 66 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : attr-2.4.46-12.el7.x86_64 1/1
Verifying : attr-2.4.46-12.el7.x86_64 1/1

Installed:
attr.x86_64 0:2.4.46-12.el7

Complete!
root@server [/]#

 
Attr package is now installed on your Linux Server and getfattr command should work fine.
 

root@server [/]# getfattr –version
getfattr 2.4.46

 

How to Download and install attr rpm on CentOS 7 / Redhat 7 server

1. You must log into your Linux server as ‘root’ user

2. You can download attr package from CentOS website using wget command

# wget http://mirror.centos.org/centos/7/os/x86_64/Packages/attr-2.4.46-13.el7.x86_64.rpm

3. Install the downloaded attr rpm file using yum command

# yum install attr-2.4.46-13.el7.x86_64.rpm

OR

4. You can also install using rpm command instead of using yum command

rpm -ivh attr-2.4.46-13.el7.x86_64.rpm

Make sure you have installed the below package dependencies before installing attr package

Dependencies required :

libattr
glibc