如何在 Arch Linux 上正确安装和设置 KDE Plasma？
Arch KDE
我相信你是按照[这份很棒的指南安装来 Arch Linux](/article-9170-1.html) 的，这篇指南最后提到了 [GNOME 桌面](https://www.gnome.org/)的安装步骤。


但现在，不是每个人都是 GNOME 的粉丝，有几个读者要求我们向他们展示如何在 [Arch Linux](https://www.archlinux.org/) 上配置 [KDE 桌面](https://kde.org/plasma-desktop)。


因此，我创建了这个指南来演示如何在 Arch Linux 上正确安装和配置 KDE 桌面（也被称为 KDE Plasma桌面）的步骤。


### 如何在 Arch Linux 上安装和设置 KDE 桌面环境？


![](/data/attachment/album/202005/28/063618cwogppwllx4kxgow.png)


请记住，KDE 不允许直接以 root 身份登录。如果你已经安装了 Arch Linux 并以 root 身份使用，你应该创建一个新的用户，并给它以 root 身份运行命令的 sudo 权限。


如果你只是最小化安装了 Arch Linux，那么你可能是以 TTY 终端方式登录的。如果你使用的是其他桌面环境，步骤也是一样的。


让我们开始吧!


#### 步骤 1：创建一个 sudo 用户（如果你只有 root 用户）


你可以使用 [useradd 命令](https://linuxhandbook.com/useradd-command/)来创建一个新用户。我创建的用户名为 `dimitrios`（这是我的名字）。你可以使用与你的名字匹配的东西。


选项 `-m` 为新创建的用户创建一个主目录。



```
useradd -m dimitrios
```

你还应该为这个用户设置一个密码。使用此命令：



```
passwd dimitrios
```

现在你已经创建了用户，给它 sudo 权限。首先，安装 sudo 和一个像 [nano](https://www.nano-editor.org/) 这样的[命令行文本编辑器](https://itsfoss.com/command-line-text-editors-linux/)。



```
pacman -S sudo nano
```

sudo 的配置文件是 `/etc/sudoers`。该文件应该使用 `visudo` 来编辑，它会锁定 `sudoers` 文件，将编辑的内容保存到一个临时文件中，并在复制到 `/etc/sudoers` 之前检查该文件的语法。


要使用 `nano` 作为 `visudo` 编辑器，请这样设置:



```
EDITOR=nano visudo
```

像我的示例那样添加下面这一行，然后保存并退出。



```
dimitrios ALL=(ALL) ALL
```

![](/data/attachment/album/202005/28/063646lrt55gj5gkj4rggl.png)


保存你的更改，然后退出编辑器。你现在在 Arch Linux 上有了一个 sudo 用户。


#### 步骤 2 ：安装 KDE Plasma 桌面


要运行 KDE 桌面，你需要以下软件包。


* [Xorg](https://wiki.archlinux.org/index.php/Xorg) 组
* [KDE Plasma](https://kde.org/plasma-desktop) 桌面环境
* [Wayland](https://wiki.archlinux.org/index.php/Wayland) KDE Plasma 的会话
* [KDE 应用程序](https://www.archlinux.org/groups/x86_64/kde-applications/)组（包括 KDE 特有的应用程序：Dolphin 管理器和其他有用的应用程序）。


你可以用下面的命令安装上述部分。



```
pacman -S xorg plasma plasma-wayland-session kde-applications
```

安装后，启用显示管理器和网络管理器服务。



```
systemctl enable sddm.service
systemctl enable NetworkManager.service
```

快完成了。关闭你的系统。



```
shutdown now
```

重新打开系统电源，你应该会看到 KDE 的登录界面。你还记得为你的 sudo 用户设置的密码吗？用它来登录。


![](/data/attachment/album/202005/28/063714j4rxpcrr3ccpl52x.jpg)


#### 接下来？


你可能会想探索一下[基本的 pacman 命令](https://itsfoss.com/pacman-command/)，了解一下 [Arch 用户资源库](/article-12107-1.html)，了解一下 [AUR 助手](/article-12019-1.html)。


希望这篇教程对你在 Arch Linux 上安装 KDE 桌面有所帮助。如果你在安装过程中遇到任何障碍或困难，请在下面的评论中告诉我们。


你最喜欢的桌面环境或窗口管理器是什么？请告诉我们，别忘了在我们的社交媒体上订阅。




---


via: <https://itsfoss.com/install-kde-arch-linux/>


作者：[Dimitrios Savvopoulos](https://itsfoss.com/author/dimitrios/) 选题：[lujun9972](https://github.com/lujun9972) 译者：[wxy](https://github.com/wxy) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
![Warp Terminal](/assets/images/warp-terminal.webp)


![Warp Terminal](/assets/images/warp-terminal.webp)

I believe you followed the [fantastic It’s FOSS guide on installing Arch Linux](https://itsfoss.com/install-arch-linux/). The guide ends with steps mentioning the installation procedure for [GNOME desktop](https://www.gnome.org/?ref=itsfoss.com).

Now, not everyone is a GNOME fan and several readers requested that we show them how to configure the [KDE desktop](https://kde.org/plasma-desktop?ref=itsfoss.com) on [Arch Linux](https://www.archlinux.org/?ref=itsfoss.com).

And thus I created this guide to demonstrate the steps for properly installing and configuring the KDE desktop (also known as KDE Plasma desktop) on Arch Linux.

## How to install and setup KDE desktop environment on Arch Linux

![Install KDE desktop on Arch Linux](https://itsfoss.com/content/images/wordpress/2020/05/install-kde-arch-linux.png)

Please keep in mind that KDE doesn’t allow login as root directly. If you have installed Arch Linux and using it as root, you should create a new user and give it sudo rights for running commands as root.

If you just have a bare minimum installation of Arch Linux, you probably are logging into a [TTY terminal](https://itsfoss.com/what-is-tty-in-linux/). If you are using some other desktop environment, steps remain the same.

Let’s go!

### Step 1: Create a sudo user (if you have only root user)

You can use the [useradd command](https://linuxhandbook.com/useradd-command/?ref=itsfoss.com) for creating a new user. I am creating user named dimitrios (that’s my name). You can use something that matches your name.

The option -m creates a home directory for the newly created user.

`useradd -m dimitrios`


You should also set a password for this user. Use this command:

`passwd dimitrios`


Now that you have created the user, give it sudo access. First, install sudo and a [command line text editor](https://itsfoss.com/command-line-text-editors-linux/) like [nano](https://www.nano-editor.org/?ref=itsfoss.com):

`pacman -S sudo nano`


The configuration file for sudo is /etc/sudoers. It should always be edited with the visudo command. visudo locks the sudoers file, saves edits to a temporary file, and checks that file’s grammar before copying it to /etc/sudoers.

To use nano as the visudo editor, use:

`EDITOR=nano visudo`


Add the following line like I do in the example, then save and exit.

`dimitrios ALL=(ALL) ALL`


![Adding Sudoer Arch Linux](https://itsfoss.com/content/images/wordpress/2020/05/adding-sudoer-arch-linux.png)

Save your changes and exit the editor. You now have a sudo user on Arch Linux.

### Step 2: Installing KDE Plasma desktop

To run KDE desktop, you need the following packages:

[Xorg](https://wiki.archlinux.org/index.php/Xorg?ref=itsfoss.com)group[KDE Plasma](https://kde.org/plasma-desktop?ref=itsfoss.com)Desktop Environment[Wayland](https://wiki.archlinux.org/index.php/Wayland?ref=itsfoss.com)session for KDE Plasma[KDE applications](https://www.archlinux.org/groups/x86_64/kde-applications/?ref=itsfoss.com)group (consists of KDE specific applications including the Dolphin manager and other useful apps)

You can install of the above using the following command:

`pacman -S xorg plasma plasma-wayland-session kde-applications `


Once installed, enable the [Display Manager](https://itsfoss.com/display-manager/) and Network Manager services:

```
systemctl enable sddm.service
systemctl enable NetworkManager.service
```


Almost there. Shutdown your system:

`shutdown now`


Power on your system and you should see the KDE login. Do you remember the password you set up for your sudo user? Use it to login.

![Arch Plasma Desktop](https://itsfoss.com/content/images/wordpress/2020/05/Arch-Plasma-desktop.jpg?fit=800%2C450&ssl=1)

### What next?

You may want to explore the [essential pacman commands](https://itsfoss.com/pacman-command/), to know what’s going on with the [Arch User Repository](https://itsfoss.com/aur-arch-linux/) and learn more about [AUR helpers](https://itsfoss.com/best-aur-helpers/).

I hope you found this tutorial helpful in installing KDE desktop on Arch Linux. Please let us know in the comments below if you encounter any obstacles or difficulties during the installation.

What’s your favourite Desktop environment or Window Manager? Let us know and don’t forget to subscribe on our social media.