How to install ack

The current stable version of ack is v3.7.0, released 2023-02-25.

What's changed in ack? See the ack changelog.

Ack is highly portable, and will run on any machine running Perl 5.10.1 or higher.

Install ack via Perl CPAN module

If you use Perl regularly, you can install ack's module, App::Ack.

Installing via CPAN shell means that the shell can automatically tell you when ack has updates. The CPAN is also the primary distribution channel for ack. All packages below derive from here.

Install the ack executable

The single-file version of ack is a single Perl program, around 5,400 lines of plain text. It combines the ack program and all its Perl modules into a single text file you can download and install anywhere you can put a shell script. If you don't have sysadmin rights on your machine, or don't want to mess with setting up the CPAN system, this is the way to go.

# NOTE: This URL is https, not http as it was pre-2017.
curl https://beyondgrep.com/ack-v3.7.0 > ~/bin/ack && chmod 0755 ~/bin/ack

Is your curl install not working? Please check that your are using the https scheme, not http. This site switched to HTTPS in early 2017.

Install a package for your specific OS

ack has been repackaged for most Linux distributions and OS X. On older Debian-derived distributions, it is called "ack-grep" because "ack" was already a package for Kanji translation.

Please note that the maintainers of ack have nothing to do with these packages. If a given package is out of date or doesn't work, you'll need to work with the packagers, not the ack team.

macOS

Fink
Package "ack"
Homebrew
Formula "ack"
Macports
Port "perl/p5-app-ack"

Windows

Chocolatey
https://chocolatey.org/packages/ack
Scoop
App "ack"

*BSD

FreeBSD port
Port "textproc/ack"
OpenBSD port
Package "p5-ack"

Linux

Arch
Package "community/ack"
Centos
Package "ack" in EPEL repository
Debian
Package "ack"
Whereas, on Debian <= 9.x
Package "ack-grep"
(To rename the "ack-grep" program to its proper name "ack", see the section below on renaming ack-grep)
Fedora
Package "ack"
Gentoo
Package "sys-apps/ack"
NixOS
Package "perl-ack"
Sabayon
Package "sys-apps/ack"
Ubuntu
Package "ack"
Whereas, on Ubuntu <= 19.10
Package "ack-grep"

Renaming ack-grep on older Debian-derived distros

This section probably won't be necessary as latest releases of "ack-grep" package provide both "ack" and "ack-grep" commands. If for some reason the package you're using installs ack as ack-grep, here's what to do.

On older Debian-derived distros, ack is packaged as "ack-grep" because "ack" already existed. If you simply install via:

$ sudo apt-get install ack-grep

your ack will be called "ack-grep", which is 167% more characters to type per invocation. This is tragic for your poor fingers.

To create a local diversion, renaming ack-grep to ack, first install the ack-grep package as shown above. Then, run:

$ sudo dpkg-divert --local --divert /usr/bin/ack --rename --add /usr/bin/ack-grep

Is there another distro we should list? Let me know at andy@petdance.com.


ack 1.x and ack 2.x

On May 27, 2019, ack v3.0.0 was released. We urge all ack users to upgrade.

Although ack 1.x and 2.x are no longer being maintained, and there will be no new releases, you can still download the latest of each.

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

We still have the ack 2.28 manual and ack 1.96 manual.