سؤال

I went through fair amount of google search to install ack-grep on CentOS but I didn't find anything help. I also looked for the source codes but couldn't find it neither. Does anyone know how to install it on the OS?

Thanks a lot.

هل كانت مفيدة؟

المحلول 2

if you don't have the root permission, you can do as follows:

$ curl https://beyondgrep.com/ack-2.22-single-file > ~/bin/ack && chmod 0755 !#:3

or you can change to root user:

$ sudo su
# curl https://beyondgrep.com/ack-2.22-single-file > /bin/ack && chmod 0755 !#:3

نصائح أخرى

Could be essentially the same as https://stackoverflow.com/a/23155007/35946 but on CentOS 6.7 the answer is:

# yum install epel-release
# yum install ack

You can get it from the EPEL software repository.

From the EPEL FAQ:

For EL5:

su -c 'rpm -Uvh http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm'
...
su -c 'yum install ack'

For EL6:

su -c 'rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm'
...
su -c 'yum install ack'

Go to Beyond Grep and look at the section titled

Install The ack executeable

curl http://beyondgrep.com/ack-2.14-single-file > ~/bin/ack && chmod 0755 !#:3

And replace ack.2.14 with the current version of ack.

You may need to create the directory mkdir ~/bin/ first. You may also need to modify ~/.bashrc to include this new path E.G.:

PATH=$PATH:$HOME/bin
Then reload ~/.bashrc
source ~/.bashrc

Test the installation by running ack:

rpm -qa | ack s

This should display any installed packages containing the letter s. (some linux distributions may use ack-grep as the command.

How did you try installing it? Are you using yum? The package is probably not called "ack-grep", but just "ack".

The name "ack-grep" is a Debian-specific thing because there was already a package called "ack", so they called it "ack-grep" instead. That was years ago and now they're dropping the original "ack" package and renaming "ack-grep" to "ack".

For RedHat Enterprise just do sudo yum install ack

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top