LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1050|回复: 1

chroot 安装,最小化安装的起步

[复制链接]
发表于 2009-3-16 19:08:27 | 显示全部楼层 |阅读模式
我用 ubuntu-8.04-livecd 启动虚拟机参照 http://www.debian.org/releases/stable/amd64/apds03.html.zh_CN (通过 Unix/Linux 系统来安装 Debian GNU/Linux)安装,竟发现有些错误之处。现贴出整理后并实际通过安装的步骤。


  1. // 分区、创建文件系统、挂载于 /mnt/debian

  2. // 下载、安装 debootstrap
  3. wget http://ftp.debian.org/debian/pool/main/d/debootstrap/debootstrap_1.0.11_all.deb
  4. dpkg -i debootstrap_1.0.11_all.deb

  5. // 运行 debootstrap 安装基本系统
  6. debootstrap --arch amd64 lenny /mnt/debian http://ftp.debian.org/debian/

  7. // 挂载/proc和/dev
  8. mount -t proc proc /mnt/debian/proc
  9. mount -o bind /dev /mnt/debian/dev

  10. // 换根
  11. LANG=C chroot /mnt/debian /bin/bash
  12. export PS1='[chroot]\W\$ '
  13. alias ls='ls -AF'

  14. //------------------------------------------------------------
  15. // 文件系统列表
  16. vi /etc/fstab {
  17. /dev/sda2        /        ext3        defaults        0 1
  18. /dev/sda1        none        swap        sw                0 0
  19. proc                /proc        proc        defaults        0 0
  20. }

  21. // 网络
  22. vi /etc/network/interfaces {
  23. auto lo
  24. iface lo inet loopback

  25. auto eth0
  26. iface eth0 inet dhcp
  27. }

  28. vi /etc/hostname {
  29. debian
  30. }

  31. vi /etc/resolv.conf {
  32. }  //实际上 debootstrap 程序已经从宿主系统复制了一份,此处列出只为完整性

  33. // 软件源
  34. // 我用的就只是 http://ftp.debian.org/debian ,所以这一步并未更改什么
  35. vi /etc/apt/sources.list {
  36. }
  37. aptitude update

  38. // 时区
  39. vi /etc/default/rcS {
  40. UTC=no
  41. }  // 如果你的硬件时钟不是 UTC 的话
  42. dpkg-reconfigure tzdata

  43. // 本地化和键盘
  44. aptitude install locales
  45. dpkg-reconfigure locales
  46. aptitude install console-data

  47. //----------------------------------------------------------------
  48. // 先于内核安装 grub,后于内核则会出错
  49. aptitude install grub
  50. grub-install /dev/sda
  51. update-grub
  52. vi /boot/grub/menu.lst {
  53. }

  54. //----------------------------------------------------------------
  55. // 内核映象配置文件
  56. vi /etc/kernel-img.conf {
  57. # Kernel image management overrides
  58. # See kernel-img.conf(5) for details
  59. do_symlinks = yes
  60. relative_links = yes
  61. do_bootloader = no
  62. do_bootfloppy = no
  63. do_initrd = yes
  64. link_in_boot = no
  65. postinst_hook = update-grub
  66. postrm_hook = update-grub
  67. }

  68. // 查找安装内核
  69. aptitude search ^linux-image
  70. aptitude install linux-image-2.6-amd64

  71. //----------------------------------------------------------------
  72. // 密码
  73. passwd

  74. //---------------------------------------------------------------
  75. // 安装软件,请根据需要自行斟酌
  76. export LANG=zh_CN.UTF-8
  77. tasksel

复制代码
发表于 2009-3-17 09:39:24 | 显示全部楼层
不错不错!!!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表