How to install ack

The current stable version of ack is version 2.14, released September 3, 2014.

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

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

You may install ack with any of these methods.

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 4,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.

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

Install a package for your specific OS

ack has been repackaged for most Linux distributions and OS X. On 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.

Macports
Port "perl/p5-app-ack"
Homebrew on Mac
Formula "ack"
FreeBSD port
Port "textproc/p5-ack"
OpenBSD port
Package "p5-ack"
Debian
Package "ack-grep"
(To rename the "ack-grep" program to its proper name "ack", see the section below on renaming ack-grep)
Ubuntu
Package "ack-grep"
Fedora
Package "ack"
Gentoo
Package "sys-apps/ack"
Sabayon
Package "sys-apps/ack"
Arch
Package "community/ack"
Chocolatey for Windows
http://chocolatey.org/packages/ack

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

Renaming ack-grep on Debian-derived distros

On 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

ack 1.x

Ack has been around for years, but on April 17th, 2013 ack 2.0 was released. If you're still running ack 1.x, we urge you to upgrade to 2.0.

Although ack 1.x is no longer being maintained, and there will be no new releases, you can still download the ack 1.96 single-file distribution.

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

We still have the ack 1.96 manual.