安装的debian10服务器最小化安装

1.Debian10终端乱码解决办法

a.安装字体管理软件

# 安装字体管理
apt-get install locales
# 安装文泉驿字体
apt-get install fonts-wqy-zenhei

b.设置字体

# 选择中文 zh_CN.UTF-8
dpkg-reconfigure locales
# 查看
root@debian10:~# locale
LANG="zh_CN.UTF-8"
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=

使用 apt-get update 中文仍是菱形乱码,重启依然不变。locale始终显示不正常。。。

c.解决

百度许久,解决方案:《Debian中设置locale的方法小结

# 临时执行:
export LC_ALL=zh_CN.UTF-8
# 永久添加:
vim /root/.bashrc
export LC_ALL=zh_CN.UTF-8

apt-get update 查看终于能够正常显示中文!~

2.局域网设置固定IP

查看当前IP和网卡:ip a|grep 192
参考《 Debian10修改静态IP地址

a.修改网卡配置

root@debian10:~# vim /etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The primary network interface
allow-hotplug enp3s0
#iface enp3s0 inet dhcp

#xinwamhka
auto enp3s0
iface enp3s0 inet static
netmask  255.255.255.0
gateway  192.168.2.1
address 192.168.2.25

b.重启网络服务

systemctl restart networking

重启失败,出现RTNETLINK answers: File exists
参考《 Ubuntu解决RTNETLINK answers: File exists

ip addr flush dev enp3s0
systemctl restart networking # ok

3.禁止系统休眠

参考《 禁止Debian 10自动休眠

# 查看状态
systemctl status sleep.target
# 关闭休眠
systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
# 查看状态
systemctl status sleep.target
03-05 15:50