Debian 手动安装
译者:飞龙
自豪地采用谷歌翻译
尽管这个部分很啰嗦,但是不推荐给那些不熟悉 VirtualBox 和 Debian 的人。此外,它是为 Windows 编写的,如果你使用其他系统,我希望,对本指南进行适当的替换相当容易。
首先,下载你需要的东西:
- 下载并安装 VirtualBox。
- 下载最新的 Debian 6 Squeeze CD 映像。你需要第一张 CD,例如
debian-6.0.5-amd64-CD-1.iso
。
对于 Windows 用户,你需要下载 putty。你需要这个文件:putty.exe
。它不需要安装,你可以像这样运行它。
Debian 安装指南
启动 VirtualBox。
按下
New
按钮来创建新的虚拟机。在Name
字段中输入vm1
,之后选择Operating System: Linux, Version: Debian (64 bit)
,之后按下Next >
。从内存至少选择
512 MB
。如果你的机子上安装了足够的 RAM,1024 GB
也可以。按下Next >
。这里只需按下
Next >
。选择
VDI (VirtualBox Disk Image)
,并按下Next >
。选择
Dynamically allocated
,并按下Next >
。在
Location
中输入vm1
,并按下Next >
。点击
Create
。选择
vm1
并点击Start
。点击
Next >
。点击
folder button
。浏览并选择你的
Debian 6 Squeeze CD-image
,点击Open
。点击
Next >
。点击
Start
。关闭烦人的 VirtualBox 窗口。点击 VirtualBox 窗口内部并按下
<ENTER>
。按下
<ENTER>
。按下
<ENTER>
。译者注:这里你可以选“中文(简体)”。
按下
<ENTER>
。译者注:这里你可以选“HongKong”。
按下
<ENTER>
。输入
vm1
并按下<ENTER>
。输入
site
并按下<ENTER>
。输入
123qwe
并按下<ENTER>
。输入
123qwe
并按下<ENTER>
。输入
user1
并按下<ENTER>
。按下
<ENTER>
。输入
123qwe
并按下<ENTER>
。输入
123qwe
并按下<ENTER>
。如果你不知道这里做什么,只需按下
<ENTER>
。选择
Guided partitioning
并按下<ENTER>
。选择
Guided – use entire disk
并按下<ENTER>
。再次按下
<ENTER>
。选择
eparate /home, /usr, /var, and /tmp partitions
并按下<ENTER>
。选择
Finish partitioning and write changes to disk
并按下<ENTER>
。选择
<Yes>
并按下<ENTER>
。选择
<No>
并按下<ENTER>
。选择
<Yes>
并按下<ENTER>
。选择
ftp.egr.msu.edu
并按下<ENTER>
。如果出现错误,选择其它的东西。再次按下
<ENTER>
。选择
<No>
并按下<ENTER>
。使用
<SPACE>
选择SSH server and Standard system utilities
,并按下<ENTER>
。选择
<Yes>
并按下<ENTER>
。选择
<Continue>
并按下<ENTER>
。你新安装的 Debian 会重启。点击
Devices
并选择Network adapters
。点击
Port Forwarding
。点击
Plus
按钮。在
Host Port
中输入22
,Guest Port
中输入22
,点击OK
。再次点击
OK
。让你的 Debian 系统运行一会儿。
启动
putty
,在Host Name
中输入localhost
(或 IP 地址),在Port
字段中输入22
。点击Open
。点击
Yes
。输入
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#
解释
- 使你成为超级用户或
root
用户。 - 你在安装过程中输入的
root
密码。 - 修改仓库文件,因此 Debian 将尝试仅仅从互联网安装新软件。
- 更新可用软件数据库。
- 安装
vim
,sudo
和parted
包。 - 将默认系统文本编辑器更改为
vim
。 - 允许你通过修改
sudo
配置文件成为超级用户,而不输入密码。 - 将你添加到
sudo
组,以便你可以通过sudo
成为root
。 - 检查你是否能够成为
root
。