Installing Debian 8 packages & dependencies to a specified fs directory

て烟熏妆下的殇ゞ 提交于 2019-12-14 03:29:30

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/50517019/installing-debian-8-packages-dependencies-to-a-specified-fs-directory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!