> For the complete documentation index, see [llms.txt](https://book.bsdcn.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.bsdcn.org/di-13-zhang-zhuo-mian-huan-jing/di-13.9-jie-cde-ni-shan-chu.md).

# 13.9 CDE（拟删除）

## CDE 桌面环境概述

CDE（Common Desktop Environment，通用桌面环境）是 20 世纪 90 年代商业 UNIX 系统的标准桌面环境，曾广泛应用于 Solaris、HP-UX 和 AIX 等商业发行版。

## 安装 CDE 桌面环境

* 使用 pkg 安装：

```sh
# pkg install xorg cde wqy-fonts xdg-user-dirs
```

* 或使用 Ports 安装：

```sh
# cd /usr/ports/x11/xorg/ && make install clean
# cd /usr/ports/x11/cde/ && make install clean
# cd /usr/ports/x11-fonts/wqy/ && make install clean
# cd /usr/ports/devel/xdg-user-dirs/ && make install clean
```

登录管理器可考虑使用 SLiM。

### 软件包说明

| 包名              | 作用说明              |
| --------------- | ----------------- |
| `xorg`          | X 窗口系统            |
| `cde`           | 提供传统的 CDE 桌面环境    |
| `wqy-fonts`     | 文泉驿中文字体           |
| `xdg-user-dirs` | 管理用户目录，如“桌面”“下载”等 |

* 查看安装后的信息

```sh
# pkg info -D cde
```

## 配置服务与文件

* 配置服务

```sh
# service rpcbind enable  # 设置 RPC 绑定服务开机自启
# service dtcms enable  # 设置 DTCMS 服务开机自启
# service inetd enable  # 设置 inetd 守护进程开机自启
# service dtlogin enable  # 设置 DTLogin 显示管理器开机自启
```

* 配置 X 服务器允许任意用户启动：

```sh
# echo "allowed_users=anybody" > /usr/local/etc/X11/Xwrapper.config
```

* 为当前用户创建 Xsession 的符号链接，用于启动桌面会话：

```sh
$ ln -s /usr/local/dt/bin/Xsession ~/.xinitrc
```

* 配置 dtspcd 服务通过 TCP 启动，将以下内容添加到 **/etc/inetd.conf** 文件：

```ini
dtspc	stream	tcp	nowait	root	 /usr/local/dt/bin/dtspcd	/usr/local/dt/bin/dtspcd
```

* 为 dtspc 服务指定 TCP 端口 6112，将以下内容添加到 **/etc/services** 文件：

```ini
dtspc		6112/tcp
```

### 中文配置

编辑 **/etc/login.conf** 文件：找到 `default:\` 部分，将 `:lang=C.UTF-8` 修改为 `:lang=zh_CN.UTF-8`。

根据 **/etc/login.conf** 文件重建能力数据库，使配置生效：

```sh
# cap_mkdb /etc/login.conf
```

## 桌面欣赏

![dtlogin](/files/IQs3sL6M16qBIfgOcZGD)

![FreeBSD 安装 CDE](/files/Ey6tTgH1QqwEG4pMdUMH)

每次启动时均会在此阶段暂停数分钟。

![FreeBSD 安装 CDE](/files/fd6urPh1I6RblNTKogB0)

![终端](/files/NJrNQrumqMSgZUEXx3mn)

## 故障排除与未竟事宜

### 无法设置中文环境

CDE 整体界面无法切换为中文，仅日历组件可显示中文。

根据源代码 <https://sourceforge.net/p/cdesktopenv/code/ci/master/tree/cde/imports/motif/localized/>，CDE 不存在简体中文支持。然而根据 [简体中文 Solaris 用户指南](https://docs.oracle.com/cd/E19683-01/816-0668/6m7500nqp/index.html)，Solaris 版本确实包含简体中文支持，该本地化支持可能在开源过程中丢失，或 Solaris 版本为未合并的分支。已反馈至 [Missing Simplified Chinese locale support under cde/imports/motif/localized](https://sourceforge.net/p/cdesktopenv/discussion/general/thread/c51abcd846/)。

## 参考文献

* FreshPorts. cde Common Desktop Environment\[EB/OL]. \[2026-03-25]. <https://www.freshports.org/x11/cde>. FreshPorts 提供的 CDE 桌面环境 Port 详情与安装指南。
* FreeBSD Project. Setting up Common Desktop Environment for modern use\[EB/OL]. \[2026-03-25]. <https://forums.freebsd.org/threads/setting-up-common-desktop-environment-for-modern-use.69475/>. 详细配置可参考 FreeBSD 论坛相关讨论。
* CDE Project. CDE - Common Desktop Environment Wiki\[EB/OL]. \[2026-03-25]. <https://sourceforge.net/p/cdesktopenv/wiki/FreeBSDBuild/>. CDE 项目官方 Wiki 提供的 FreeBSD 平台构建与配置指南。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://book.bsdcn.org/di-13-zhang-zhuo-mian-huan-jing/di-13.9-jie-cde-ni-shan-chu.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
