我正在尝试在Linux系统上安装VirtualBox。运行安装程序时,由于在此系统上没有bzip2而遇到错误:
# bash -i VirtualBox-5.2.16-123759-Linux_x86.run
Verifying archive integrity... All good.
Uncompressing VirtualBox for Linux installation.............
VirtualBox Version 5.2.16 r123759 (2018-07-16T15:17:42Z) installer
Removing previous installation of VirtualBox 5.2.16 r123759 from
/opt/VirtualBox
Installing VirtualBox to /opt/VirtualBox
./install.sh: line 252: bzip2: command not found
不幸的是,我无法在该系统上安装bzip2。但是,我确实有支持bzip2的tar(“ j”标志)。但是,我无法将.run文件修改为使用tar而不是bzip2。
所以,我的新主意是在bash中使用一个函数,大致如下:
function bzip2() { ... use tar to extract the bz2 file in a way that's compliant with the use case in the .run file ... }
但是,一个简单的测试显示我无法在.run文件中使用bzip2函数:
# bzip2() { echo $1; }
# bzip2 test
test
# bash -i VirtualBox-5.2.16-123759-Linux_x86.run
Verifying archive integrity... All good.
Uncompressing VirtualBox for Linux installation.............
VirtualBox Version 5.2.16 r123759 (2018-07-16T15:17:42Z) installer
Removing previous installation of VirtualBox 5.2.16 r123759 from /opt/VirtualBox
Installing VirtualBox to /opt/VirtualBox
./install.sh: line 252: bzip2: command not found
答案 0 :(得分:1)