26

I've been thinking about discontinuing the use of GNU Coreutils on my Linux systems, but to be honest, unlike many other GNU components, I can't think of any alternatives (on Linux). What alternatives are there to GNU coreutils? will I need more than one package? Links to the project are a must, bonus points for naming distro packages.

Also please don't suggest things unless you know they work on Linux, and can reference instructions. I doubt I'll be switching kernels soon, and I'm much too lazy for anything much beyond a straightforward ./configure; make; make install. I'm certainly not going to hack C for it.

warning: if your distro uses coreutils removing them could break the way your distro functions. However not having them be first in your $PATH shouldn't break things, as most scripts should use absolute paths.

9
  • 11
    Curiously, why you looking for alternatives?
    – tshepang
    Jan 20, 2011 at 14:11
  • 3
    @xeno "More robust"? Also keep in mind that your system (including kernel) is largely built with GCC and depends on GLibC :)
    – tshepang
    Jan 20, 2011 at 14:24
  • 3
    @xeno Debian is actually now using EGLIBC, which sort of a fork of GLibC. But it follows GLibC closely, so the diff ain't that big.
    – tshepang
    Jan 20, 2011 at 14:41
  • 2
    Both Clang and tcc could (at one time, anyway) compile the Linux kernel. Jan 20, 2011 at 15:01
  • 2
    There are people working on a GNU userland on a BSD kernel, but I haven't heard of the other way round. Really switching kernels would be easier. You can try it first in a VM if you're shy. Jan 20, 2011 at 21:36

6 Answers 6

24

busybox the favorite of Embedded Linux systems.

BusyBox combines tiny versions of many common UNIX utilities into a single small executable. It provides replacements for most of the utilities you usually find in GNU fileutils, shellutils, etc. The utilities in BusyBox generally have fewer options than their full-featured GNU cousins; however, the options that are included provide the expected functionality and behave very much like their GNU counterparts. BusyBox provides a fairly complete environment for any small or embedded system.
BusyBox has been written with size-optimization and limited resources in mind. It is also extremely modular so you can easily include or exclude commands (or features) at compile time. This makes it easy to customize your embedded systems. To create a working system, just add some device nodes in /dev, a few configuration files in /etc, and a Linux kernel.

You can pretty much make any coreutil name a link to the busybox binary and it will work. you can also run busybox <command> and it will work. Example: if you're on Gentoo and haven't installed your vi yet, you can run busybox vi filename and you'll be in vi. It's

3
  • 1
    feel free to modify this with links to your distro Jan 20, 2011 at 14:20
  • also, this is a favorite on embedded, so though an alternative it's probably not going to be enough to replace GNU for my desktop/server environment Jan 20, 2011 at 14:27
  • This is the only practical solution atm, if you don't want to hack C. And busybox versions should be pretty standard conforming. Jan 21, 2011 at 21:25
7

This is an older topic, I realize. However, this solution was never mentioned and comes up relatively high on google for "Linux with bsd userland".

There's another solution: heirloom. I know it works on Arch, and it's packaged in the AUR (look at gnu2sysv, for instance). This will replace Arch's coreutils package and provide the heirloom equivalents. You can read about the whole thing on arch's wiki: https://wiki.archlinux.org/index.php/Base2heirloom

5

Check out uutils.

This is a cross platform implementation of the GNU coreutils that is written in Rust. It is MIT licensed. At the time of writing this answer it is not 100℅ complete (missing some crucial ones like ls and cp), but many other ones are done.

0

Usually, when someone asks to get away from something that's in widespread use, well-tested, verified on many platforms, it's an outward expression of an underlying problem known as "code smell" and the uncontrolled accumulation of "technical debt" or "code debt". The GNU archive had built up a fairly large amount of code debt over the years, and when a codebase is not properly maintained it can reach a breaking point (legacy code, and even morbid legacy code).

Normally, one would carry out a process of re-engineering and refactoring at intervals to keep this under control. So, the real question that's being posed here is whether a refactored version of coreutils has been developed. This, of course, includes the possibility of an outright replacement (as a special case) - much like Wayland is being pitched to be for X ... many of its developers coming straight out of the X camp.

My suggestion is to actually go in and refactor coreutils. Someone's gotta do it. And whoever raises the issue of replacing coreutils - your idea your project.

To this end, take advantage of whatever automation you can find: refactoring engines, like cscout, or anything that applies more advanced analysis/synthesis methods (e.g. formal concept lattices). But deep analysis is still a relatively new and open area of active research - and crosses over into Artificial Intelligence. (A robot software engineer.)

Most of the utilities should already have test suites in place, so validation can be done with progressive step-wise change + automated regression testing steps; which can go pretty fast (e.g. 10 or more revision updates/day). A complication to this process occurs if there are hardware or low-level software dependencies anywhere in the software suite; since that entails validation on multiple platforms. I don't know much of that there is in coreutils; there should be some kind of separation in it from the hardware or low-level software layers (e.g. the number of places where coreutils knows what type of filesystem it is on should be minimal or, better, zero.) Emulators and virtual machines, put to use for purposes of doing multi-platform testing, have limitations. For instance, Mac OS X is specifically designed in a way to obstruct the ability to emulate or VM it.

-1

I suspect you'd have a hard time getting rid of GNU Coreutils, however, there's always the equivalent BSD tools, although they aren't drop-in replacements for the GNU tools.

5
  • how would I go about installing BSD tools on a Linux distro? where would I get them? Jan 20, 2011 at 14:22
  • FreeBSD's entire OS is available via CVS freebsd.org/cgi/cvsweb.cgi/src, however, getting the BSD userland to compile under a Linux kernel would be rather difficult. GNU's userland is probably more portable than BSD, since GNU's userland (at least at the beginning) was built to be portable between multiple kernels.
    – jsbillings
    Jan 20, 2011 at 15:32
  • that sounds like a PITA, sure if it's reasonably possible someone somewhere has packaged it at least once for linux. Jan 20, 2011 at 16:46
  • Solaris (as of 140-something is also available) would also be an option. If you are using a distro you are crazy. Stop now. If you are using LFS, rock on! Have fun! If you are making a distro, I applaud your bravery sir.
    – bahamat
    Jan 20, 2011 at 16:49
  • Yeah, I'm not sure it's even possible. It'd probably be easier to just install FreeBSD and enable linux compatibility. You can easily get the GNU coreutils working under FreeBSD, but not vice-versa.
    – jsbillings
    Jan 20, 2011 at 16:53
-1

Solaris (as of svn_140-something) would also be an option.

If you are using a distro you are crazy. Stop now. Seek psychiatric help.

If you are using LFS, rock on! Have fun!

If you are making a distro, I applaud your bravery sir.

2
  • 1
    this isn't a question about "which distro" can I use, it's about replacing coreutils on Linux. Unless you're referring to opensolaris coreutils? also is this less of a PITA than the FreeBSD option? Jan 20, 2011 at 16:56
  • 1
    The source code for OpenSolaris is just Solaris. The Solaris source code up until svn_14x was released by Sun/Oracle under CDDL. There are basically three main heritages for Unix userland. "Genetic" Unix (Solaris, AIX, True64, etc., which came from AT&T code and is largely closed, but Solaris was open for a time), BSD (which finally stood on it's own as of 4.4-lite) and GNU. But I think that moving away from GNU will be equally difficult (or easy) wether you go with BSD or Solaris. Or you can get really ambitious and make xenocore-utils ;-)
    – bahamat
    Jan 20, 2011 at 17:06

You must log in to answer this question.

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