我正在尝试在没有互联网的 Linux 机器上安装 x11vnc。因此我无法使用sudo apt-get install x11vnc
命令进行安装。有人能帮我使用离线模式安装 x11vnc 及其所有必需的依赖项吗?
./configure
我尝试使用 .tar.gz 文件进行安装,但尝试命令时出现以下错误。
checking for gcc... no
checking for cc... no
checking for cc... no
checking for cl... no
configure: error: no acceptable C compiler found in $PATH
答案1
答案2
步骤 1:首先在其他在线系统上下载所有软件包和要求。最好是与离线主机相同的发行版和版本。
要下载所有必需的软件包,你可以执行以下操作:
$ sudo apt update
$ mkdir x11vnc; cd $_
$ for i in $(apt-cache depends --recurse --no-suggests --no-conflicts --no-recommends --no-breaks --no-replaces --no-enhances x11vnc | grep "^\w"); do apt download $i; done
以上操作将会把所有需要的包下载到 x11vnc 目录中。
第2步:
将整个 x11vnc 复制到您的离线系统。在我的测试运行中,情况正是如此:
$ du -sh x11vnc
21M x11vnc
仅作为说明,x11vnc 目录的内容可能如下所示:
~/x11vnc$ ls
cdebconf_0.250ubuntu2_amd64.deb libc6_2.30-0ubuntu3_amd64.deb libgpg-error0_1.36-7ubuntu1_amd64.deb libselinux1_3.0-1_amd64.deb libxcb1_1.13.1-3build1_amd64.deb perl-base_5.30.0-9_amd64.deb
coreutils_8.30-3ubuntu2_amd64.deb libcap2_1%3a2.27-1_amd64.deb libhogweed5_3.5.1+really3.5.1-2_amd64.deb libslang2_2.3.2-4_amd64.deb libxdamage1_1%3a1.1.5-1_amd64.deb sensible-utils_0.0.12+nmu1_all.deb
debconf_1.5.73_all.deb libdb5.3_5.3.28+dfsg1-0.6ubuntu1_amd64.deb libidn2-0_2.2.0-2_amd64.deb libssl1.1_1.1.1d-2ubuntu3_amd64.deb libxdmcp6_1%3a1.1.3-0ubuntu1_amd64.deb tar_1.30+dfsg-6_amd64.deb
dpkg_1.19.7ubuntu2_amd64.deb libdbus-1-3_1.12.16-2ubuntu2_amd64.deb libjpeg8_8c-2ubuntu8_amd64.deb libsystemd0_244.1-0ubuntu2_amd64.deb libxext6_2%3a1.3.4-0ubuntu1_amd64.deb tcl8.6_8.6.10+dfsg-1_amd64.deb
fontconfig-config_2.13.1-2ubuntu2_all.deb libdebian-installer4_0.110ubuntu3_amd64.deb libjpeg-turbo8_2.0.3-0ubuntu1_amd64.deb libtasn1-6_4.15.0-2_amd64.deb libxfixes3_1%3a5.0.3-1_amd64.deb tcl_8.6.9+1_amd64.deb
fonts-dejavu-core_2.37-1_all.deb libelogind0_241.3-1+debian2_amd64.deb liblz4-1_1.9.2-2_amd64.deb libtcl8.6_8.6.10+dfsg-1_amd64.deb libxft2_2.3.3-0ubuntu1_amd64.deb tk8.6_8.6.10-1_amd64.deb
fonts-liberation_1%3a1.07.4-10_all.deb libexpat1_2.2.9-1_amd64.deb liblzma5_5.2.4-1_amd64.deb libtextwrap1_0.1-14.2_amd64.deb libxi6_2%3a1.7.10-0ubuntu1_amd64.deb tk_8.6.9+1_amd64.deb
gcc-10-base_10-20200202-1ubuntu1_amd64.deb libffi7_3.3-3_amd64.deb liblzo2-2_2.10-2_amd64.deb libtk8.6_8.6.10-1_amd64.deb libxinerama1_2%3a1.1.4-2_amd64.deb ttf-bitstream-vera_1.10-8_all.deb
libacl1_2.2.53-5ubuntu1_amd64.deb libfontconfig1_2.13.1-2ubuntu2_amd64.deb libnettle7_3.5.1+really3.5.1-2_amd64.deb libunistring2_0.9.10-2_amd64.deb libxrandr2_2%3a1.5.2-0ubuntu1_amd64.deb tzdata_2019c-3_all.deb
libattr1_1%3a2.4.48-5_amd64.deb libfreetype6_2.10.1-2_amd64.deb libnewt0.52_0.52.21-3ubuntu1_amd64.deb libuuid1_2.34-0.1ubuntu5_amd64.deb libxrender1_1%3a0.9.10-1_amd64.deb ucf_3.0038+nmu1_all.deb
libavahi-client3_0.7-4ubuntu6_amd64.deb libgcc1_1%3a10-20200202-1ubuntu1_amd64.deb libp11-kit0_0.23.19-2_amd64.deb libvncclient1_0.9.12+dfsg-8_amd64.deb libxss1_1%3a1.2.3-1_amd64.deb x11-common_1%3a7.7+19ubuntu13_all.deb
libavahi-common3_0.7-4ubuntu6_amd64.deb libgcc-s1_10-20200202-1ubuntu1_amd64.deb libpcre2-8-0_10.34-7_amd64.deb libvncserver1_0.9.12+dfsg-8_amd64.deb libxtst6_2%3a1.2.3-1_amd64.deb x11vnc_0.9.16-3_amd64.deb
libavahi-common-data_0.7-4ubuntu6_amd64.deb libgcrypt20_1.8.5-3ubuntu1_amd64.deb libpng16-16_1.6.37-1_amd64.deb libx11-6_2%3a1.6.8-1_amd64.deb libzstd1_1.4.4+dfsg-1_amd64.deb zlib1g_1%3a1.2.11.dfsg-1ubuntu3_amd64.deb
libbsd0_0.10.0-1_amd64.deb libgmp10_2%3a6.1.2+dfsg-4_amd64.deb libsasl2-2_2.1.27+dfsg-2_amd64.deb libx11-data_2%3a1.6.8-1_all.deb lsb-base_11.1.0ubuntu2_all.deb
libbz2-1.0_1.0.8-2_amd64.deb libgnutls30_3.6.11.1-2ubuntu2_amd64.deb libsasl2-modules-db_2.1.27+dfsg-2_amd64.deb libxau6_1%3a1.0.9-0ubuntu1_amd64.deb openssl_1.1.1d-2ubuntu3_amd64.deb
步骤3:
在离线系统上进入刚刚复制的x11vnc目录并执行:
$ sudo dpkg -i *
这应该会安装所有软件包,包括依赖项以及 x11vnc 软件包。注意:您可能会遇到一些错误,因为某些软件包可能已经安装等。