1fakeroot(1) Debian manual fakeroot(1)
2
3
4
6 fakeroot - run a command in an environment faking root privileges for
7 file manipulation
8
10 fakeroot [-i|-s local-state-dir] [-h|--help ] [-v|--version ] [--]
11 [command]
12
14 fakeroot runs a command in an environment wherein it appears to have
15 root privileges for file manipulation. This is useful for allowing
16 users to create file system images, archives and packages (tar, ar,
17 .deb etc.) with files in them with root permissions/ownership. Without
18 fakeroot one would need to have root privileges to create the con‐
19 stituent files of the archives with the correct permissions and owner‐
20 ship, and then pack them up, or one would have to construct the ar‐
21 chives directly, without using the archiver. This version of fakeroot
22 uses pseudo(1) to replace the file manipulation library functions
23 (chmod(2), stat(2) etc.) by ones that simulate the effect the real
24 library functions would have had, had the user really been root.
25
26
28 -l arg, --lib arg
29 Does nothing, accepted for compatibility only.
30
31 --faked arg
32 Does nothing, accepted for compatibility only.
33
34 [--] command
35 Any command you want to be ran as fakeroot. Use ‘--’ if in the
36 command you have other options that may confuse fakeroot's
37 option parsing.
38
39 -s local-state-dir
40 Keep the pseudo state directory on exit. This directory holds
41 the pseudo database files and log files. See the pseudo documen‐
42 tation on the details on how this directory can be reused.
43
44 -i local-state-dir
45 Load a pseudo environment previously saved using -s from the
46 specified directory. Note that this does not implicitly save
47 the direcotry, use -s instead for that behaviour. Using the same
48 file for both -i and -s in a single fakeroot invocation is safe.
49
50 -u, --unknown-is-real Does nothing, accepted for compatibility only.
51
52 -b fd Does nothing, accepted for compatibility only.
53
54 -h Display help.
55
56 -v Display version.
57
58
60 Here is an example session with fakeroot. Notice that inside the fake
61 root environment file manipulation that requires root privileges suc‐
62 ceeds, but is not really happening.
63
64 $ whoami
65 joost
66 $ fakeroot /bin/bash
67 # whoami
68 root
69 # mknod hda3 b 3 1
70 # ls -ld hda3
71 brw-r--r-- 1 root root 3, 1 Jul 2 22:58 hda3
72 # chown joost:root hda3
73 # ls -ld hda3
74 brw-r--r-- 1 joost root 3, 1 Jul 2 22:58 hda3
75 # ls -ld /
76 drwxr-xr-x 20 root root 1024 Jun 17 21:50 /
77 # chown joost:users /
78 # chmod a+w /
79 # ls -ld /
80 drwxrwxrwx 20 joost users 1024 Jun 17 21:50 /
81 # exit
82 $ ls -ld /
83 drwxr-xr-x 20 root root 1024 Jun 17 21:50 //
84 $ ls -ld hda3
85 -rw-r--r-- 1 joost users 0 Jul 2 22:58 hda3
86
87 Only the effects that user joost could do anyway happen for real.
88
89 fakeroot was specifically written to enable users to create Debian
90 GNU/Linux packages (in the deb(5) format) without giving them root
91 privileges. This can be done by commands like dpkg-buildpackage
92 -rfakeroot or debuild -rfakeroot (actually, -rfakeroot is default in
93 debuild nowadays, so you don't need that argument).
94
96 fakeroot is a regular, non-setuid program. It does not enhance a user's
97 privileges, or decrease the system's security.
98
100 See pseudo(1) for the details on the bugs of the underlying fakeroot
101 implementation.
102
104 fakeroot wrapper for pseudo is distributed under the GNU General Public
105 License version 3.0 or later. pseudo itself is distributed under the
106 GNU Lesser General Public License version 2.1 or later.
107
109 The original fakeroot manual page has mostly been written by J.H.M.
110 Dassen <jdassen@debian.org> with rather a lot modifications and addi‐
111 tions by joost and Clint. It was later modified by Andrew Shadura for
112 this fakeroot wrapper for pseudo.
113
115 pseudo(1), fakeroot(1), dpkg-buildpackage(1), debuild(1)
116
117
118
119Debian Project 22 November 2015 fakeroot(1)