If we install the Red Hat System then can we compile the other distros of linux on the Red Hat server system? If so, please provide me the tutorials and links.
First If by that you mean creating a custom Ubuntu or other distros yes you can and this action is not entirely distro-specific (i.e in your case Redhat).
For that you could use two diffrerent approaches. Either use automation tools such as linuxcoe and other different tools or go native and start by LFS (Linux From Scratch). Either way you have three things to consider:
- Your kernel
- Your GUI
- You distribution system
For the third option you could use other distros tools also (or write your own)
Or you meant to compile codes for other platforms which is something else and has more to do with your
make and build environment and coding skills (writing config files for example). you code do it in Jail env. or Virtual machine if you like.
Or perhaps you meant to access other distros inside a running RedHat.
In this case what you should consider the most is the arch of the Host and target system. This could be done by
Consider that you have the live image of some distro in
first you should mount your
mount -t proc proc /mnt/distro/proc mount --rbind /sys /mnt/distro/sys mount --rbind /dev /mnt/distro/dev
chrooting part you need to specify your environment completely to avoid problems in future.
chroot /mnt/distro /bin/env -i TERM=$TERM /bin/bash
Note: It is the base idea and the
env would be different in your case
The simplest and the most proper variant today is to install a target system as a virtual guest, using any kind of virtualization (from a simple
LXC and up to
VMWare, etc.) and then use distro-specific native tools.
You should think of some cross compilation without virtualization under very extreme circumstances.