无法从源代码构建 byobu(没有 root 权限)

无法从源代码构建 byobu(没有 root 权限)

我没有 root 权限。尝试过,autoreconf -ivf但没用

我正在尝试遵循的步骤:

wget https://launchpad.net/byobu/trunk/5.17/+download/byobu_5.17.orig.tar.gz
tar -zxvf byobu_5.17.orig.tar.gz
rm byobu_5.17.orig.tar.gz
cd byobu*
./configure --prefix="$HOME/byobu"
make
make install

make 的输出:

chowdhury@exs-91208:~/byobu-5.17$ make
Making all in etc/byobu
make[1]: Entering directory '/home/chy/byobu-5.17/etc/byobu'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/chy/byobu-5.17/etc/byobu'
Making all in etc/profile.d
make[1]: Entering directory '/home/chy/byobu-5.17/etc/profile.d'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/chy/byobu-5.17/etc/profile.d'
Making all in usr/share/applications
make[1]: Entering directory '/home/chy/byobu-5.17/usr/share/applications'
make[1]: Nothing to be done for 'all'.aking all in usr/share/man/man1
make[1]: Entering directory '/home/chy/byobu-5.17/usr/share/man/man1'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/chy/byobu-5.17/usr/share/man/man1'
Making all in usr/bin
make[1]: Entering directory '/home/chy/byobu-5.17/usr/bin'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/chy/byobu-5.17/usr/bin'
make[1]: Entering directory '/home/chy/byobu-5.17'
make[1]: Nothing to be done for 'all-am'.
make[1]: Leaving directory '/home/chy/byobu-5.17'

make install 的输出:

chy@exs-91208:~/byobu-5.17$ make install
Making install in etc/byobu
make[1]: Entering directory '/home/chy/byobu-5.17/etc/byobu'
make[2]: Entering directory '/home/chy/byobu-5.17/etc/byobu'
make[2]: Nothing to be done for 'install-exec-am'.
 /bin/mkdir -p '/usr/etc/byobu/'
/bin/mkdir: cannot create directory ‘/usr/etc’: Permission denied
Makefile:248: recipe for target 'install-etcDATA' failed
make[2]: *** [install-etcDATA] Error 1
make[2]: Leaving directory '/home/chy/byobu-5.17/etc/byobu'
Makefile:318: recipe for target 'install-am' failed
make[1]: *** [install-am] Error 2
make[1]: Leaving directory '/home/chy/byobu-5.17/etc/byobu'
Makefile:325: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1

答案1

Byobu 无需任何 root 权限即可构建和安装。它不需要在--prefix=目录外安装二进制文件或工件。

按照您描述的步骤,变量有问题$HOME。提取并配置 Byobo 后:

$ tar xf byobu_5.17.orig.tar.gz && cd byobu-5.17 && ./configure --prefix="$HOME/byobu"
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes

...

config.status: creating usr/share/man/man1/Makefile
config.status: creating usr/bin/Makefile

config.log包含前缀:

$ grep ^prefix config.log 
prefix='/home/chy/byobu'

我推测,你的情况看起来更像这样:

$ grep ^prefix config.log 
prefix='/usr'

这样--prefix我就能重现你的错误:

$ make install
Making install in etc/byobu
make[1]: Entering directory '/home/chy/byobu-5.17/etc/byobu'
make[2]: Entering directory '/home/chy/byobu-5.17/etc/byobu'
make[2]: Nothing to be done for 'install-exec-am'.
test -z "/usr/etc/byobu/" || /bin/mkdir -p "/usr/etc/byobu/"
/bin/mkdir: cannot create directory '/usr/etc': Permission denied
Makefile:185: recipe for target 'install-etcDATA' failed
make[2]: *** [install-etcDATA] Error 1
make[2]: Leaving directory '/home/chy/byobu-5.17/etc/byobu'
Makefile:252: recipe for target 'install-am' failed
make[1]: *** [install-am] Error 2
make[1]: Leaving directory '/home/chy/byobu-5.17/etc/byobu'
Makefile:238: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1

重置源目录并重新启动配置并使用绝对路径作为前缀:

$ cd byobu-5.17/
$ make distclean
$ ./configure --prefix=/home/chy/byobu
$ make && make install
$ export PATH=$PATH:/home/chy/byobu/bin

$ byobu

然而,Byobu 只能在tmux包已安装。

相关内容