Skip to content

Latest commit

 

History

History
354 lines (227 loc) · 13.8 KB

mdi.md

File metadata and controls

354 lines (227 loc) · 13.8 KB

Debian 手动安装

原文:Manual Debian installation

译者:飞龙

协议:CC BY-NC-SA 4.0

自豪地采用谷歌翻译

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

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

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

Debian 安装指南

  1. 启动 VirtualBox。

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

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

  4. 这里只需按下Next >

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

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

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

  8. 点击Create

  9. 选择vm1并点击Start

  10. 点击Next >

  11. 点击folder button

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

  13. 点击Next >

  14. 点击Start

  15. 关闭烦人的 VirtualBox 窗口。点击 VirtualBox 窗口内部并按下<ENTER>

  16. 按下<ENTER>

  17. 按下<ENTER>

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

  18. 按下<ENTER>

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

  19. 按下<ENTER>

  20. 输入vm1并按下<ENTER>

  21. 输入site并按下<ENTER>

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

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

  24. 输入user1并按下<ENTER>

  25. 按下<ENTER>

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

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

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

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

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

  31. 再次按下<ENTER>

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

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

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

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

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

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

  38. 再次按下<ENTER>

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

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

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

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

  43. 点击Devices并选择Network adapters

  44. 点击Port Forwarding

  45. 点击Plus按钮。

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

  47. 再次点击OK

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

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

  50. 点击Yes

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

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

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

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

6: update-alternatives --config editor

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

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

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

9: sudo -s

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

你会看到什么

user1@vm1:~$ su
Password:
root@vm1:/home/user1# sed -i '/^deb cdrom.*$/d' /etc/apt/sources.list
root@vm1:/home/user1# aptitude update
Hit http://security.debian.org squeeze/updates Release.gpg
Ign http://security.debian.org/ squeeze/updates/main Translation-en
Ign http://security.debian.org/ squeeze/updates/main Translation-en_US
Hit http://security.debian.org squeeze/updates Release
Hit http://ftp.egr.msu.edu squeeze Release.gpg
Hit http://security.debian.org squeeze/updates/main Sources
Hit http://security.debian.org squeeze/updates/main amd64 Packages
Ign http://ftp.egr.msu.edu/debian/ squeeze/main Translation-en
Ign http://ftp.egr.msu.edu/debian/ squeeze/main Translation-en_US
Hit http://ftp.egr.msu.edu squeeze-updates Release.gpg
Ign http://ftp.egr.msu.edu/debian/ squeeze-updates/main Translation-en
Ign http://ftp.egr.msu.edu/debian/ squeeze-updates/main Translation-en_US
Hit http://ftp.egr.msu.edu squeeze Release
Hit http://ftp.egr.msu.edu squeeze-updates Release
Hit http://ftp.egr.msu.edu squeeze/main Sources
Hit http://ftp.egr.msu.edu squeeze/main amd64 Packages
Get:1 http://ftp.egr.msu.edu squeeze-updates/main Sources/DiffIndex [2,161 B]
Hit http://ftp.egr.msu.edu squeeze-updates/main amd64 Packages/DiffIndex
Hit http://ftp.egr.msu.edu squeeze-updates/main amd64 Packages
Fetched 2,161 B in 3s (603 B/s)
root@vm1:/home/user1# aptitude install vim sudo parted
The following NEW packages will be installed:
  libparted0debian1{a} parted sudo vim vim-runtime{a}
0 packages upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 8,231 kB of archives. After unpacking 29.8 MB will be used.
Do you want to continue? [Y/n/?] y
Get:1 http://security.debian.org/ squeeze/updates/main sudo amd64 1.7.4p4-2.squeeze.3 [610 kB]
Get:2 http://ftp.egr.msu.edu/debian/ squeeze/main libparted0debian1 amd64 2.3-5 [341 kB]
Get:3 http://ftp.egr.msu.edu/debian/ squeeze/main parted amd64 2.3-5 [156 kB]
Get:4 http://ftp.egr.msu.edu/debian/ squeeze/main vim-runtime all 2:7.2.445+hg~cb94c42c0e1a-1 [6,207 kB]
Get:5 http://ftp.egr.msu.edu/debian/ squeeze/main vim amd64 2:7.2.445+hg~cb94c42c0e1a-1 [915 kB]
Fetched 8,231 kB in 1min 18s (105 kB/s)
Selecting previously deselected package libparted0debian1.
(Reading database ... 34745 files and directories currently installed.)
Unpacking libparted0debian1 (from .../libparted0debian1_2.3-5_amd64.deb) ...
Selecting previously deselected package parted.
Unpacking parted (from .../parted_2.3-5_amd64.deb) ...
Selecting previously deselected package sudo.
Unpacking sudo (from .../sudo_1.7.4p4-2.squeeze.3_amd64.deb) ...
Selecting previously deselected package vim-runtime.
Unpacking vim-runtime (from .../vim-runtime_2%3a7.2.445+hg~cb94c42c0e1a-1_all.deb) ...
Adding 'diversion of /usr/share/vim/vim72/doc/help.txt to /usr/share/vim/vim72/doc/help.txt.vim-tiny by vim-runtime'
Adding 'diversion of /usr/share/vim/vim72/doc/tags to /usr/share/vim/vim72/doc/tags.vim-tiny by vim-runtime'
Selecting previously deselected package vim.
Unpacking vim (from .../vim_2%3a7.2.445+hg~cb94c42c0e1a-1_amd64.deb) ...
Processing triggers for man-db ...
Setting up libparted0debian1 (2.3-5) ...
Setting up parted (2.3-5) ...
Setting up sudo (1.7.4p4-2.squeeze.3) ...
No /etc/sudoers found... creating one for you.
Setting up vim-runtime (2:7.2.445+hg~cb94c42c0e1a-1) ...
Processing /usr/share/vim/addons/doc
Setting up vim (2:7.2.445+hg~cb94c42c0e1a-1) ...
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vim (vim) in auto mode.
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vimdiff (vimdiff) in auto mode.
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rvim (rvim) in auto mode.
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rview (rview) in auto mode.
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vi (vi) in auto mode.
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/view (view) in auto mode.
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/ex (ex) in auto mode.
root@vm1:/home/user1# update-alternatives --config editor
There are 3 choices for the alternative editor (providing /usr/bin/editor).
 
  Selection    Path                Priority   Status
------------------------------------------------------------
* 0            /bin/nano            40        auto mode
  1            /bin/nano            40        manual mode
  2            /usr/bin/vim.basic   30        manual mode
  3            /usr/bin/vim.tiny    10        manual mode
 
Press enter to keep the current choice[*], or type selection number: 3
update-alternatives: using /usr/bin/vim.tiny to provide /usr/bin/editor (editor) in manual mode.
root@vm1:/home/user1# sed -i 's/%sudo ALL=(ALL) ALL/%sudo ALL=(ALL) NOPASSWD:ALL/' /etc/sudoers
root@vm1:/home/user1# usermod user1 -G sudo
root@vm1:/home/user1#

解释

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