目录
一、前言
二、正文
1.准备环境
2.开始下载
3.后续工作
三、总结
一、前言
由于给客户提供的设备机不允许上网,那么所有待安装的软件包及依赖库都需要提前下载好,然后通过局域网传过去再安装。
另外,软件包可能还依赖其他的库,库还依赖其他的库...,所以需要一步步耐心的查找并下载。
二、正文
我这边需要安装的软件是用QT编写的一个代理程序,它所依赖Boost库和UUID库,以及JSON等库。
由于当前Ubuntu系统中已经自带了UUID和JSON库,所以下面用Boost库进行演示。
1.准备环境
- 查看一下下载源是否设置好了
- 到https://pkgs.org/ 网上查一下libboost都有哪些库
- 在系统合适的路径下新建一个文件夹,用于下载软件包
2.开始下载
先切换到root用户,方便后面输入命令,否则总得输入sudo
然后进入到新建的文件夹中,执行apt download <库名> 下载
ok,第一个库文件已经下载好了,然后我们再通过apt-cache depends <库名>查询一下它所依赖的库
它依赖libboost1.71-dev和libboost-atomic1.71.0,冲突先不管,如果有建议的库也记录下来。
那下面我就继续下载那两个依赖的库
剩下工作就是重复执行“查询依赖”和“下载库文件”的工作了,就不在此复述。
我将所有依赖关系列表在下面列出,供大家参考:
libboost-all-devDepends: libboost-devDepends: libboost1.71-devSuggests: libboost-doc#Depends: libboost-tools-dev:armhfDepends: libboost1.71-tools-dev:armhfDepends: libboost-atomic-devDepends: libboost-atomic1.71-devDepends: libboost1.71-devDepends: libboost-atomic1.71.0Depends: libboost-chrono-devDepends: libboost-chrono1.71-devDepends: libboost1.71-devDepends: libboost-chrono1.71.0Depends: libc6Depends: libgcc-s1Depends: gcc-10-baseDepends: libc6Depends: libstdc++6Depends: libboost-container-devDepends: libboost-container1.71-devDepends: libboost1.71-devDepends: libboost-container1.71.0Depends: libc6Depends: libgcc-s1Depends: libstdc++6Depends: libboost-context-devDepends: libboost-context1.71-devDepends: libboost1.71-devDepends: libboost-thread1.71-devDepends: libboost1.71-devDepends: libboost-atomic1.71-devDepends: libboost-chrono1.71-devDepends: libboost-date-time1.71-devDepends: libboost-system1.71-devDepends: libboost-thread1.71.0Depends: libboost-context1.71.0Depends: libboost-coroutine-devDepends: libboost-coroutine1.71-devDepends: libboost1.71-devDepends: libboost-context1.71-devDepends: libboost-coroutine1.71.0Depends: libboost-context1.71.0Depends: libboost-thread1.71.0Depends: libc6Depends: libgcc-s1Depends: libstdc++6Depends: libboost-date-time-devDepends: libboost-date-time1.71-devDepends: libboost1.71-devDepends: libboost-date-time1.71.0Depends: libboost-serialization1.71-devDepends: libboost1.71-devDepends: libboost-serialization1.71.0Depends: libboost-exception-devDepends: libboost-exception1.71-devDepends: libboost-fiber-devDepends: libboost-fiber1.71-devDepends: libboost1.71-devDepends: libboost-context1.71-devDepends: libboost-filesystem1.71-devDepends: libboost1.71-devDepends: libboost-filesystem1.71.0Depends: libboost-system1.71-devDepends: libboost-fiber1.71.0Depends: libboost-filesystem-devDepends: libboost-filesystem1.71-devDepends: libboost-graph-devDepends: libboost-graph1.71-devDepends: libboost1.71-devDepends: libboost-graph1.71.0Depends:libboost-regex1.71.0Depends: libc6Depends: libgcc-s1Depends: libstdc++6Suggests: graphvizDepends: libboost-regex1.71-devDepends: libboost-serialization1.71-devDepends: libboost-test1.71-devDepends: libboost-graph-parallel-devDepends: libboost-graph-parallel1.71-devDepends: libboost1.71-devDepends: libboost-graph-parallel1.71.0Depends: libboost-serialization1.71-devDepends: libboost-test1.71-devDepends: libboost-iostreams-devDepends: libboost-iostreams1.71-devDepends: libboost1.71-devDepends: libboost-regex1.71-devDepends: libboost-iostreams1.71.0Depends: libboost-locale-devDepends: libboost-locale1.71-devDepends: libboost1.71-devDepends: libboost-thread1.71-devDepends: libboost-locale1.71.0Depends: libboost-log-devDepends: libboost-log1.71-devDepends: libboost-log1.71.0Depends: libboost1.71-devDepends: libboost-atomic1.71-devDepends: libboost-date-time1.71-devDepends: libboost-filesystem1.71-devDepends: libboost-system1.71-devDepends: libboost-regex1.71-devDepends: libboost-thread1.71-devDepends: libboost-math-devDepends: libboost-math1.71-devDepends: libboost1.71-devDepends: libboost-math1.71.0Depends: libboost-mpi-devDepends: libboost-mpi1.71-devDepends: libboost1.71-devDepends: libboost-serialization1.71-devDepends: libboost-mpi1.71.0Depends: mpi-default-devSuggests: libboost-graph1.71-devDepends: libboost-mpi-python-devDepends: libboost-mpi-python1.71-devDepends: libboost-mpi1.71-devDepends: libboost-mpi-python1.71.0Depends: libboost-mpi1.71.0Depends: libboost-python1.71.0Depends: libboost-python1.71.0Depends: libboost-serialization1.71.0Depends: libc6Depends: libgcc-s1Depends: libopenmpi3Depends: libstdc++6Depends: python3Depends: python3Depends: mpi-default-binDepends: libboost-numpy-devDepends: libboost-numpy1.71-devDepends: libboost-numpy1.71.0Depends: libboost-python1.71.0Depends: libboost-python1.71.0Depends: libc6Depends: libgcc-s1Depends: libstdc++6Suggests: python3Suggests: libboost1.71-docDepends: libboost-program-options-devDepends: libboost-program-options1.71-devDepends: libboost1.71-devDepends: libboost-program-options1.71.0Depends: libboost-python-devDepends: libboost-python1.71-devDepends: libboost1.71-devDepends: libboost-python1.71.0Depends: python3-devSuggests: libboost1.71-docSuggests: <gccxml>Depends: libboost-random-devDepends: libboost-random1.71-devDepends: libboost1.71-devDepends: libboost-system1.71-devDepends: libboost-random1.71.0Depends: libboost-regex-devDepends: libboost-regex1.71-devDepends: libboost1.71-devDepends: libboost-regex1.71.0Depends: libicu-devDepends: libboost-serialization-devDepends: libboost-serialization1.71-devDepends: libboost-stacktrace-devDepends: libboost-stacktrace1.71-devDepends: libboost1.71-devDepends: libboost-stacktrace1.71.0Depends: libboost-system-devDepends: libboost-system1.71-devDepends: libboost1.71-devDepends: libboost-system1.71.0Depends: libboost-test-devDepends: libboost-test1.71-devDepends: libboost1.71-devDepends: libboost-test1.71.0Depends: libboost-thread-devDepends: libboost-thread1.71-devDepends: libboost1.71-devDepends: libboost-atomic1.71-devDepends: libboost-chrono1.71-devDepends: libboost-date-time1.71-devDepends: libboost-system1.71-devDepends: libboost-thread1.71.0Depends: libboost-timer-devDepends: libboost-timer1.71-devDepends: libboost1.71-devDepends: libboost-chrono1.71-devDepends: libboost-timer1.71.0Depends: libboost-type-erasure-devDepends: libboost-type-erasure1.71-devDepends: libboost1.71-devDepends: libboost-system1.71-devDepends: libboost-thread1.71-devDepends: libboost-type-erasure1.71.0Depends: libboost-wave-devDepends: libboost-wave1.71-devDepends: libboost1.71-devDepends: libboost-serialization1.71-devDepends: libboost-wave1.71.0Depends: libboost-filesystem1.71-dev
3.后续工作
当我们下载完所有需要的库文件和依赖库之后,我们可以把前面新建的文件夹进行压缩
然后我们将压缩包拷贝出来,或者通过局域网传递给新设备机上,然后先解压
进入到解压后的目录下,你可以看到之前下载好的库软件包。
下面执行sudo dpkg -i *.deb 命令即可安装此目录下所有的软件包。
注意:如果你之前下载完全的话,应该能正确安装;如果有错误提示,那么请根据提示返回原电脑(可以联网)继续下载软件包。
三、总结
查找依赖和下载软件包的过程是比较考验耐心的,可能由于我是个初学者只能用这个“笨方法”。但为了工作需要,由不得不使用。
当我把工作完成后才发现,确实window系统比较方便,哈哈哈~
来日方长,继续努力吧!