문제

There is a foo.tar.gz source it will install to /lib/modules. But, I'm not root haven't enough permission. I'm try to write a script to automatic build the package.

#!/bin/bash
tar xf foo.tar.gz
cd foo
make
fakeroot make install

It shows

mkdir: cannot create directory `/lib/modules/foo.so

I don't want to really put in /lib, maybe I could put in $HOME/rootfs.

What is the correct method to use fakeroot? Or, is there a simple script could let me trace how to use fakeroot?

도움이 되었습니까?

해결책

You are confused about the role of fakeroot. It is not used to elevate privilges to root in order to install a package. It is used when a package is created. Since you are not creating a package, there is nothing fakeroot can do for you. See also this description of fakeroot.

To temporarily elevate privileges, you should use sudo.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top