How to install the chroot environment for CentOS

Source: Internet
Author: User

Sometimes we have specific requirements for the OS environment for development, but do not want to affect the current system environment. Then we can use the chroot environment.
Please note that the installation of the chroot environment requires root privileges.
1) First, create a directory for the chroot environment, for example: Mkdir/data/jails/myos
2) Download and install the corresponding version of the Centos-release file from the official CentOS website or the image website, for example: wget centos-release-5-8.el5.centos.x86_64.rpmhttp:// Up.2cto.com/2012/0327/20120327042858716.rar
Rpm-i--nodeps--root=/data/jails/myos centos-release-5-8.el5.centos.x86_64.rpm 3) Install the Yum tool for the chroot environment, So we can go into the chroot environment and continue to install other packages: yum-y--installroot=/data/jails/myos install Yum
4) Mount some nodes to the chroot environment (not required here, but if www.2cto.com you need to open some services in the chroot environment, it's best to do it): Mount--bind/dev/data/jails/myos/dev Mount--bind/proc/data/jails/myos/proc Mount--bind/sys/data/jails/myos/sys
5) Set up, go in and adjust the time zone to be done: Chroot/data/jails/myos cp/usr/share/zoneinfo/asia/shanghai/etc/localtime Supplement) If you find a problem with your system network , perhaps your DNS settings are incorrect, please refer to the/etc/resolv.conf file in the main environment.
Author Fire meteor X

      • This article from: Hobby Linux Technology Network

How to install the chroot environment for CentOS

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.