{"id":947,"date":"2011-05-02T10:06:55","date_gmt":"2011-05-02T10:06:55","guid":{"rendered":"http:\/\/judepereira.com\/blog\/?p=947"},"modified":"2011-05-02T16:06:31","modified_gmt":"2011-05-02T10:36:31","slug":"bootstrap-centos-from-gentoo-or-any-linux-distribution","status":"publish","type":"post","link":"https:\/\/judepereira.com\/blog\/bootstrap-centos-from-gentoo-or-any-linux-distribution\/","title":{"rendered":"bootstrap CentOS from Gentoo (or any linux distribution)"},"content":{"rendered":"<p>To bootstrap CentOS in Gentoo, I did the following. It basically installs the essential CentOS components into the specified directory, and from there on, chroot into that directory and perform tests, etc.  First off, you&#8217;ll need to unmask a few packages(replace ~amd64 with ~x86 if your on the x86 architecture), and enable the flag sqlite for rpm. Execute the following commands as root:<\/p>\n<pre># echo sys-apps\/yum ~amd64 &gt;&gt; \/etc\/portage\/package.keywords\r\n# echo dev-python\/sqlitecachec ~amd64 &gt;&gt; \/etc\/portage\/package.keywords\r\n# echo app-arch\/rpm sqlite &gt;&gt; \/etc\/portage\/package.use<\/pre>\n<p>&nbsp;<br \/>\nNow we&#8217;re ready to install the primary packages required to bootstrap CentOS. Merge the following atoms: sys-apps\/yum app-arch\/rpm dev-python\/m2crypto as<\/p>\n<pre># emerge -avuDN sys-apps\/yum app-arch\/rpm dev-python\/m2crypto<\/pre>\n<p>&nbsp;<br \/>\nIn this example, we&#8217;ll bootstrap CentOS 5(x86_64). Download the stage2(sounds like gentoo now, huh?) from any CentOS mirror. The minimal stage2 does not work with this process.<\/p>\n<pre># wget http:\/\/mirrors.seas.harvard.edu\/centos\/5.6\/os\/x86_64\/images\/stage2.img<\/pre>\n<p>&nbsp;<br \/>\nYou need to extract the contents of this squashfs image file, so make sure you have =sys-fs\/squashfs-tools-3.1 installed. The latest one in portage is broken. Execute the following:<\/p>\n<pre>$ unsquashfs-3.1 -d \/devel\/centos5 stage2.img<\/pre>\n<p>&nbsp;<br \/>\nNow we have a working CentOS 5.6 installation. Install bash and yum into it before you can finally chroot.<\/p>\n<pre># yum --installroot \/devel\/centos5\/ --nogpgcheck install bash\r\n# yum --installroot \/devel\/centos5\/ --nogpgcheck install yum<\/pre>\n<p>&nbsp;<br \/>\nThe &#8211;nogpgcheck is so that yum doesn&#8217;t check the gpg keys which are currently missing on your host gentoo system, or any other non-rpm distribution.  chroot into \/devel\/centos5 and perform some cleaning:<\/p>\n<pre># chroot \/devel\/centos5\r\n# mkdir \/old\r\n# mv \/var\/lib\/rpm \/old\r\n# yum install yum\r\n<\/pre>\n<p>&nbsp;<br \/>\nWhat did you just do? Well the RPM DB generated by your host distribution&#8217;s RPM, will certainly not match CentOS&#8217;s yum, hence we remove the stale RPM database. Everything in the stage2 comprises only of the dependencies of yum and yum itself. Doing a yum install yum will fix everything.<br \/>\n&nbsp;<br \/>\nCongratulations, you now have the base CentOS installation in \/devel\/centos5  These instructions are not limited to Gentoo alone, but to any distribution.  Any questions may be posted as comments, and I&#8217;ll be glad to help you out.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To bootstrap CentOS in Gentoo, I did the following. It basically installs the essential CentOS components into the specified directory, and from there on, chroot into that directory and perform tests, etc. First off, you&#8217;ll need to unmask a few packages(replace ~amd64 with ~x86 if your on the x86 architecture), and enable the flag sqlite [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[11,10],"tags":[198,199,200,202,203,197,201,205,204,207,206,208],"class_list":["post-947","post","type-post","status-publish","format-standard","hentry","category-gen-sab-fed","category-linux","tag-bootstrap","tag-bootstrap-centos","tag-bootstrap-centos5","tag-bootstrapping-centos","tag-bootstrapping-centos-5","tag-centos","tag-centos-5-bootstrap","tag-centos-install-directory","tag-centos-minima","tag-centos-stage-install","tag-centos-stage2","tag-stage-2-centos-install"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pqtyx-fh","jetpack-related-posts":[{"id":1750,"url":"https:\/\/judepereira.com\/blog\/fbstart-accepts-matchbox-into-their-bootstrap-track\/","url_meta":{"origin":947,"position":0},"title":"FbStart accepts Matchbox into their Bootstrap track!","author":"Jude Pereira","date":"February 11, 2017","format":false,"excerpt":"\u00a0 This was\u00a0completely unexpected. Matchbox got accepted yesterday into FbStart's Bootstrap track, and has received a lot of freebies (worth $40K USD) to kickstart the platform's growth. Matchbox is born and bred in Mumbai, India. To be a part of the few apps in India to be accepted, means a\u2026","rel":"","context":"In &quot;miscellaneous&quot;","block_context":{"text":"miscellaneous","link":"https:\/\/judepereira.com\/blog\/category\/misc\/"},"img":{"alt_text":"FbStart accepts Matchbox","src":"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2017-02-11-at-15.28.58-1024x400.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2017-02-11-at-15.28.58-1024x400.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2017-02-11-at-15.28.58-1024x400.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2017-02-11-at-15.28.58-1024x400.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":893,"url":"https:\/\/judepereira.com\/blog\/coloured-varlogmessages-at-tty12\/","url_meta":{"origin":947,"position":1},"title":"Coloured \/var\/log\/messages at tty12","author":"Jude Pereira","date":"April 26, 2011","format":false,"excerpt":"Reading logs could never become any more easier, at just a keystroke, you have your logs displayed where you want, in some fancy colour. They look great too. TTY's can be accessed by pressing Alt + Ctrl + F[1 - 12] simultaneously. In the following, you'll get a decent, colourized\u2026","rel":"","context":"In &quot;another snippet | code&quot;","block_context":{"text":"another snippet | code","link":"https:\/\/judepereira.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":289,"url":"https:\/\/judepereira.com\/blog\/sabayon-four-oh\/","url_meta":{"origin":947,"position":2},"title":"Sabayon fOuR oH","author":"Jude Pereira","date":"June 16, 2009","format":false,"excerpt":"Based on Gentoo, Sabayon 4.1, tells me: Great performance with less RAM(though you need like 1GB RAM for it to work well enough). Package Management System is absolutely fantastic, with it's new \"Entropy\". Totally the perfect distribution. A fine distribution for the newbie or the expert. This is what a\u2026","rel":"","context":"In &quot;gnu linux&quot;","block_context":{"text":"gnu linux","link":"https:\/\/judepereira.com\/blog\/category\/linux\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":694,"url":"https:\/\/judepereira.com\/blog\/visual-basic-6-revisited-linux-wine\/","url_meta":{"origin":947,"position":3},"title":"visual basic 6 revisited &#8211; linux &#8211; wine","author":"Jude Pereira","date":"August 5, 2010","format":false,"excerpt":"Earlier this year, I had written an article on running Visual Basic 6 on linux under wine, this is an update for it, the prior one is deprecated Getting Visual Basic 6 to work on linux is pretty easy, not much trouble, all the basic things work, as of what\u2026","rel":"","context":"In &quot;another snippet | code&quot;","block_context":{"text":"another snippet | code","link":"https:\/\/judepereira.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2126,"url":"https:\/\/judepereira.com\/blog\/upgrading-to-debian-bookworm-on-qnap-ts-112-also-ts-11x-ts-12x\/","url_meta":{"origin":947,"position":4},"title":"Upgrading to Debian Bookworm on QNAP TS-112 (also TS-11x\/TS-12x)","author":"Jude Pereira","date":"October 16, 2024","format":false,"excerpt":"I decided to host Minio on a QNAP TS-112 device, bought from a second hand store. Here's a tale of me ditching the QNAP OS in favour of Debian Bookworm.","rel":"","context":"In &quot;gnu linux&quot;","block_context":{"text":"gnu linux","link":"https:\/\/judepereira.com\/blog\/category\/linux\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1830,"url":"https:\/\/judepereira.com\/blog\/ios-mac-ipsec\/","url_meta":{"origin":947,"position":5},"title":"How to tunnel all traffic from your iOS device to your own server via IPSec","author":"Jude Pereira","date":"May 11, 2018","format":false,"excerpt":"TL;DR: A DigitalOcean droplet, strongSwan, and a custom Configuration Profile for iOS routes all the traffic from my iPhone via my droplet. Why? Just because I can. Note: This setup does not require you to download Apple Configurator and switch your iPhone into Supervised mode (we will create a configuration\u2026","rel":"","context":"In &quot;gnu linux&quot;","block_context":{"text":"gnu linux","link":"https:\/\/judepereira.com\/blog\/category\/linux\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2018-05-10-at-20.34.32-1024x134.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2018-05-10-at-20.34.32-1024x134.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2018-05-10-at-20.34.32-1024x134.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/posts\/947","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/comments?post=947"}],"version-history":[{"count":16,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/posts\/947\/revisions"}],"predecessor-version":[{"id":963,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/posts\/947\/revisions\/963"}],"wp:attachment":[{"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/media?parent=947"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/categories?post=947"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/tags?post=947"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}