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包
目前暂无评论
发表评论
