解決執行 locale 出現的錯誤訊息

原本的 OB2D-XFCE-Server-2017 訊息是顯示中文的,但因個人使用習慣,所以移除了 X-Window,使用 SSH Client 遠端登入後,顯示訊息是中文的,就有些不太習慣。
# cp /etc/default/locale /etc/default/locale.$(date +%F)
# sed -i ‘s/zh_TW/en_US/’ /etc/default/locale
# sed -i ‘s/zh/en/’ /etc/default/locale

# locale-gen en_US.UTF-8
Generating locales (this might take a while)…
  zh_TW.UTF-8… done
Generation complete.

但執行 locale 會出現警告提示的訊息
# locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE=”en_US.UTF-8″
LC_NUMERIC=”en_US.UTF-8″
LC_TIME=”en_US.UTF-8″
LC_COLLATE=”en_US.UTF-8″
LC_MONETARY=”en_US.UTF-8″
LC_MESSAGES=”en_US.UTF-8″
LC_PAPER=”en_US.UTF-8″
LC_NAME=”en_US.UTF-8″
LC_ADDRESS=”en_US.UTF-8″
LC_TELEPHONE=”en_US.UTF-8″
LC_MEASUREMENT=”en_US.UTF-8″
LC_IDENTIFICATION=”en_US.UTF-8″
LC_ALL=[@more@]解決方式:
# dpkg-reconfigure locale

這樣就正常了!
# locale
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE=”en_US.UTF-8″
LC_NUMERIC=”en_US.UTF-8″
LC_TIME=”en_US.UTF-8″
LC_COLLATE=”en_US.UTF-8″
LC_MONETARY=”en_US.UTF-8″
LC_MESSAGES=”en_US.UTF-8″
LC_PAPER=”en_US.UTF-8″
LC_NAME=”en_US.UTF-8″
LC_ADDRESS=”en_US.UTF-8″
LC_TELEPHONE=”en_US.UTF-8″
LC_MEASUREMENT=”en_US.UTF-8″
LC_IDENTIFICATION=”en_US.UTF-8″
LC_ALL=

移除 OB2D Linux stretch 2017 1.0 的 X Window

因為本身在使用 Linux 管理 Server 時,很少用到圖形介面,而新版的 OB2D Linux 目前沒有提供純文字版本,所以甘脆自行動手把 X Window 移除。
移除 XFCE 相關套件
# apt-get remove –purge $(dpkg -l | grep xfce | awk ‘{print $2}’)
[@more@]移除 Firefox / Iceweasel 瀏覽器
# apt-get remove –purge $(dpkg -l | egrep ‘firefox|iceweasel’ | awk ‘{print $2}’)
移除 Emacs
# apt-get remove –purge $(dpkg -l | grep emacs24 | awk ‘{print $2}’)
移除 ibus 輸入法
# apt-get remove –purge ibus
移除 xorg 套件
# apt-get remove –purge xserver-xorg
移除用不到的套件
# apt-get autoremove

可能還有一些套件沒有移除乾淨!

修改 OB2D Linux 2017 1.0 使用環境

1. 設定 root 密碼
$ sudo passwd root
[sudo] password for ob2duser:
輸入新的 UNIX 密碼:
再次輸入新的 UNIX 密碼:
passwd:密碼已成功地變更[@more@]
2. 開啟讓遠端可以連線到 SSH Server
$ sudo vim /etc/rc.local
去除前面的 #,並修改成您的網路環境
#LAN_IP_RANGE=”192.168.1.0/24″
去除前面的 #
#$IPTABLES -A INPUT -p tcp -s $LAN_IP_RANGE –dport 22 -j ACCEPT

重新啟動 Firewall
$ sudo sh /etc/rc.local

3. 設定 MySQL Server
$ sudo /usr/bin/mysql_secure_installation

4. 更新套件庫並更新
$ sudo apt-get update;sudo apt-get upgrade

試用 OB2D Linux 2017 1.0

OB2D Linux 官方網站:
https://b2d-linux.com

OB2D Linux 2017 下載:
https://sourceforge.net/projects/ob2dlinux/files/2017/XFCE-SERVER/
[@more@]光碟開機畫面,選擇 Graphical Install

載入安裝程式的元件

IP 設定

Gateway 設定

DNS 設定

主機名稱設定

網域設定

設定使用者(除 root 外的使用者)

設定密碼

設定時間

磁碟分割

系統安裝

GRUB 設定

設定使用者及密碼

GRUB 開機畫面

登入畫面

登入後桌面環境

預設啟動的服務
# netstat -ant
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN
tcp6       0      0 :::80                   :::*                    LISTEN
tcp6       0      0 :::22                   :::*                    LISTEN
tcp6       0      0 :::25                   :::*                    LISTEN

安裝的 Apache / MariaDB / PHP 版本
# dpkg -l | egrep ‘apache|php|mariadb’
ii  apache2                              2.4.25-3                    amd64        Apache HTTP Server
ii  apache2-bin                          2.4.25-3                    amd64        Apache HTTP Server (modules and other binary files)
ii  apache2-data                         2.4.25-3                    all          Apache HTTP Server (common files)
ii  apache2-utils                        2.4.25-3                    amd64        Apache HTTP Server (utility programs for web servers)
ii  libapache2-mod-php7.0                7.0.15-1                    amd64        server-side, HTML-embedded scripting language (Apache 2 module)
ii  mariadb-client-10.1                  10.1.21-5                   amd64        MariaDB database client binaries
ii  mariadb-client-core-10.1             10.1.21-5                   amd64        MariaDB database core client binaries
ii  mariadb-common                       10.1.21-5                   all          MariaDB common metapackage
ii  mariadb-server-10.1                  10.1.21-5                   amd64        MariaDB database server binaries
ii  mariadb-server-core-10.1             10.1.21-5                   amd64        MariaDB database core server files
ii  php-cli                              1:7.0+49                    all          command-line interpreter for the PHP scripting language (default)
ii  php-common                           1:49                        all          Common files for PHP packages
ii  php-pear                             1:1.10.1+submodules+notgz-9 all          PEAR Base System
ii  php-xml                              1:7.0+49                    all          DOM, SimpleXML, WDDX, XML, and XSL module for PHP [default]
ii  php7.0                               7.0.15-1                    all          server-side, HTML-embedded scripting language (metapackage)
ii  php7.0-cli                           7.0.15-1                    amd64        command-line interpreter for the PHP scripting language
ii  php7.0-common                        7.0.15-1                    amd64        documentation, examples and common module for PHP
ii  php7.0-gd                            7.0.15-1                    amd64        GD module for PHP
ii  php7.0-json                          7.0.15-1                    amd64        JSON module for PHP
ii  php7.0-mysql                         7.0.15-1                    amd64        MySQL module for PHP
ii  php7.0-opcache                       7.0.15-1                    amd64        Zend OpCache module for PHP
ii  php7.0-readline                      7.0.15-1                    amd64        readline module for PHP
ii  php7.0-xml                           7.0.15-1                    amd64        DOM, SimpleXML, WDDX, XML, and XSL module for PHP