Installing coreutils on CentOS 5.7

This article was published 7 years ago. Due to the rapidly evolving world of technology, some concepts may no longer be applicable.

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.

Thoughts on this post

[email protected] 2013-11-07


How can i create the binaries and keep them in my ~/bin?
I am a simple user not an admin.

michael 2013-11-13

Edit ~/.bashrc and add the following line to the end:

export PATH=~/bin:$PATH

[email protected] 2013-11-13

I don’t have access to execute sudo commands at all.
So i cannot do “sudo yum install gperf bison”
or “make && sudo make install”

michael 2013-11-13

You could compile gperf and bison yourself and add them to your ~/bin, then use that to run `make`, then copy the built binaries into ~bin. That’s much more involved, though, so you’re on your own I’m afraid.

[email protected] 2013-11-13

Thanks for the help

raziersare 2019-01-29

Thanks, i was very useful your information. but add this parameter for install automatically in /usr/bin/timeout

./configure –prefix=/usr

[[email protected] ~]# whereis timeout
timeout: /usr/bin/timeout /usr/local/bin/timeout /usr/share/man/man1/timeout.1 /usr/share/man/man3/timeout.3x.gz

Leave a comment?