美文网首页Arch
初装 Arch Linux 系统的基本配置

初装 Arch Linux 系统的基本配置

作者: EzVoodoo | 来源:发表于2015-04-06 21:14 被阅读0次

1. 添加用户、设置密码、安装 sudo 工具

使用以下命令添加用户

useradd -m -g users -G network,storage,power,wheel,uucp -s /bin/bash josh
passwd josh

参考 useradd 参数

  • -m 创建home目录
  • -g 主用户群:user
  • -G 附属用户群,其中 wheel 用于使用 sudo、su 命令
  • -s 启动 shell 设定

安装 sudo 工具:

pacman -S sudo

为了使用户可以通过 sudo 获得 root 权限,还需要作如下设置:

nano /etc/sudoers
使用命令:
visudo

找到如下字样部分:

# %wheel ALL=(ALL) ALL

取消注释,使所有 wheel 组用户可以使用 sudo 命令。保存文件,退出。现在可以用 logout 命令登出 Linux,再用你自己的用户名登录了。

重新登陆。pacman 全局更新

$ pacman -Syu

修改 .bashrc 文件,增加 ll

alias ll = 'ls -al --color=auto'

安装 vim、emacs

$ pacman -S vim emacs

sudo pacman -S xorg-server xorg-xinit xorg-server-utils mesa

pacman -Syu virtualbox-guest-utils

sudo nano /etc/modules-load.d/virtualbox.conf

Once Guest Additions are installed, we need to make sure that the various components of this software are loaded automatically each time the system boots. To do this, we’ll use nano to create a new configuration file called ‘virtualbox.conf’. This file will go in the ‘/etc/modules-load.d’ directory, which contains files that need to be loaded when Arch boots up. Since adding a file to this directory requires administrative permissions, we’ll need to precede our command with ‘sudo’ once again:

sudo nano /etc/modules-load.d/virtualbox.conf

When nano brings up the blank file, add these three lines to it:

vboxguest
vboxsf
vboxvideo

As usual, when you’re finished entering text in nano, type Control-X to exit to the command line, and answer ‘y’ for yes when you’re asked whether you want to save your work, and then hit ‘Return’ to accept the filename.

At this point, reboot your machine for the Guest Additions to take effect.

sudo reboot

Upon rebooting, your system should automatically connect to the internet, and Guest Additions should load up as part of the boot process.

By installing Guest Additions, we’re working toward better integration between our host and guest OSes. One example is that we can sync our Arch Linux install’s clock with that of the host system by entering the following command. This will enable synching on the next boot:

sudo systemctl enable vboxservice.service

But enough with the clock. At this point, we want to see if X is working, since we need it to be functional before we can install and use a GUI desktop.

To this end, we’ll install a few software packages that will help us test X:

sudo pacman -S xorg-twm xorg-xclock xterm

After these software packages have been installed, we can test that Xorg is installed correctly by running the command:

startx

相关文章

网友评论

    本文标题:初装 Arch Linux 系统的基本配置

    本文链接:https://www.haomeiwen.com/subject/glkzxttx.html