免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1995 | 回复: 2
打印 上一主题 下一主题

mini安装debian lenny 小声的问一下 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-03-12 16:47 |只看该作者 |倒序浏览
只安装了基本部分,在software selection没选任何东东(也不选standard system),这样一来,很干净。比如:可以安装postfix,因为不想要exim4。。。。

请问:大家mini安装debian lenny 时,也是这样吗?

想了解一下

论坛徽章:
0
2 [报告]
发表于 2010-03-13 07:04 |只看该作者
  1. #
  2. # Debian 5 lenny 安装日志
  3. #
  4. # ==============================================================================
  5. # 用 ubuntu-8.04.3-desktop-amd64.iso 启动,更改 root 口令后打开其登录 shell
  6. sudo passwd root
  7. su -

  8. # 分区
  9. cfdisk /dev/sda

  10. # 创建文件系统
  11. mkfs.ext2 /dev/sda1
  12. mkfs.ext3 /dev/sda2
  13. mkfs.ext3 /dev/sda5
  14. tune2fs -c 127 /dev/sda1
  15. tune2fs -c 127 /dev/sda2
  16. tune2fs -c 127 /dev/sda5

  17. # 挂载
  18. mkdir /mnt/debian
  19. mount /dev/sda2 /mnt/debian
  20. mkdir /mnt/debian/boot /mnt/debian/home
  21. mount /dev/sda1 /mnt/debian/boot
  22. mount /dev/sda5 /mnt/debian/home

  23. # 我习惯把包缓存脱离根分区
  24. mkdir -p /mnt/debian/home/root/archives /mnt/debian/var/cache/apt
  25. ln -s ../../../home/root/archives /mnt/debian/var/cache/apt/

  26. # 随便
  27. ln -s . /mnt/ubuntu/boot/boot

  28. # ------------------------------------------------------------------------------
  29. # 下载 debootstrap
  30. wget http://ftp.tw.debian.org/debian/pool/main/d/debootstrap/debootstrap_1.0.10lenny1_all.deb

  31. # 安装 debootstrap
  32. dpkg -i debootstrap_1.0.10lenny1_all.deb

  33. # 运行 debootstrap 安装基本系统,版本代号 lenny
  34. debootstrap --arch amd64 lenny /mnt/debian http://ftp.tw.debian.org/debian/

  35. # ------------------------------------------------------------------------------
  36. # 文件系统表
  37. vi /etc/fstab {
  38. proc                /proc        proc        defaults        0 0

  39. /dev/sda1        /boot        ext2        noauto                        0 2
  40. /dev/sda2        /        ext3        errors=remount-ro        0 1
  41. /dev/sda5        /home        ext3        defaults                0 2
  42. #/dev/sda6        /vm        ext3        defaults                0 2
  43. #/dev/sda7        /pub        ext3        defaults                0 2
  44. }

  45. # ------------------------------------------------------------------------------
  46. # 网卡
  47. vi /mnt/debian/etc/network/interfaces {
  48. auto lo
  49. iface lo inet loopback

  50. auto eth0
  51. iface eth0 inet dhcp
  52. }

  53. # 路由配置,用 ubuntu livecd 会自动正确配置,可检查一下
  54. vi /mnt/debian/etc/resolv.conf {
  55. domain domain
  56. search domain
  57. nameserver 10.0.2.3
  58. }

  59. # 计算机名
  60. echo cp2 > /mnt/debian/etc/hostname

  61. # ------------------------------------------------------------------------------
  62. # 其它配置,习惯问题
  63. vi /mnt/debian/etc/inputrc {
  64. "\e[A": history-search-backward
  65. "\e[B": history-search-forward
  66. }

  67. vi /mnt/debian/root/.bashrc {
  68. export PS1='>$?< \W\$ '
  69. alias ls='ls -AF'
  70. date
  71. }

  72. # ------------------------------------------------------------------------------
  73. # 挂载 /proc 、/sys 和 /dev
  74. mount -t proc proc /mnt/debian/proc
  75. mount -t sysfs sysfs /mnt/debian/sys
  76. mount -o bind /dev /mnt/debian/dev

  77. # 换根
  78. LANG=C chroot /mnt/debian /bin/bash

  79. # 醒目
  80. export PS1='[chroot]>$?< \W\$ '

  81. # ==============================================================================
  82. # 导入 multimedia 、backports 源公钥
  83. pushd /tmp
  84. wget http://ftp.tw.debian.org/debian-multimedia/pool/main/d/debian-multimedia-keyring/debian-multimedia-keyring_2008.10.16_all.deb
  85. wget http://ftp.tw.debian.org/backports.org/pool/main/d/debian-backports-keyring/debian-backports-keyring_2009.02.20_all.deb
  86. dpkg -i debian-multimedia-keyring_2008.10.16_all.deb debian-backports-keyring_2009.02.20_all.deb
  87. popd

  88. # 设源
  89. vi /etc/apt/sources.list {
  90. deb http://ftp.tw.debian.org/debian lenny main contrib non-free

  91. #deb http://security.debian.org/debian-security lenny/updates main contrib non-free
  92. deb http://ftp.sjtu.edu.cn/debian-security lenny/updates main contrib non-free

  93. deb http://ftp.tw.debian.org/debian-volatile lenny/volatile main contrib non-free

  94. deb http://ftp.tw.debian.org/debian-multimedia lenny main

  95. deb http://ftp.tw.debian.org/backports.org lenny-backports main contrib non-free
  96. }

  97. # 刷表
  98. aptitude update

  99. # 更新
  100. aptitude safe-upgrade
  101. aptitude full-upgrade

  102. # ------------------------------------------------------------------------------
  103. # 若硬时钟非 UTC
  104. vi /etc/default/rcS {
  105. UTC=no
  106. }
  107. # 时区
  108. dpkg-reconfigure tzdata {
  109. Asia/Shanghai
  110. }

  111. # 本地化
  112. aptitude install -R locales
  113. dpkg-reconfigure locales {
  114. en_US.UTF-8        # 默认
  115. zh_CN.UTF-8
  116. }

  117. # 键盘
  118. aptitude install -R console-data console-tools console-common
  119. # 若上一命令执行时设置错了,可再次配置
  120. dpkg-reconfigure console-data

  121. # ------------------------------------------------------------------------------
  122. # 引导器
  123. # Debian 文档说先装内核再安装引导器,但尝试出错,只能先安装引导器。
  124. aptitude install -R grub-legacy
  125. grep -v rootfs /proc/mounts > /etc/mtab        <<<<<
  126. grub-install /dev/sda
  127. update-grub

  128. # 内核映象配置文件
  129. vi /etc/kernel-img.conf {
  130. # Kernel image management overrides
  131. # See kernel-img.conf(5) for details
  132. do_symlinks = yes
  133. relative_links = yes
  134. do_bootloader = no
  135. do_bootfloppy = no
  136. do_initrd = yes
  137. link_in_boot = no
  138. postinst_hook = update-grub
  139. postrm_hook = update-grub
  140. }

  141. # 内核
  142. aptitude search ^linux-image
  143. aptitude install -R linux-image-2.6-amd64

  144. # 检查或定制引导配置
  145. vi /boot/grub/menu.lst {
  146. }

  147. # ------------------------------------------------------------------------------
  148. # 保存一份包列表,以备日后研究
  149. dpkg -l > ~/pkg-000.lst

  150. # 设置口令
  151. passwd

  152. # 退出 chroot 环境
  153. exit

  154. # 卸载
  155. umount /mnt/debian/dev /mnt/debian/sys /mnt/debian/proc
  156. umount /mnt/debian/boot /mnt/debian/home /mnt/debian

  157. # 退出并重启
  158. exit

  159. # ==============================================================================
  160. # 重启进入新系统后

  161. # 后续安装……

复制代码

论坛徽章:
0
3 [报告]
发表于 2010-03-13 09:34 |只看该作者
自由建客 发表于 2010-03-13 07:04



    可以解释一下么
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP