Error when logging in as root: stat: unrecognized option '--printf' BusyBox v1.30.1 () multi-call binary

When I log on to the system as root, I get the following message:

stat: unrecognized option ‘–printf’
BusyBox v1.30.1 () multi-call binary.

Usage: stat [OPTIONS] FILE…

Display file (default) or filesystem status

-c FMT	Use the specified format
-f	Display filesystem status
-L	Follow links
-t	Terse display

FMT sequences for files:
%a Access rights in octal
%A Access rights in human readable form
%b Number of blocks allocated (see %B)
%B Size in bytes of each block reported by %b
%d Device number in decimal
%D Device number in hex
%f Raw mode in hex
%F File type
%g Group ID
%G Group name
%h Number of hard links
%i Inode number
%n File name
%N File name, with → TARGET if symlink
%o I/O block size
%s Total size in bytes
%t Major device type in hex
%T Minor device type in hex
%u User ID
%U User name
%x Time of last access
%X Time of last access as seconds since Epoch
%y Time of last modification
%Y Time of last modification as seconds since Epoch
%z Time of last change
%Z Time of last change as seconds since Epoch

FMT sequences for file systems:
%a Free blocks available to non-superuser
%b Total data blocks
%c Total file nodes
%d Free file nodes
%f Free blocks
%i File System ID in hex
%l Maximum length of filenames
%n File name
%s Block size (for faster transfer)
%S Fundamental block size (for block counts)
%t Type in hex
%T Type in human readable form
WARNING: the per-user profile dir /nix/var/nix/profiles/per-user/root should belong to user id 0
stat: unrecognized option ‘–printf’
BusyBox v1.30.1 () multi-call binary.

Usage: stat [OPTIONS] FILE…

Display file (default) or filesystem status

-c FMT	Use the specified format
-f	Display filesystem status
-L	Follow links
-t	Terse display

FMT sequences for files:
%a Access rights in octal
%A Access rights in human readable form
%b Number of blocks allocated (see %B)
%B Size in bytes of each block reported by %b
%d Device number in decimal
%D Device number in hex
%f Raw mode in hex
%F File type
%g Group ID
%G Group name
%h Number of hard links
%i Inode number
%n File name
%N File name, with → TARGET if symlink
%o I/O block size
%s Total size in bytes
%t Major device type in hex
%T Minor device type in hex
%u User ID
%U User name
%x Time of last access
%X Time of last access as seconds since Epoch
%y Time of last modification
%Y Time of last modification as seconds since Epoch
%z Time of last change
%Z Time of last change as seconds since Epoch

FMT sequences for file systems:
%a Free blocks available to non-superuser
%b Total data blocks
%c Total file nodes
%d Free file nodes
%f Free blocks
%i File System ID in hex
%l Maximum length of filenames
%n File name
%s Block size (for faster transfer)
%S Fundamental block size (for block counts)
%t Type in hex
%T Type in human readable form
WARNING: the per-user gcroots dir /nix/var/nix/gcroots/per-user/root should belong to user id 0

Can someone help me?

Thnx

This looks like busybox is somehow found in root’s environment. This may be from a nix-env -i call, or from the system configuration.

Busybox, while a useful toolbox, is less featureful than the coreutils. It generally trips up things when it is found suddenly replacing coreutils.

You can look at the output of nix-env -q as root to see if it has been installed using nix-env. You can remove it, using nix-env -e busybox. (The nix-env -q invocation might be scrolled off the top since it might end up using busybox’s less, so maybe try using -e anyway.)

If it is installed through the system configuration, remove it from your configuration and rebuild.

The package was actually installed via the system configuration. No idea why it slipped in there. I got it out of configurations.nix now and everything is running as usual.

Thanks again