• Debian 手动安装
    • Debian 安装指南
    • 你会看到什么
    • 解释

    Debian 手动安装

    原文:Manual Debian installation

    译者:飞龙

    协议:CC BY-NC-SA 4.0

    自豪地采用谷歌翻译

    尽管这个部分很啰嗦,但是不推荐给那些不熟悉 VirtualBox 和 Debian 的人。此外,它是为 Windows 编写的,如果你使用其他系统,我希望,对本指南进行适当的替换相当容易。

    首先,下载你需要的东西:

    • 下载并安装 VirtualBox。
    • 下载最新的 Debian 6 Squeeze CD 映像。你需要第一张 CD,例如debian-6.0.5-amd64-CD-1.iso

    对于 Windows 用户,你需要下载 putty。你需要这个文件:putty.exe。它不需要安装,你可以像这样运行它。

    Debian 安装指南

    1. 启动 VirtualBox。

      Debian 手动安装 - 图1

    2. 按下New按钮来创建新的虚拟机。在Name字段中输入vm1,之后选择Operating System: Linux, Version: Debian (64 bit),之后按下Next >

      Debian 手动安装 - 图2

    3. 从内存至少选择512 MB。如果你的机子上安装了足够的 RAM,1024 GB也可以。按下Next >

      Debian 手动安装 - 图3

    4. 这里只需按下Next >

      Debian 手动安装 - 图4

    5. 选择VDI (VirtualBox Disk Image),并按下Next >

      Debian 手动安装 - 图5

    6. 选择Dynamically allocated,并按下Next >

      Debian 手动安装 - 图6

    7. Location中输入vm1,并按下Next >

      Debian 手动安装 - 图7

    8. 点击Create

      Debian 手动安装 - 图8

    9. 选择vm1并点击Start

      Debian 手动安装 - 图9

    10. 点击Next >

      Debian 手动安装 - 图10

    11. 点击folder button

      Debian 手动安装 - 图11

    12. 浏览并选择你的Debian 6 Squeeze CD-image,点击Open

      Debian 手动安装 - 图12

    13. 点击Next >

      Debian 手动安装 - 图13

    14. 点击Start

      Debian 手动安装 - 图14

    15. 关闭烦人的 VirtualBox 窗口。点击 VirtualBox 窗口内部并按下<ENTER>
      Debian 手动安装 - 图15

    16. 按下<ENTER>

      Debian 手动安装 - 图16

    17. 按下<ENTER>

      译者注:这里你可以选“中文(简体)”。

      Debian 手动安装 - 图17

    18. 按下<ENTER>

      译者注:这里你可以选“HongKong”。

      Debian 手动安装 - 图18

    19. 按下<ENTER>

      Debian 手动安装 - 图19

    20. 输入vm1并按下<ENTER>

      Debian 手动安装 - 图20

    21. 输入site并按下<ENTER>

      Debian 手动安装 - 图21

    22. 输入123qwe并按下<ENTER>

      Debian 手动安装 - 图22

    23. 输入123qwe并按下<ENTER>

      Debian 手动安装 - 图23

    24. 输入user1并按下<ENTER>

      Debian 手动安装 - 图24

    25. 按下<ENTER>

      Debian 手动安装 - 图25

    26. 输入123qwe并按下<ENTER>

      Debian 手动安装 - 图26

    27. 输入123qwe并按下<ENTER>

      Debian 手动安装 - 图27

    28. 如果你不知道这里做什么,只需按下<ENTER>

      Debian 手动安装 - 图28

    29. 选择Guided partitioning并按下<ENTER>

      Debian 手动安装 - 图29

    30. 选择Guided – use entire disk并按下<ENTER>

      Debian 手动安装 - 图30

    31. 再次按下<ENTER>

      Debian 手动安装 - 图31

    32. 选择eparate /home, /usr, /var, and /tmp partitions并按下<ENTER>

      Debian 手动安装 - 图32

    33. 选择Finish partitioning and write changes to disk并按下<ENTER>

      Debian 手动安装 - 图33

    34. 选择<Yes>并按下<ENTER>

      Debian 手动安装 - 图34

    35. 选择<No>并按下<ENTER>

      Debian 手动安装 - 图35

    36. 选择<Yes>并按下<ENTER>

      Debian 手动安装 - 图36

    37. 选择ftp.egr.msu.edu并按下<ENTER>。如果出现错误,选择其它的东西。

      Debian 手动安装 - 图37

    38. 再次按下<ENTER>

      Debian 手动安装 - 图38

    39. 选择<No>并按下<ENTER>

      Debian 手动安装 - 图39

    40. 使用<SPACE>选择SSH server and Standard system utilities,并按下<ENTER>

      Debian 手动安装 - 图40

    41. 选择<Yes>并按下<ENTER>

      Debian 手动安装 - 图41

    42. 选择<Continue>并按下<ENTER>。你新安装的 Debian 会重启。

      Debian 手动安装 - 图42

    43. 点击Devices并选择Network adapters

      Debian 手动安装 - 图43

    44. 点击Port Forwarding

      Debian 手动安装 - 图44

    45. 点击Plus按钮。

      Debian 手动安装 - 图45

    46. Host Port中输入22Guest Port中输入22,点击OK

      Debian 手动安装 - 图46

    47. 再次点击OK

      Debian 手动安装 - 图47

    48. 让你的 Debian 系统运行一会儿。

      Debian 手动安装 - 图48

    49. 启动putty,在Host Name中输入localhost(或 IP 地址),在Port字段中输入22。点击Open

      Debian 手动安装 - 图49

    50. 点击Yes

      Debian 手动安装 - 图50

    51. 输入user1,点击<ENTER>。输入123qwe,并再输入一次,来真正享受你的作品吧。

      Debian 手动安装 - 图51

    你以为这就完了吗?现在将这些输入putty,通过按下<ENTER>结束每个命令:

    1. 1: su
    2. 2: 123qwe
    3. 3: sed -i '/^deb cdrom.*$/d' /etc/apt/sources.list
    4. 4: aptitude update
    5. 5: aptitude install vim sudo parted

    询问时,输入y并按下<ENTER>

    1. 6: update-alternatives --config editor

    询问时,输入3并按下<ENTER>

    1. 7: sed -i 's/%sudo ALL=(ALL) ALL/%sudo ALL=(ALL) NOPASSWD:ALL/' /etc/sudoers
    2. 8: usermod user1 -G sudo

    关闭putty,再次打开它,并作为user1登入vm1,输入这个:

    1. 9: sudo -s

    如果你得到了root@vm1:/home/user1#,那么一切正常,开瓶啤酒奖励自己吧。

    你会看到什么

    1. user1@vm1:~$ su
    2. Password:
    3. root@vm1:/home/user1# sed -i '/^deb cdrom.*$/d' /etc/apt/sources.list
    4. root@vm1:/home/user1# aptitude update
    5. Hit http://security.debian.org squeeze/updates Release.gpg
    6. Ign http://security.debian.org/ squeeze/updates/main Translation-en
    7. Ign http://security.debian.org/ squeeze/updates/main Translation-en_US
    8. Hit http://security.debian.org squeeze/updates Release
    9. Hit http://ftp.egr.msu.edu squeeze Release.gpg
    10. Hit http://security.debian.org squeeze/updates/main Sources
    11. Hit http://security.debian.org squeeze/updates/main amd64 Packages
    12. Ign http://ftp.egr.msu.edu/debian/ squeeze/main Translation-en
    13. Ign http://ftp.egr.msu.edu/debian/ squeeze/main Translation-en_US
    14. Hit http://ftp.egr.msu.edu squeeze-updates Release.gpg
    15. Ign http://ftp.egr.msu.edu/debian/ squeeze-updates/main Translation-en
    16. Ign http://ftp.egr.msu.edu/debian/ squeeze-updates/main Translation-en_US
    17. Hit http://ftp.egr.msu.edu squeeze Release
    18. Hit http://ftp.egr.msu.edu squeeze-updates Release
    19. Hit http://ftp.egr.msu.edu squeeze/main Sources
    20. Hit http://ftp.egr.msu.edu squeeze/main amd64 Packages
    21. Get:1 http://ftp.egr.msu.edu squeeze-updates/main Sources/DiffIndex [2,161 B]
    22. Hit http://ftp.egr.msu.edu squeeze-updates/main amd64 Packages/DiffIndex
    23. Hit http://ftp.egr.msu.edu squeeze-updates/main amd64 Packages
    24. Fetched 2,161 B in 3s (603 B/s)
    25. root@vm1:/home/user1# aptitude install vim sudo parted
    26. The following NEW packages will be installed:
    27. libparted0debian1{a} parted sudo vim vim-runtime{a}
    28. 0 packages upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
    29. Need to get 8,231 kB of archives. After unpacking 29.8 MB will be used.
    30. Do you want to continue? [Y/n/?] y
    31. Get:1 http://security.debian.org/ squeeze/updates/main sudo amd64 1.7.4p4-2.squeeze.3 [610 kB]
    32. Get:2 http://ftp.egr.msu.edu/debian/ squeeze/main libparted0debian1 amd64 2.3-5 [341 kB]
    33. Get:3 http://ftp.egr.msu.edu/debian/ squeeze/main parted amd64 2.3-5 [156 kB]
    34. Get:4 http://ftp.egr.msu.edu/debian/ squeeze/main vim-runtime all 2:7.2.445+hg~cb94c42c0e1a-1 [6,207 kB]
    35. Get:5 http://ftp.egr.msu.edu/debian/ squeeze/main vim amd64 2:7.2.445+hg~cb94c42c0e1a-1 [915 kB]
    36. Fetched 8,231 kB in 1min 18s (105 kB/s)
    37. Selecting previously deselected package libparted0debian1.
    38. (Reading database ... 34745 files and directories currently installed.)
    39. Unpacking libparted0debian1 (from .../libparted0debian1_2.3-5_amd64.deb) ...
    40. Selecting previously deselected package parted.
    41. Unpacking parted (from .../parted_2.3-5_amd64.deb) ...
    42. Selecting previously deselected package sudo.
    43. Unpacking sudo (from .../sudo_1.7.4p4-2.squeeze.3_amd64.deb) ...
    44. Selecting previously deselected package vim-runtime.
    45. Unpacking vim-runtime (from .../vim-runtime_2%3a7.2.445+hg~cb94c42c0e1a-1_all.deb) ...
    46. Adding 'diversion of /usr/share/vim/vim72/doc/help.txt to /usr/share/vim/vim72/doc/help.txt.vim-tiny by vim-runtime'
    47. Adding 'diversion of /usr/share/vim/vim72/doc/tags to /usr/share/vim/vim72/doc/tags.vim-tiny by vim-runtime'
    48. Selecting previously deselected package vim.
    49. Unpacking vim (from .../vim_2%3a7.2.445+hg~cb94c42c0e1a-1_amd64.deb) ...
    50. Processing triggers for man-db ...
    51. Setting up libparted0debian1 (2.3-5) ...
    52. Setting up parted (2.3-5) ...
    53. Setting up sudo (1.7.4p4-2.squeeze.3) ...
    54. No /etc/sudoers found... creating one for you.
    55. Setting up vim-runtime (2:7.2.445+hg~cb94c42c0e1a-1) ...
    56. Processing /usr/share/vim/addons/doc
    57. Setting up vim (2:7.2.445+hg~cb94c42c0e1a-1) ...
    58. update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vim (vim) in auto mode.
    59. update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vimdiff (vimdiff) in auto mode.
    60. update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rvim (rvim) in auto mode.
    61. update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rview (rview) in auto mode.
    62. update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vi (vi) in auto mode.
    63. update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/view (view) in auto mode.
    64. update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/ex (ex) in auto mode.
    65. root@vm1:/home/user1# update-alternatives --config editor
    66. There are 3 choices for the alternative editor (providing /usr/bin/editor).
    67. Selection Path Priority Status
    68. ------------------------------------------------------------
    69. * 0 /bin/nano 40 auto mode
    70. 1 /bin/nano 40 manual mode
    71. 2 /usr/bin/vim.basic 30 manual mode
    72. 3 /usr/bin/vim.tiny 10 manual mode
    73. Press enter to keep the current choice[*], or type selection number: 3
    74. update-alternatives: using /usr/bin/vim.tiny to provide /usr/bin/editor (editor) in manual mode.
    75. root@vm1:/home/user1# sed -i 's/%sudo ALL=(ALL) ALL/%sudo ALL=(ALL) NOPASSWD:ALL/' /etc/sudoers
    76. root@vm1:/home/user1# usermod user1 -G sudo
    77. root@vm1:/home/user1#

    解释

    1. 使你成为超级用户或root用户。
    2. 你在安装过程中输入的root密码。
    3. 修改仓库文件,因此 Debian 将尝试仅仅从互联网安装新软件。
    4. 更新可用软件数据库。
    5. 安装vimsudoparted包。
    6. 将默认系统文本编辑器更改为vim
    7. 允许你通过修改sudo配置文件成为超级用户,而不输入密码。
    8. 将你添加到sudo组,以便你可以通过sudo成为root
    9. 检查你是否能够成为root