Installing coreutils on CentOS 5.7

As I had to work in a CentOS 5.7 VM recently, I wanted to take my entire development environment with me. Firstly, that meant setting up vim but it soon became clear that I needed to upgrade a few other packages too. dircolors was complaining that it didn’t support some of the flags I use. After a bit of googling, I realised I needed to upgrade coreutils.

For context, here’s the version currently installed:

$ ls --version
ls (GNU coreutils) 5.97

There’s a few prerequisites to install first:

$ sudo yum install gperf bison

Next, you’ll need a copy of coreutils. Annoyingly, CentOS 5.7 can’t extract the new tar.xz compression format so we’ll use the last available one with tar.gz format, coreutils-8.13.

$ wget && tar xzvf coreutils-8.13.tar.gz && cd coreutils-8.13

Once we’ve downloaded & extracted the files and changed into that directory, it’s time to configure the packages.

$ ./configure

If this completes successfully, make the binaries and install them.

$ make && sudo make install

Once this completes, log out and log back in again and check the version of ls.

$ ls --version
    ls (GNU coreutils) 8.13

All done. We’ve now got a relatively new version of coreutils installed.

March 06, 2013

How To