Apply Debian and Schroot to install Ubuntu, CentOS Environment

Source: Internet
Author: User

Sometimes we need to run the latest Linux, but some software depends on other Linux versions. In addition to virtual machines and Docker, you can also use the Chroot method.


Background introduction

Debian: Is the source of Ubuntu. Includes the most up-to-date open source packages. However, because of the lack of business support and the release time is too long, so there is Ubuntu.

Debian is divided into three versions:

Stable: Stable version, can be used commercially. Each release version has a character name for Toy Story.

Testing: The next stable, but it's not yet published, probably because the release plan is not yet available (for example, other features are not yet complete, such as large software such as Gnone KDE).

Unstable: Contains the latest software. Basically used for development is no problem. Also called SID.

chroot: Let the software run root directory switch to another subdirectory. The chroot process can only access and use files and libraries in this subdirectory, and cannot access the original root directory. Used for directory isolation.

Chroot is not the same as virtualization. Because only the process runtime environment is independent (environment variables, runtime, root directory), the other uses the parent system (kernel, startup script, etc.)

schroot: Before chroot, we need to do some preparatory work, such as Mount/proc/sys/dev to the new root directory, as well as some directories accessible to the new root also use the-rbind way to mount to the new Roo The access point of the T directory.

Also run some startup scripts after the chroot succeeds.

Schroot do these things.


Installing Debian

When installing Debian, 3 partitions are generally used, and it is best not to use LVM (LVM is not good to recover when reloading). :

/30G, EXT4, physical partition, bootable. Put Debian, CentOS Ubuntu.

/home/build can generally consider 100G above, put code

Swap Leave a 4 G meaning.


Installing CentOS 6.7 in Debian

CentOS can be copied from other machines, or it can be installed on Debian.

In order to simply suggest copying an available root file system directly to the/home/centos/(installation directory).

If you want to study your installation, or just want to install the simplest centos (without the need for a GUI and other packages), use the following method:

Install yum, and use 163 sources.

Apt-get Install YUMCD/ETC/YUM/REPOS.D/MV Centos-base.repo centos-base.repo.backupwget http://mirrors.163.com/.help/ CENTOS6-BASE-163.REPOMV Centos6-base-163.repo Centos-base.repo


2. Installing the base system

rm      -rf  /home/centosmkdir -p /home/centos/var/lib/ rpmrpm    --rebuilddb --root=/home/centos/wget   http:// mirrors.163.com/centos/6.7/os/x86_64/packages/centos-release-6-7.el6.centos.12.3.x86_64.rpmrpm     -ivh --root==/home/centos/ --nodeps centos-release-6-7.el6.centos.12.3.x86_64. Rpmyum   --installroot=/home/centos/ install -y rpm-build yummkdir -p  /home/centos/procmkdir -p /home/centos/devmkdir -p /home/centos/sys cp / etc/resolv.conf /home/centos/etc/  cp /etc/yum/repos.d/centos-base.repo /home/centos/ etc/yum.repos.d/echo  "If [ -f ~/.bashrc ]; then . ~/.bashrc; fi"  > /home/centos/root/.bash_profileecho  ' ps1=\ ' \033[1;93;45m${debian_chroot:+ ($debian _chroot) }\033[0m\[\033[01;32m\]\[email protecTed]\[\033[01;34m\]\w\[\033[00m\]\$ \ '  >> /HOME/CENTOS/ROOT/.BASHRC 

Installing Ubuntu 1404 in Debian

In order to simply suggest copying an available root file system directly to the/home/ubuntu/(installation directory).

If you want to study your installation, or just want to install the simplest Ubuntu1404 (without the need for a GUI, etc.), you can try the following methods:

apt-get install debootstrapwget http://mirrors.163.com/ubuntu/pool/main/d/debootstrap/ debootstrap_1.0.72ubuntu1_all.debar vx debootstrap_1.0.72ubuntu1_all.debtar xzf  Data.tar.gzcp usr/share/debootstrap/scripts/gutsy /usr/share/debootstrap/scripts/trusty rm       -rf  /home/ubuntumkdir /home/ubuntu/ debootstrap  --arch and64 trusty /home/ubuntu/ http://mirrors.163.com/ubuntumkdir -p /home/ ubuntu/procmkdir -p /home/ubuntu/devmkdir -p /home/ubuntu/sys cp /etc/ resolv.conf /home/ubuntu/etc/echo  ' Deb http://mirrors.163.com/ubuntu trusty main  multiverse '  > /home/ubuntu/etc/apt/sources.listecho  ' IF [ -F ~/.BASHRC  ]; then . ~/.bashrc; fi " > /home/ubuntu/root/.profileecho  ' ps1=\ ' \ 033[1;93;44m${debian_chroot:+ ($debian _chroot)}\033[0M\[\033[01;32m\]\[email protected]\[\033[01;34m\]\w\[\033[00m\]\$ \ '  >> /home/ Ubuntu/root/.bashrc


Installing Schroot in Debian for the management of UBUNTU 1404/centos 6.7

Apt-get Install Schroot

Add the following line to the/etc/schroot/schroot.conf and put the original content out:

[Centos]description=centos 6 (AMD64) directory=/home/centosroot-users=rootroot-groups=roottype=directoryaliases= Rh,default,67,c#preserve-environment=true#personality=linux32[ubuntu]description=ubuntu Trusty (AMD64) directory= /home/ubunturoot-users=rootroot-groups=roottype=directoryaliases=trusty,1404,u

Start

Start Ubuntu

Schroot-c u

Starting CentOS 6.7

Schroot-c C


This article is from the "11172063" blog, please be sure to keep this source http://11182063.blog.51cto.com/11172063/1795906

Apply Debian and Schroot to install Ubuntu, CentOS Environment

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.