sudo debootstrap --arch [平臺] [發行版本代號] [目錄]
好比下面的命令git
sudo debootstrap --arch i386 trusty /mnt
便是構建x86(32位)平臺ubuntu最新發行版14.04(代號爲trusty)的基本系統,存放到/mnt目錄下。web
當前debootstrap支持的發行版本能夠在/usr/share/debootstrap/scripts查看,而各發行版代號,能夠到http://en.wikipedia.org/wiki/List_of_Ubuntu_releases查看。好比gutsy是7.10的代號,precise是12.04的代號,等等。編程
輸入上述命令後,就會從網絡下載相關的文件,當看到bootstrap
I: Configuring python-central... I: Configuring ubuntu-minimal... I: Configuring libc-bin... I: Configuring initramfs-tools... I: Base system installed successfully.
即表示成功。若是看到ubuntu
E: Failed getting release file http://archive.ubuntu.com/ubuntu/dists/trusty/Release
或卡在
I: Retrieving Release
則多是網絡緣由。
下載的文件在/mnt/var下,如:
$ tree . ├── debootstrap │ ├── debootstrap.log │ └── debpaths └── var ├── cache │ └── apt │ └── archives │ ├── adduser_3.113+nmu3ubuntu3_all.deb │ ├── apt_1.0.1ubuntu2_i386.deb
其中adduser_3.113是14.04對應的adduser。從這裏也能夠確認其下載的是哪一發行版的軟件。
下面使用chroot進入/mnt目錄,並查看linux版本。
latelee@ubuntu:~$ cd /mnt/ latelee@ubuntu: /mnt$ ls bin boot dev etc home lib media mnt opt proc root run sbin srv sys tmp usr var latelee@ubuntu: /mnt$ sudo -s [sudo] password for latelee: root@ubuntu: /mnt# chroot . root@ubuntu:/# ls bin boot dev etc home lib media mnt opt proc root run sbin srv sys tmp usr var root@ubuntu:/# cat etc/issue Ubuntu 14.04 LTS \n \l root@ubuntu:/# ls /proc/ -l total 0 root@ubuntu:/# ifconfig Warning: cannot open /proc/net/dev (No such file or directory). Limited output. root@ubuntu:/# uname -a Linux ubuntu 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:12 UTC 2014 i686 i686 i686 GNU/Linux
由於固然系統使用的並不這個新的系統,所以/proc並無內容,而內核依然是當前系統所用的版本。
使用光盤不成功
W: Failure trying to run: chroot /home/latelee/test_sys mount -t proc proc /proc W: See /home/latelee/test_sys/debootstrap/debootstrap.log for details
注:
本文並無過多技術含量,僅是在學習過程當中遇見了debootstrap而寫點筆記。本文所用環境均是虛擬機vmware。
附錄:
未完事宜:
限於時間,目前尚未實際啓動新的系統。
一些涉及到ubuntu根文件系統構建的資源:
https://wiki.ubuntu.com/DebootstrapChroot
https://help.ubuntu.com/10.04/installation-guide/i386/linux-upgrade.html
http://www.thegeekstuff.com/2010/01/debootstrap-minimal-debian-ubuntu-installation/
https://help.ubuntu.com/lts/installation-guide/i386/index.html
查看ubuntu各發行版本wiki:
http://en.wikipedia.org/wiki/List_of_Ubuntu_releases
查看ubuntu安裝包:
後記:本想寫稍有點技術含量的文章,把過程所涉及到的知識點都說起,但發現本身文筆不復如前,仍是按流水帳那樣寫出來比較暢快些。
李遲,寫於2014年10月20日中午休息前
近來經濟拮据,如本文對閣下有幫助,可慷慨解囊贊助筆者以輸出更多好文章。
支付寶readchy@163 或 微信fly_camel_fly 都可。感謝!
本文固定連接: http://www.latelee.org/using-gnu-linux/ubuntu-debootstrap.html
你可能感興趣的文章
- ubuntu系統debootstrap的使用之二:啓動
- 遇到一個Linux文件系統因bios時間錯誤變成只讀的問題
- Ubuntu定製live cd
- linux之行(4):上手
- linux下時區的一些認識
- Linux下小型web服務器boa的使用
- Linux下doxygen的使用
- 讓ubuntu開機快一點:記開機出現Waiting for network configuration…
- Ubuntu日誌的一些筆記
- minicom的使用
- linux時區的幾個代碼片斷
- Linux使用tcpdump抓獲取WIFI包
目前暫無評論
發表評論
![](http://static.javashuo.com/static/loading.gif)