man fakeroot Command

Man page for apt-get fakeroot Command

Man Page for fakeroot in Linux

Ubuntu Man Command : man fakeroot

Man Fakeroot  Command

This tutorial shows the man page for man fakeroot in linux.

Open terminal with 'su' access and type the command as shown below:
man fakeroot

Result of the Command Execution shown below:

fakeroot(1)                                                                 Debian manual                                                                fakeroot(1)

fakeroot run a command in an environment faking root privileges for file manipulation

fakeroot [ l| lib library] [ faked faked binary] [ i load file] [ s save file] [ u| unknown is real ] [ b| fd base ] [ h| help ] [ v| version ] [ ]

fakeroot runs a command in an environment wherein it appears to have root privileges for file manipulation. This is useful for allowing users to create ar
chives (tar, ar, .deb etc.) with files in them with root permissions/ownership. Without fakeroot one would need to have root privileges to create the con
stituent files of the archives with the correct permissions and ownership, and then pack them up, or one would have to construct the archives directly, with
out using the archiver.

fakeroot works by replacing the file manipulation library functions (chmod(2), stat(2) etc.) by ones that simulate the effect the real library functions
would have had, had the user really been root. These wrapper functions are in a shared library /usr/lib/* which is loaded through the
LD_PRELOAD mechanism of the dynamic loader. (See

If you intend to build packages with fakeroot, please try building the fakeroot package first: the "debian/rules build" stage has a few tests (testing mostly
for bugs in old fakeroot versions). If those tests fail (for example because you have certain libc5 programs on your system), other packages you build with
fakeroot will quite likely fail too, but possibly in much more subtle ways.

Also, note that it's best not to do the building of the binaries themselves under fakeroot. Especially configure and friends don't like it when the system
suddenly behaves differently from what they expect. (or, they randomly unset some environment variables, some of which fakeroot needs).

l library, lib library
Specify an alternative wrapper library.

faked binary
Specify an alternative binary to use as faked.

[ ] 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.

s save file
Save the fakeroot environment to save file on exit. This file can be used to restore the environment later using i. However, this file will leak and
fakeroot will behave in odd ways unless you leave the files touched inside the fakeroot alone when outside the environment. Still, this can be useful.
For example, it can be used with rsync(1) to back up and restore whole directory trees complete with user, group and device information without need
ing to be root. See /usr/share/doc/fakeroot/README.saving for more details.

i load file
Load a fakeroot environment previously saved using s from load file. Note that this does not implicitly save the file, use s as well for that be
haviour. Using the same file for both i and s in a single fakeroot invocation is safe.

u, unknown is real
Use the real ownership of files previously unknown to fakeroot instead of pretending they are owned by root:root.

b fd Specify fd base (TCP mode only). fd is the minimum file descriptor number to use for TCP connections; this may be important to avoid conflicts with
the file descriptors used by the programs being run under fakeroot.

h Display help.

v Display version.

Here is an example session with fakeroot. Notice that inside the fake root environment file manipulation that requires root privileges succeeds, but is not
really happening.

$ whoami
$ fakeroot /bin/bash

Related Topics

Apt Get Commands