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?

Zephyr
  • 299
  • 3
  • 9
  • 2
    chroot to it, as in http://askubuntu.com/a/28100/158442 or http://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 //usr/bin/bash exist and d) does /bin/sh exist? – fosslinux Jun 24 '16 at 20:49
  • a.Maybe? b.yes c..yes d.yes – Zephyr Jun 26 '16 at 02:43

1 Answers1

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.

Rinzwind
  • 299,756
  • 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