Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
1  
No way. Why do you want to do this? –  Michael K Jul 1 '11 at 12:14
2  
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. –  130490868091234 Jul 1 '11 at 12:19
add comment

1 Answer

up vote 11 down vote accepted

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, it might be possible to extract them from a newer Debian package by using dpkg --fsys-tarfile command to convert a .deb file to a tarball. But newer packages might require newer libraries not present on your system.

share|improve this answer
2  
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. –  grawity Jul 1 '11 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 '11 at 21:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.