13

I would like to install a more modern version of GNU utils (coreutils) on a debian linux system where I have no admin rights. Is there a way to do that?

The rationale is that I need a more modern version to the one installed in the system where I intend to run my analysis. I am trying to use "sort -R" or "shuf" to randomize lines in a big text file.

2
  • 1
    No way. Why do you want to do this?
    – Michael K
    Jul 1, 2011 at 12:14
  • 4
    The rationale is that I need a more modern version to the one installed in the system where I intend to run my analysis. I am trying to use "sort -R" or "shuf" to randomize lines in a big text file.
    – 719016
    Jul 1, 2011 at 12:19

1 Answer 1

16

You can't install them in the sense that they override the existing ones for all users of the system, but you can compile and install them in your home directory and configure your PATH such that they are ran instead of the system ones.

To do so, download the latest version of coreutils from the GNU web site. Then, extract the archive and cd into it, and run the following commands to compile and install it. Note the --prefix switch that lets you configure the directory you want it to install in.

./configure --prefix=/home/avilella/coreutils/
make
make install

Most Debian systems are configured to automatically add ~/bin to your PATH. If that's the case, you can copy the utilities to that directory. However, it may not be configured to run executables from that directory before searching system directories, or you may prefer to keep them in their own directory. In that case, you will need to edit your ~/.profile to search that directory before searching the system ones. To do so, add a line like this:

PATH="$HOME/coreutils/bin:$PATH"

If you'd prefer not to compile them, you could also extract them from a newer Debian package by using ar vx on the .deb file to output a data.tar.gz tarball with the package contents. But newer packages might require newer libraries not present on your system.

2
  • 3
    In PATH=..., double or no quotes must be used. Using single quotes will cause the literal $HOME and $PATH to be inserted, rather than their values. Jul 1, 2011 at 14:07
  • @grawity: Wow, what a dumb mistake, especially considering that I have been brain damaged by PHP's similar string handling for ages now. Thanks for the fix!
    – Patches
    Jul 1, 2011 at 21:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .