安装 Debian 8 软件包 &依赖于指定的 fs 目录 [英] Installing Debian 8 packages & dependencies to a specified fs directory

查看:46
本文介绍了安装 Debian 8 软件包 &依赖于指定的 fs 目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Debian 8 的新手,仍然是 Linux 初学者.我目前在 Windows 10 中运行 Debian 8 Oracle VM Virtualbox,以供参考.

I am new to Debian 8, and still very much a Linux beginner. I am currently running Debian 8 Oracle VM Virtualbox in Windows 10, for reference.

对于我正在处理的项目,我的任务是将 Debian 8 包从源包安装到指定的 rootfs 文件夹.获取源文件(.tar.gz、.diff.gz、.dsc)并解压后,我运行:

For a project I am working on, my task is installing Debian 8 packages from the source package to a specified rootfs folder. After getting the source files (.tar.gz, .diff.gz, .dsc) and extracting them, I run:

dpkg-source -x <package>.dsc

将源提取到工作目录.

我遇到的问题是从提取的文件中生成 .deb 文件.执行此操作的标准方法是让 apt 通过以下方式处理来自在线存储库的依赖项的安装:

The issue I'm having is generating the .deb files from the extracted. The standard way to do it is to let apt handle the installation of the dependencies from the online repository via:

apt-get build-dep <package>

然后通过以下方式生成 .deb 文件:

then generate the .deb files via:

dpkg-buildpackage -b

但这会将依赖项安装到我的 rootfs.此外,由于我将大部分软件包下载到本地计算机,因此我希望能够从本地源软件包而不是在线安装每个依赖项.

But this will install the dependencies to my rootfs. In addition, since I downloaded the majority of the packages to my local machine, I'd like to be able to manually install each dependency from my local source packages rather than online.

根据我的理解,我的任务是避免文档和非必要文件污染指定的 fs,因为将添加到此 fs 的 Debian 8 软件包数量超过 700.

From my understanding, I was tasked this to avoid polluting the specified fs with documentation and non-essential files, since the number of Debian 8 packages that will be added to this fs is >700.

如果我对 Linux 的了解有任何错误/误解Debian 8,请告诉我.

If there are any mistakes / misunderstandings with my knowledge of Linux & Debian 8, please let me know.

推荐答案

您可以创建一个 docker 容器并在其中安装您的依赖项并在其中完成您的所有工作.您可以配置 docker 以将 docker 容器放在您喜欢的任何文件系统上.

You can create a docker container and install your dependencies in there and do all your work in there. You can configure docker to put the docker containers on any filesystem you like.

任何不使用容器的方法都不太可能奏效,因为 AFAIK 大多数 Linux 发行版,包括 Debian,都不支持依赖重定位.尼克斯是个例外.所以容器可以解决这个问题.

Any approach that does not use containers is unlikely to work because AFAIK most Linux distributions, including Debian, do not support dependency relocation. Nix is an exception. So containers are a way around that.

这篇关于安装 Debian 8 软件包 &amp;依赖于指定的 fs 目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆