0

If I have a directory which contains a bare filesystem(ie bin, dev, home, lib, opt, media, etc) but without any of the drivers or programs or anything on it you might expect, how do you go about installing those things? I can't just use apt-get or whatever, because that would just put it on my main filesystem, not this mounted one. Is there a way to do this kind of thing?

  • 2
    chroot to it, as in askubuntu.com/a/28100/158442 or askubuntu.com/a/145253/158442 – muru Jun 24 '16 at 20:23
  • I tried chroot, but it says "failed to run command '/bin/bash': No such file or directory", even though I can see that /bin/bash does exist – Zephyr Jun 24 '16 at 20:43
  • Does /<mount-point>/bin/bash exist with all the required libraries? How did you create this directory? – muru Jun 24 '16 at 20:44
  • I didn't create it, I started out with a filesystem I downloaded, and it already had a few things in it, including bash – Zephyr Jun 24 '16 at 20:46
  • I have a few questions: a) are you running a 32-bit system? b) is the filesystem you are trying to chroot into a 64-bit system? c) does /<mount-point>/usr/bin/bash exist and d) does /bin/sh exist? – fosslinux Jun 24 '16 at 20:49
0

You can install from source and tell the system to compile the software with a specific path. Biggest issue: dependencies ... you need to sort those out yourself. And install them from source too.

I would advice to use a source-based distribution rather than Ubuntu if you want to go that path. Like Gentoo, LFS, Crux.

  • So if I drop the source files into the mounted filesystem, it will install there? Or do I need to do something specific to tell it where to install? – Zephyr Jun 24 '16 at 20:44
  • The latter. During compiling you provide a directory to use. – Rinzwind Jun 24 '16 at 20:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.