如何为离线安装创建Debian包?

3 投票
1 回答
2324 浏览
提问于 2025-04-16 20:47

我想要的是:我想为我的项目开发一个Debian包,以便离线安装。这个项目需要一些依赖,比如python-lxml等等。我已经在另一台可以上网的机器上下载了所需的包。现在,我想把这些包复制到另一台没有网络的机器上的“/var/cache/apt/archive”文件夹里(这是Debian包安装时的一个文件夹),然后在执行控制文件之前进行这个操作。这样,当控制文件执行时,它就可以从“/var/cache/apt/archive”文件夹中安装依赖包,而不是去网上搜索。

我需要在哪个文件上做哪些修改?或者有没有其他建议来创建离线安装包?

谢谢!

1 个回答

2

太棒了,刚刚我还向一个同伴推荐了 apt-offline 这个工具:

Description: offline apt package manager
 apt-offline is an Offline APT Package Manager
 .
 apt-offline can fully update and upgrade an APT based distribution without
 connecting to the network, all of it transparent to apt
 .
 apt-offline can be used to generate a signature on a machine (with no network).
 This signature contains all download information required for the apt database
 system. This signature file can be used on another machine connected to the
 internet (which need not be a Debian box and can even be running windows) to
 download the updates.
 The downloaded data will contain all updates in a format understood by apt and
 this data can be used by apt-offline to update the non-networked machine.
 .
 apt-offline can also fetch bug reports and make them available offline

撰写回答