Tuesday, April 30, 2024
 Popular · Latest · Hot · Upcoming
27
rated 0 times [  27] [ 0]  / answers: 1 / hits: 141116  / 2 Years ago, fri, june 10, 2022, 6:55:47

I'd like to install software packages, similar to apt-get install <foo> but:




  1. Without sudo, and

  2. Into a local directory



The purpose of this exercise is to isolate independent builds in my continuous integration server.



I don't mind compiling from source, if that's what it takes, but obviously I'd prefer the simplest approach possible. I tried apt-get source --compile <foo> as mentioned here but I can't get it working for packages like autoconf. I get the following error:



dpkg-checkbuilddeps: Unmet build dependencies: help2man



I've got help2man compiled in a local directory, but I don't know how to inform apt-get of that. Any ideas?



UPDATE: I found an answer that almost works at https://askubuntu.com/a/350/23678. The problem with chroot is that it requires sudo. The problem with apt-get source is that I don't know how to resolve dependencies. I must say, chroot looks very appealing. Is there an equivalent command that doesn't require sudo?


More From » apt

 Answers
5

This is, in general, not doable, because you would mess with the apt dependencies system.



There are two solutions:




  1. Install the source package, change into the source directory, configure and install the package irrespective of the packaging systems manually to a directory of your choice.



    apt-get source <package>


    This does not need root, downloads the package source, unpacks it in a directory within the current directory. You can then change to that directory, make modifications to the source, configure the installation to another target etc.



    Configuring to which installation directory the programs should go depends, however, on the particular program. Many programs use the ./configure --prefix localdir to target the installation to localdir; but this is by far not always the case.


  2. Create a chroot environment into which you will install the packages:



    debootstrap precise myfancyinstall


    Now you have created a dummy installation in the myfancyinstall/ directory



    chroot myfancyinstall


    You can use apt-get install within the chroot cage to install whatever you wish.



[#35283] Saturday, June 11, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
berlorful

Total Points: 346
Total Questions: 90
Total Answers: 99

Location: Monaco
Member since Tue, Nov 30, 2021
2 Years ago
berlorful questions
Thu, Sep 2, 21, 10:12, 3 Years ago
Sun, May 9, 21, 20:55, 3 Years ago
Mon, Jan 16, 23, 23:19, 1 Year ago
Mon, Aug 29, 22, 05:43, 2 Years ago
;