fakeroot(1)
π fakeroot β the Debian manual page, but make it cute π
okay bestie, welcome to fakeroot(1), from the Debian manual. yes we're doing a whole manual page. grab a snack. π
β¨ NAME β¨
fakeroot β run a command in an environment faking root privileges for file manipulation
β¨ SYNOPSIS β¨
fakeroot [-i|-s local-state-dir] [-h|--help ] [-v|--version ] [--]
[command]
β¨ DESCRIPTION β¨
so basically, fakeroot runs a command in an environment where it looks like you have root privileges for file manipulation. it's giving fake-it-till-you-make-it, and honestly? it ate. π₯
this is so useful because it lets regular users create file system images, archives and packages (tar, ar, .deb etc.) with files inside them that have root permissions/ownership. without fakeroot you'd literally need actual root privileges to create the constituent files of the archives with the correct permissions and ownership, and then pack them up β or you'd have to construct the archives directly, without using the archiver. no thank you. π
this version of fakeroot uses pseudo(1) to replace the file manipulation library functions (chmod(2), stat(2) etc.) with ones that simulate the effect the real library functions would have had, had the user really been root. it's method acting. main character energy. π
β¨ OPTIONS β¨
-l arg,--lib argβ does literally nothing, accepted for compatibility only. it's a decorative little flag π--faked argβ also does nothing, accepted for compatibility only.[--] commandβ any command you want to be ran as fakeroot. use--if in the command you have other options that may confuse fakeroot's option parsing. (yes, "be ran". we don't fix the grammar, we just vibe.)-s local-state-dirβ keep the pseudo state directory on exit. this directory holds the pseudo database files and log files. see the pseudo documentation on the details on how this directory can be reused. ποΈ-i local-state-dirβ load a pseudo environment previously saved using-sfrom the specified directory. note that this does not implicitly save the directory, use-sinstead for that behaviour. using the same file for both-iand-sin a single fakeroot invocation is safe. π«Ά-u,--unknown-is-realβ does nothing, accepted for compatibility only.-b fdβ does nothing, accepted for compatibility only.-hβ display help.-vβ display version.
ngl, a lot of these flags are just here for the vibes. they're compatibility-only. they do nothing. iconic, honestly. π
β¨ EXAMPLES β¨
here's an example session with fakeroot. notice that inside the fake root environment, file manipulation that requires root privileges succeeds, but is not really happening. it's an illusion. a beautiful one. π
$ whoami
joost
$ fakeroot /bin/bash
# whoami
root
# mknod hda3 b 3 1
# ls -ld hda3
brw-r--r-- 1 root root 3, 1 Jul 2 22:58 hda3
# chown joost:root hda3
# ls -ld hda3
brw-r--r-- 1 joost root 3, 1 Jul 2 22:58 hda3
# ls -ld /
drwxr-xr-x 20 root root 1024 Jun 17 21:50 /
# chown joost:users /
# chmod a+w /
# ls -ld /
drwxrwxrwx 20 joost users 1024 Jun 17 21:50 /
# exit
$ ls -ld /
drwxr-xr-x 20 root root 1024 Jun 17 21:50 //
$ ls -ld hda3
-rw-r--r-- 1 joost users 0 Jul 2 22:58 hda3
only the effects that user joost could do anyway happen for real. everything else was theatre. π
fakeroot was specifically written to enable users to create Debian GNU/Linux packages (in the deb(5) format) without giving them root privileges. this can be done by commands like dpkg-buildpackage -rfakeroot or debuild -rfakeroot (actually, -rfakeroot is default in debuild nowadays, so you don't need that argument). look at you, packaging like a pro. π
β¨ SECURITY ASPECTS β¨
fakeroot is a regular, non-setuid program. it does not enhance a user's privileges, or decrease the system's security. it's safe. it's chill. it's your friend. π
β¨ BUGS β¨
see pseudo(1) for the details on the bugs of the underlying fakeroot implementation. (yeah, the bugs live over there now. not our problem. π)
β¨ COPYING β¨
the fakeroot wrapper for pseudo is distributed under the GNU General Public License version 3.0 or later. pseudo itself is distributed under the GNU Lesser General Public License version 2.1 or later. π
β¨ AUTHORS β¨
the original fakeroot manual page has mostly been written by J.H.M. Dassen <jdassen@debian.org> with rather a lot modifications and additions by joost and Clint. it was later modified by Andrew Shadura for this fakeroot wrapper for pseudo. legends, all of them. π
β¨ SEE ALSO β¨
pseudo(1), fakeroot(1), dpkg-buildpackage(1), debuild(1)
and that's the whole page, bestie!! this was the Debian Project's fakeroot(1), dated 22 November 2015. go forth and fake some root privileges, responsibly. no cap. π
β¨π¦
π¦ where this page comes from
- debian bookworm: pseudo 1.9.0+git20220404+2b4b88eb5133-1 Β· LGPL-2.1-only
- ubuntu jammy: pseudo 1.9.0+git20211111+300d7570720b-2 Β· LGPL-2.1-only
- ubuntu noble: pseudo 1.9.0+git20230301+ec6151a2b057-1 Β· LGPL-2.1-only
- ubuntu resolute: pseudo 1.9.0+git20230301+ec6151a2b057-1 Β· LGPL-2.1-only
- ubuntu stonking: pseudo 1.9.2+git20250711+d1db9c219abf-2 Β· LGPL-2.1-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms