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

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

问题描述

我是Debian 8的新手,还是Linux的新手。我目前正在Windows 10中运行Debian 8 Oracle VM Virtualbox,以供参考。



对于我正在从事的项目,我的任务是从源软件包中安装Debian 8软件包。到指定的rootfs文件夹。获取源文件(.tar.gz,.diff.gz,.dsc)并解压缩它们后,我运行:

  dpkg-source -x< package> .dsc 

将源提取到工作目录中。 / p>

我遇到的问题是从提取的文件中生成.deb文件。做到这一点的标准方法是让apt通过以下方式处理在线存储库中依赖项的安装:

  apt-get build -dep< package> 

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

  dpkg-buildpackage -b 

但这将安装对我的rootfs的依赖。另外,由于我将大多数软件包都下载到了本地计算机上,所以我希望能够从本地源软件包而不是在线手动安装每个依赖项。



据我了解,我的任务是避免用文档和非必需文件污染指定的fs,因为要添加到该fs的Debian 8软件包的数量> 700。



如果根据我对Linux和Linux的了解,有任何错误/误解Debian 8,请让我知道。

解决方案

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



任何不使用容器的方法都不可行,因为AFAIK大多数Linux发行版(包括Debian,不支持依赖项重定位。 Nix是一个例外。所以容器就是解决这个问题的方法。


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.

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

Which extracts the source to the working directory.

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>

then generate the .deb files via:

dpkg-buildpackage -b

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.

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.

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

解决方案

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.

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天全站免登陆