How to install Debian Build-Depends and Depends

If I have a debian/control file with Build-Depends and Depends entries.

How to install both sets of dependencies?

I am currently using the following command to create a stub package that depends on Build-Depends but not Depends .

 $ mk-build-deps --build-dep \ && dpkg -i *.deb \ || apt-get update && apt-get install --fix-broken --yes \ 
+5
source share
1 answer

Assuming this is a standard package in your apt repositories, you should just run

 apt-get build-dep PACKAGE [PACKAGE…] 

In general, the best solution is to search for a package with the same dependencies (even better, an identical, but different version of the same package) and just build-dep . This solves 99 %% of these problems in my experience.


I don't know mk-build-deps , but you can run this to see what dependencies are causing in the debian/control file:

 echo $(sed -re '/^(Build-)?Depends:/,/^[^ ]/!d;//d' \ -e 's/^ //;s/[^a-z0-9-].*$//;/^$/d' PACKAGE/debian/control) 

(Here we look at the Debian control file for the Build-Depends and Depends lines and present only the listed dependencies, excluding any variables (which, I believe, are already included in other images from the file), as well as many exceptions ( //d removes the matching criteria for the end of the previous request, /^$/d deletes the lines emptied by the previous replacement, which removes versions, optional elements, variables, and commas.)

Replace echo with apt-get install if you want, but you may need to cut off the items you want to configure and / or install manually.

After that, you need to have an easier time with dpkg -i *.deb . Feel free to try apt-get install --fix-broken anytime if you are stuck.

+3
source

Source: https://habr.com/ru/post/1273838/


All Articles