Install ack via Perl CPAN module

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.

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. Also, make sure you
are not fetching an out-of-date version. ack versions 2.00 -
2.10 have been removed from this site because they have a
security vulnerability.

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.

*BSD

Linux

(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-grep"

Renaming ack-grep on 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 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: