1 分区
创建虚拟机结束后,点击开始,启动虚拟机(本教程的虚拟机初始硬盘大小为20G)
选择Boot Arch Linux(x86_64),之后进入控制台
输入fdisk /dev/sda
开始分区(第一块硬盘是sda,第二块硬盘是sdb)
fdisk命令教程
开始分区
输入n,新建分区
输入p, 新建主分区(默认为p,可直接回车)
输入分区编号1,然后提示输入开始区域,直接回车,然后提示输入结束区域,输入+10G,创建成功后讲提示创建成功。
命令p:列出分区后的结果
命令q:退出
命令w:保存分成结果
按照先前的步骤,依次创建200M和2G的主分区,剩余的磁盘空间创建为扩展分区(在Partition type时选e)。分区创建完成后一定记住输入命令w保存。
创建逻辑分区
在创建主分区和扩展分区结束后,就需要创建逻辑分区,扩展分区是不能直接使用的,必须再分成逻辑分区才可使用。
输入fdisk /dev/sda
再次进入分区界面:
输入n新建分区,这时会提示新建逻辑分区,编号为5,一直回车即可
现在看我们新建完成的分区
输入w,保存并退出。
1.1 创建文件分区
<span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"> </span><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"><span style="font-size: 18px; color: rgb(255, 0, 0);"><textarea readonly="readonly" name="code" class="c++"></span></span><code class="hljs avrasm has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">mkfs<span class="hljs-preprocessor" style="color: rgb(68, 68, 68); box-sizing: border-box;">.ext</span>4 /dev/sda1 mkfs<span class="hljs-preprocessor" style="color: rgb(68, 68, 68); box-sizing: border-box;">.ext</span>4 /dev/sda2 mkfs<span class="hljs-preprocessor" style="color: rgb(68, 68, 68); box-sizing: border-box;">.ext</span>4 /dev/sda5</code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li></ul><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 18px; line-height: 26px;"><span style="color: rgb(255, 0, 0);"></textarea></span></span>
创建swap分区:
<span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"> </span><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"><span style="font-size: 18px; color: rgb(255, 0, 0);"><textarea readonly="readonly" name="code" class="c++"></span></span><code class="hljs has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">mkswap /dev/sda3</code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li></ul><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 18px; line-height: 26px;"><span style="color: rgb(255, 0, 0);"></textarea></span></span>
启用swap分区:
<span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"> </span><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"><span style="font-size: 18px; color: rgb(255, 0, 0);"><textarea readonly="readonly" name="code" class="c++"></span></span><code class="hljs has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">swapon /dev/sda3</code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li></ul><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 18px; line-height: 26px;"><span style="color: rgb(255, 0, 0);"></textarea></span></span>
1.2 挂载分区
<span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"> </span><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"><span style="font-size: 18px; color: rgb(255, 0, 0);"><textarea readonly="readonly" name="code" class="c++"></span></span><code class="hljs perl has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">mount /dev/sda1 /mnt <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">mkdir</span> /mnt/boot mount /dev/sda2 /mnt/boot <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">mkdir</span> /mnt/home mount /dev/sda5 /mnt/home</code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li></ul><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 18px; line-height: 26px;"><span style="color: rgb(255, 0, 0);"></textarea></span></span>
2 安装系统
<span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"> </span><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"><span style="font-size: 18px; color: rgb(255, 0, 0);"><textarea readonly="readonly" name="code" class="c++"></span></span><code class="hljs cs has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">pacstrap -i /mnt <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">base</span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li></ul><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 18px; line-height: 26px;"><span style="color: rgb(255, 0, 0);"></textarea></span></span>
直接选择all就可以了,安装过程中如果有y/n?选择y。 等待安装完成
3 生成fstab
<span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"> </span><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"><span style="font-size: 18px; color: rgb(255, 0, 0);"><textarea readonly="readonly" name="code" class="c++"></span></span><code class="hljs lasso has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">genfstab <span class="hljs-attribute" style="box-sizing: border-box;">-U</span> <span class="hljs-attribute" style="box-sizing: border-box;">-p</span> /mnt <span class="hljs-subst" style="color: rgb(0, 0, 0); box-sizing: border-box;">>></span> /mnt/etc/fstab cat /mnt/etc/fstab</code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li></ul><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 18px; line-height: 26px;"><span style="color: rgb(255, 0, 0);"></textarea></span></span>
4 配置系统
<span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"> </span><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"><span style="font-size: 18px; color: rgb(255, 0, 0);"><textarea readonly="readonly" name="code" class="c++"></span></span><code class="hljs perl has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">arch-<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">chroot</span> /mnt</code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li></ul><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 18px; line-height: 26px;"><span style="color: rgb(255, 0, 0);"></textarea></span></span>
4.1 基本配置
基本系统配置:
1)修改语言编码
<span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"> </span><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"><span style="font-size: 18px; color: rgb(255, 0, 0);"><textarea readonly="readonly" name="code" class="c++"></span></span><code class="hljs avrasm has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-preprocessor" style="color: rgb(68, 68, 68); box-sizing: border-box;"># nano /etc/locale.gen</span> en_US<span class="hljs-preprocessor" style="color: rgb(68, 68, 68); box-sizing: border-box;">.UTF</span>-<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8</span> UTF-<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8</span> zh_CN<span class="hljs-preprocessor" style="color: rgb(68, 68, 68); box-sizing: border-box;">.UTF</span>-<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8</span> UTF-<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8</span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li></ul><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 18px; line-height: 26px;"><span style="color: rgb(255, 0, 0);"></textarea></span></span>
去掉前面的#,保存退出。
应用更改:
<span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"> </span><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"><span style="font-size: 18px; color: rgb(255, 0, 0);"><textarea readonly="readonly" name="code" class="c++"></span></span><code class="hljs vala has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-preprocessor" style="color: rgb(68, 68, 68); box-sizing: border-box;"># locale-gen</span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li></ul><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 18px; line-height: 26px;"><span style="color: rgb(255, 0, 0);"></textarea></span></span>
2) 修改语言:
<span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"> </span><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"><span style="font-size: 18px; color: rgb(255, 0, 0);"><textarea readonly="readonly" name="code" class="c++"></span></span><code class="hljs vala has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-preprocessor" style="color: rgb(68, 68, 68); box-sizing: border-box;"># echo LANG=en_US.UTF-8 > /etc/locale.conf</span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li></ul><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 18px; line-height: 26px;"><span style="color: rgb(255, 0, 0);"></textarea></span></span>
之后修改为zh_CN
先设置为US,以防出现乱码
3)设置时区
<span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"> </span><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"><span style="font-size: 18px; color: rgb(255, 0, 0);"><textarea readonly="readonly" name="code" class="c++"></span></span><code class="hljs vala has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-preprocessor" style="color: rgb(68, 68, 68); box-sizing: border-box;"># ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime</span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li></ul><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 18px; line-height: 26px;"><span style="color: rgb(255, 0, 0);"></textarea></span></span>
4)设置硬件时间
<span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"> </span><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"><span style="font-size: 18px; color: rgb(255, 0, 0);"><textarea readonly="readonly" name="code" class="c++"></span></span><code class="hljs brainfuck has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">#</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">hwclock</span> <span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">systohc</span> <span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">utc</span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li></ul><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 18px; line-height: 26px;"><span style="color: rgb(255, 0, 0);"></textarea></span></span>
5)设置网络
<span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"> </span><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"><span style="font-size: 18px; color: rgb(255, 0, 0);"><textarea readonly="readonly" name="code" class="c++"></span></span><code class="hljs avrasm has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">systemctl enable dhcpcd<span class="hljs-preprocessor" style="color: rgb(68, 68, 68); box-sizing: border-box;">.service</span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li></ul><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 18px; line-height: 26px;"><span style="color: rgb(255, 0, 0);"></textarea></span></span>
(确保Vmvare用的是网络地址转换(NAT))
6)设置root密码
<span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"> </span><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"><span style="font-size: 18px; color: rgb(255, 0, 0);"><textarea readonly="readonly" name="code" class="c++"></span></span><code class="hljs has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">passwd</code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li></ul><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 18px; line-height: 26px;"><span style="color: rgb(255, 0, 0);"></textarea></span></span>
4.2 安装引导
<span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"> </span><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"><span style="font-size: 18px; color: rgb(255, 0, 0);"><textarea readonly="readonly" name="code" class="c++"></span></span><code class="hljs lasso has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">pacman <span class="hljs-attribute" style="box-sizing: border-box;">-S</span> grub grub<span class="hljs-attribute" style="box-sizing: border-box;">-install</span> <span class="hljs-subst" style="color: rgb(0, 0, 0); box-sizing: border-box;">--</span>target<span class="hljs-subst" style="color: rgb(0, 0, 0); box-sizing: border-box;">=</span>i386<span class="hljs-attribute" style="box-sizing: border-box;">-pc</span> <span class="hljs-subst" style="color: rgb(0, 0, 0); box-sizing: border-box;">--</span>recheck /dev/sda</code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li></ul><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 18px; line-height: 26px;"><span style="color: rgb(255, 0, 0);"></textarea></span></span>
配置
<span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"> </span><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"><span style="font-size: 18px; color: rgb(255, 0, 0);"><textarea readonly="readonly" name="code" class="c++"></span></span><code class="hljs lasso has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">grub<span class="hljs-attribute" style="box-sizing: border-box;">-mkconfig</span> <span class="hljs-attribute" style="box-sizing: border-box;">-o</span> /boot/grub/grub<span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">.</span>cfg</code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li></ul><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 18px; line-height: 26px;"><span style="color: rgb(255, 0, 0);"></textarea></span></span>
5 卸载mnt重启
退出chroot
<span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"> </span><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"><span style="font-size: 18px; color: rgb(255, 0, 0);"><textarea readonly="readonly" name="code" class="c++"></span></span><code class="hljs bash has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">exit</span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li></ul><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 18px; line-height: 26px;"><span style="color: rgb(255, 0, 0);"></textarea></span></span>
卸载mnt
<span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"> </span><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"><span style="font-size: 18px; color: rgb(255, 0, 0);"><textarea readonly="readonly" name="code" class="c++"></span></span><code class="hljs has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">umount /mnt</code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li></ul><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 18px; line-height: 26px;"><span style="color: rgb(255, 0, 0);"></textarea></span></span>
重启
<span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"> </span><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"><span style="font-size: 18px; color: rgb(255, 0, 0);"><textarea readonly="readonly" name="code" class="c++"></span></span><code class="hljs has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">reboot</code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li></ul><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 18px; line-height: 26px;"><span style="color: rgb(255, 0, 0);"></textarea></span></span>
出现此界面表示成功,启动后输入登录名(root)和密码(xxx)。
6 新建账户
安装sudo :
<span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"> </span><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"><span style="font-size: 18px; color: rgb(255, 0, 0);"><textarea readonly="readonly" name="code" class="c++"></span></span><code class="hljs bash has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">pacman -S <span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">sudo</span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li></ul><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 18px; line-height: 26px;"><span style="color: rgb(255, 0, 0);"></textarea></span></span>
添加账户:
<span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"> </span><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"><span style="font-size: 18px; color: rgb(255, 0, 0);"><textarea readonly="readonly" name="code" class="c++"></span></span><code class="hljs lasso has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">useradd <span class="hljs-attribute" style="box-sizing: border-box;">-m</span> 用户名 <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//创建用户</span> passwad 用户名 <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//设置密码</span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li></ul><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 18px; line-height: 26px;"><span style="color: rgb(255, 0, 0);"></textarea></span></span>
为用户添加权限:
<span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"> </span><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"><span style="font-size: 18px; color: rgb(255, 0, 0);"><textarea readonly="readonly" name="code" class="c++"></span></span><code class="hljs has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">visudo</code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li></ul><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 18px; line-height: 26px;"><span style="color: rgb(255, 0, 0);"></textarea></span></span>
添加:
User_Alias ADMINS=用户名
Cmnd_Alias ADMINCOM=ALL
ADMINS ALL=(ALL)ADMINCOM
7 安装桌面环境
7.1 xorg
<span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"> </span><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"><span style="font-size: 18px; color: rgb(255, 0, 0);"><textarea readonly="readonly" name="code" class="c++"></span></span><code class="hljs lasso has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">pacman <span class="hljs-attribute" style="box-sizing: border-box;">-S</span> xorg<span class="hljs-attribute" style="box-sizing: border-box;">-server</span> xorg<span class="hljs-attribute" style="box-sizing: border-box;">-server</span><span class="hljs-attribute" style="box-sizing: border-box;">-utils</span> xorg<span class="hljs-attribute" style="box-sizing: border-box;">-xinit</span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li></ul><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 18px; line-height: 26px;"><span style="color: rgb(255, 0, 0);"></textarea></span></span>
7.2 显卡驱动
<span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"> </span><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"><span style="font-size: 18px; color: rgb(255, 0, 0);"><textarea readonly="readonly" name="code" class="c++"></span></span><code class="hljs lasso has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">pacman <span class="hljs-attribute" style="box-sizing: border-box;">-S</span> xf86<span class="hljs-attribute" style="box-sizing: border-box;">-video</span><span class="hljs-attribute" style="box-sizing: border-box;">-vesa</span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li></ul><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 18px; line-height: 26px;"><span style="color: rgb(255, 0, 0);"></textarea></span></span>
7.3 字体
<span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"> </span><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"><span style="font-size: 18px; color: rgb(255, 0, 0);"><textarea readonly="readonly" name="code" class="c++"></span></span><code class="hljs ruleslanguage has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-array" style="box-sizing: border-box;"># pacman </span>-S ttf-dejavu <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">// 英文字体</span> <span class="hljs-array" style="box-sizing: border-box;"># pacman </span>-S wqy-zenhei <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">// 中文字体</span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li></ul><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 18px; line-height: 26px;"><span style="color: rgb(255, 0, 0);"></textarea></span></span>
7.4 触摸板驱动
<span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"> </span><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"><span style="font-size: 18px; color: rgb(255, 0, 0);"><textarea readonly="readonly" name="code" class="c++"></span></span><code class="hljs lasso has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">pacman <span class="hljs-attribute" style="box-sizing: border-box;">-S</span> xf86<span class="hljs-attribute" style="box-sizing: border-box;">-input</span><span class="hljs-attribute" style="box-sizing: border-box;">-synaptics</span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li></ul><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 18px; line-height: 26px;"><span style="color: rgb(255, 0, 0);"></textarea></span></span>
7.5 安装xfce4
<span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"> </span><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"><span style="font-size: 18px; color: rgb(255, 0, 0);"><textarea readonly="readonly" name="code" class="c++"></span></span><code class="hljs avrasm has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">pacman –S xfce4 <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">cp</span> /etc/skel/<span class="hljs-preprocessor" style="color: rgb(68, 68, 68); box-sizing: border-box;">.xinitrc</span> ~ //如果没有则在~目录下创建 vi ~/<span class="hljs-preprocessor" style="color: rgb(68, 68, 68); box-sizing: border-box;">.xinitrc</span> //编辑xinitrc,写入exec startxfce4 chmod +<span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">x</span> ~/<span class="hljs-preprocessor" style="color: rgb(68, 68, 68); box-sizing: border-box;">.xinitrc</span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li></ul><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 18px; line-height: 26px;"><span style="color: rgb(255, 0, 0);"></textarea></span></span>
root和自己的用户下面都要设置
7.6 安装Slim登录器
<span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"> </span><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"><span style="font-size: 18px; color: rgb(255, 0, 0);"><textarea readonly="readonly" name="code" class="c++"></span></span><code class="hljs lasso has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">pacman <span class="hljs-attribute" style="box-sizing: border-box;">-S</span> slim vi /etc/slim<span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">.</span>conf <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//编辑slim配置文件,讲session设为startxfce4 </span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li></ul><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 18px; line-height: 26px;"><span style="color: rgb(255, 0, 0);"></textarea></span></span>
重启,就会看见登录界面,可以用root账户或者自己创建的账户登录。下面的都可以在图形界面下继续安装。
注意事项: 挂载分区时 mount /dev/sda1 /mnt 中/mnt前有空格
4.1 配置语言中,ctrl+x保存
linux下在编辑状态下退出请按Ctrl+X,会有两种情形:
如果文件未修改,直接退出;
如果修改了文件,下面会询问是否需要保存修改。输入Y确认保存,输入N不保存,按Ctrl+C取消返回。如果输入了Y,下一步会提示输入想要保存的文件名。如果不需要修改文件名直接回车就行;若想要保存成别的名字(也就是另存为)则输入新名称然后确定,这个时候也可用Ctrl+C来取消返回。
文章出处:http://blog.csdn.net/u012161563/article/details/50370124#t7
7.7 其他
<span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"> </span><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"><span style="font-size: 18px; color: rgb(255, 0, 0);"><textarea readonly="readonly" name="code" class="c++"></span></span><code class="hljs lasso has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">pacman <span class="hljs-attribute" style="box-sizing: border-box;">-S</span> dbus openbox lxterminal pacman <span class="hljs-attribute" style="box-sizing: border-box;">-S</span> bash<span class="hljs-attribute" style="box-sizing: border-box;">-completion</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//安装bash补全</span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li></ul><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 18px; line-height: 26px;"><span style="color: rgb(255, 0, 0);"></textarea></span></span>
7.8输入法
<span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"> </span><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;"><span style="font-size: 18px; color: rgb(255, 0, 0);"><textarea readonly="readonly" name="code" class="c++"></span></span><p><code class="hljs lasso has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">pacman <span class="hljs-attribute" style="box-sizing: border-box;">-S</span> fcitx<span class="hljs-attribute" style="box-sizing: border-box;">-im</span> fcitx<span class="hljs-attribute" style="box-sizing: border-box;">-configtool</span> fcitx<span class="hljs-attribute" style="box-sizing: border-box;">-qt</span> fcitx<span class="hljs-attribute" style="box-sizing: border-box;">-googlepinyin</span></code></p><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 18px; line-height: 26px;"><span style="color: rgb(255, 0, 0);"></textarea></span></span>