How can I manage (install packages, manage packages, check for updates and the like) for another Linux installation on another partition in the same machine?

I would be doing this from Ubuntu, and the second could be Fedora or Debian. Is that a kind of remote administration too, but on the same computer? And it would not be a one time shot, but regular work.

  • 4
    Please give us some details on your partitioning scheme. If you simply have all other systems on their own, single partitions (/etc, /usr etc on the same partition) it is very easy to do with chroot. – terdon Jan 3 '14 at 1:58
  • Yes, I have each system complete in its own partition, even with its own swap. – Quora Feans Jan 3 '14 at 13:06
  • In that case, my chroot suggestion should work for most use cases. – terdon Jan 3 '14 at 13:07

In the simplest scenario where each distribution has its own partition and everything necessary for the system to run is within that partition (you don't have separate partitions for /usr for example), you can do this with chroot:

I assume you have the partitions mounted somewhere, let's say they're at /Debian and /Fedora. Set up a chroot environment:

sudo chroot /Debian

That will move you into /Debian, running a shell that thinks you are root and running the installed Debian system. At this point, you can use apt-get as you would normally. When you're done, you can return to your session by running exit.

This should work perfectly well for simple software management but I wouldn't run major updates or changes to important packages this way.

| improve this answer | |
  • 1
    I think i miss interpreted some events on my system. I will follow your suggestion it would be useful for me if it works fine. Here i remove all objections. and thanks for your explanations. – Slyx Jan 3 '14 at 3:32
  • 1
    @Slyx you may have been thinking of pivot_root. that would fit the results you described. – strugee Jan 3 '14 at 3:42
  • @strugee : Strongly probable ! It was many years ago. I don't have a real elephant memory to confirm for sure :-) I'll try both mechanisms soon and put a feedback. – Slyx Jan 3 '14 at 3:52
  • @Slyx don't try them without reading the manpages. chroot is ok to play with but pivot_root is dangerous – strugee Jan 3 '14 at 3:56

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.