Install ack-grep on CentOS
Asked Answered
K

6

15

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.

Keelung answered 4/2, 2014 at 19:12 Comment(0)
U
13

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
Unformed answered 24/2, 2014 at 1:54 Comment(2)
Be sure to always check beyondgrep.com/install for the latest/greatest version. The solution above is hardcoded to a specific version.Alyciaalyda
Latest ack is 2.18 and you can no longer use the "http" url, you must use https. Will edit accordingly.Philippopolis
P
14

Could be essentially the same as https://mcmap.net/q/759461/-install-ack-grep-on-centos but on CentOS 6.7 the answer is:

# yum install epel-release
# yum install ack
Priming answered 18/12, 2015 at 19:45 Comment(0)
U
13

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
Unformed answered 24/2, 2014 at 1:54 Comment(2)
Be sure to always check beyondgrep.com/install for the latest/greatest version. The solution above is hardcoded to a specific version.Alyciaalyda
Latest ack is 2.18 and you can no longer use the "http" url, you must use https. Will edit accordingly.Philippopolis
S
10

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'
Soni answered 18/4, 2014 at 13:18 Comment(1)
Sweet, just tried a yum install ack on CentOS 6 and it "just worked" woot.Basque
P
4

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.

Paucity answered 1/3, 2015 at 16:43 Comment(1)
Latest version is 2.18, and you have to use https. curl https://beyondgrep.com/ack-2.18-single-file > ~/bin/ack && chmod 0755 ~/bin/ackPhilippopolis
A
1

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".

Alyciaalyda answered 16/4, 2014 at 12:44 Comment(0)
D
1

For RedHat Enterprise just do sudo yum install ack

Doner answered 27/11, 2018 at 20:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.