fakeroot
TLDR
Start default shell as fakeroot
$ fakeroot
Run a command as fakeroot$ fakeroot -- [command] [command_arguments]
Run command and save environment on exit$ fakeroot -s [path/to/file] -- [command] [command_arguments]
Load environment and run command$ fakeroot -i [path/to/file] -- [command] [command_arguments]
Keep real ownership instead of pretending root$ fakeroot [-u|--unknown-is-real] -- [command] [command_arguments]
Display help$ fakeroot [-h|--help]
SYNOPSIS
fakeroot [options] [command]
DESCRIPTION
fakeroot runs commands in an environment that fakes root privileges for file manipulation. It intercepts system calls to make files appear owned by root without actual root access.
Commonly used for building packages that need to create root-owned files.
PARAMETERS
-s file
Save fakeroot environment on exit-i file
Load fakeroot environment-u, --unknown-is-real
Keep real ownership of unknown files-h, --help
Display help
CAVEATS
Does not provide real root privileges. Only fakes ownership information. Used extensively in package building systems like dpkg-buildpackage.
SEE ALSO
sudo(8), dpkg-buildpackage(1)


