Danger!
Coreutils is the some of the most critical software for personal computation on most Linux systems. While this mostly works, you can expect issues with some lacking binaries, and since this is the official Arch Linux repository release, whatever issues withstanding in it will persist until it is updated.
There are AUR releases of this, but the one which seems to look the best also doesn’t build at the moment. Whenever that is resolved, you should be able to swap the files out by following the provided instructions.
Known issues exist with incorrect flags defined in the provided file from
uutils-coreutils
which may or may not be resolved over time.You agree that following this guidance is at your own peril. All fault from following these instructions for system malfunction or instability is on you.
Preface
If you’ve seen the news recently, Canonical made a big splash in the Linux space with Canonical proclaiming they wish to replace the GNU Coreutils which make up their GNU / Linux distribution by eliminating as much of, if not in-entirety Coreutils in favour for their rust-based alternative; Uutils.
Good fortune for us Arch users; we can implement use of this software at our own leisure, and with a basic understanding of the filesystem hierarchy most open-source system users swear as unwritten oath to abide by, do so safely.
Installation
This is pretty simple. In a terminal emulator of preference:
sudo pacman -S uutils-coreutils
Once that is finished, then the fun really begins. A brief look in /usr/bin
with ls
reveals a bunch of which begin with the character uu-
. We’ll use this to take advantage of some inline scripting trickery for moving into the appropriate locations Arch Linux respects.
Instantiation
Because GNU’s coreutils
is already installed, we’ll have to create our new replacement references elsewhere. All Uutils consists of from the Arch Linux package is a single binary; uu-coreutils
with all functions defined as symbolic links. (Yes, that’s how it really works.)
Because of that, we can take advantage this naming schema to instantiate the links so they are placed in /usr/local/bin
for use as coreutils
’ successor, if desired.
Using multiple binaries already provided by GNU Coreutils, we can make what’s there usable:
You can elect to replace
/usr/bin/uu-{}
with/usr/bin/uu-coreutils
for the same effect, but what’s shown here would be more difficult to follow if presented like that.
The hashsum symlink action might need some massaging; you may end up using
tail
instead ofhead
depending on output. try withouthead
andxargs
first!
find /usr/bin -name 'uu-*' -type l -printf '%f\n' | cut -c 4- | xargs -I{} sudo ln -s /usr/bin/uu-{} /usr/local/bin/{}
find /usr/bin -name 'sha*sum' -printf '%f\n' | sort -g | head -n 5 | xargs -I{} sudo ln -s /usr/bin/uu-hashsum /usr/local/bin/{}
sudo ln -s /usr/bin/uu-hashsum /usr/local/bin/md5sum; sudo ln -s /usr/bin/uu-hashsum /usr/local/bin/b2sum
After, you can give things a look and see if all expected links exist in a functional state:
find /usr/local/bin -type l | wc -l
The output for this, barring any other symbolic links made in this directory for other reasons, should be 107
with the provided instructions.
OH MY DAYS WHAT ARE YOU DOING?!
Please don’t perform the step below, until you are damn certain after multiple pre-flight checks you have the symbolic links established as-instructed. Reminder: You don’t have to do this, it’s only if you dislike the bloat of having both Coreutils suites or if you want to see whether this can stand on its own.
Also of note;
/usr/bin
takes priority over/usr/local/bin
so the removal of Coreutils will enforce use of Uutils since links for those exist in/usr/local/bin
.
If you wish to remove Coreutils after instantiation, you’ll have to skip dep check for this to work:
sudo pacman -Rdd coreutils
Removal
After having your fun with Uutils, if you find the software just isn’t up to snuff, removal should be pretty painless to perform by modifying the instantiation steps and doing things in reverse:
sudo pacman -S coreutils
find /usr/bin -name 'uu-*' -type l -printf '%f\n' | cut -c -4 | xargs -I{} sudo unlink /usr/local/bin/{}
find /usr/bin -name 'sha*sum' -printf '%f\n' | sort -g | head -n 5 | xargs -I{} sudo unlink /usr/local/bin/{}
sudo unlink /usr/local/bin/md5sum; sudo unlink /usr/local/bin/b2sum
sudo pacman -R uutils-coreutils
Issues
As mentioned in the warning above, this has some problems:
- Incorrect flags / flag implementation for select commands
- Missing functions:
runcon
chcon
stty
Those are all of the issues I am aware of thus far, and if you use those binaries then you might be plum out of luck until this is resolved. If you have some other problems people should mind, or if this advice becomes outdated / is incomplete, feel free to let us know! Also, advice on building uutils-coreutils-git
from the AUR would be nice to have. I run a system with doas
replacing sudo
on my primary computational device, so I might be encountering some trouble related to that.
Corrections
- I misplaced the hyphen for
cut
in the first series of instructions usingfind
andxargs
, so it was making links foruu-<
letter >
rather than the like-named substitute for GNU Coreutils’ binaries in/usr/local/bin
. This would have lead to an unusable system if one who did not know already, hadn’t double-checked their work should they had removed Coreutils. - I modified the provided testing methodology for ensuring all instructions rendered the intended result. I shouldn’t had made this thread when I was so very tired.