1、安装完zabbix发现没有中文语言
2、zabbix server服务端直接安装中文语言包
# 直接apt安装发现报错
root@10-7-81-96:~# apt install language-pack-zh*
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package language-pack-zh*
root@10-7-81-96:~#
出现以上报错一般是没有更新apt库,更新即可,如下
apt-get upgrade
root@10-7-81-96:~# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
base-files cloud-init fwupd libfwupd2 libfwupdplugin1 linux-generic linux-headers-generic linux-image-generic
python3-update-manager sosreport thermald ubuntu-advantage-tools ubuntu-server update-manager-core
The following packages will be upgraded:
accountsservice alsa-ucm-conf amd64-microcode apparmor apport apt apt-utils bash bcache-tools bind9-dnsutils bind9-host
bind9-libs binutils binutils-common binutils-x86-64-linux-gnu bolt bsdutils busybox-initramfs busybox-static
ca-certificates cloud-initramfs-copymods cloud-initramfs-dyn-netconf command-not-found cpio crash cryptsetup
cryptsetup-bin cryptsetup-initramfs cryptsetup-run curl dbus dbus-user-session dirmngr distro-info-data dpkg e2fsprogs
fdisk finalrd friendly-recovery fwupd-signed gawk gcc-10-base gir1.2-glib-2.0 gir1.2-packagekitglib-1.0 git git-man
glib-networking glib-networking-common glib-networking-services gnupg gnupg-l10n gnupg-utils gpg gpg-agent
gpg-wks-client gpg-wks-server gpgconf gpgsm gpgv grub-common grub-pc grub-pc-bin grub2-common gzip initramfs-tools
initramfs-tools-bin initramfs-tools-core intel-microcode iptables iputils-ping iputils-tracepath isc-dhcp-client
isc-dhcp-common kdump-tools kexec-tools klibc-utils kmod kpartx krb5-locales landscape-common language-selector-common
less libaccountsservice0 libapparmor1 libapt-pkg6.0 libarchive13 libasn1-8-heimdal libasound2 libasound2-data
libbinutils libblkid1 libbrotli1 libc-bin libc6 libcap2 libcap2-bin libcom-err2 libcryptsetup12 libctf-nobfd0 libctf0
libcurl3-gnutls libcurl4 libdbus-1-3 libdns-export1109 libdrm-common libdrm2 libdw1 libefiboot1 libefivar1 libelf1
libexpat1 libext2fs2 libfdisk1 libfreetype6 libfribidi0 libgcc-s1 libgcrypt20 libgirepository-1.0-1 libglib2.0-0
libglib2.0-bin libglib2.0-data libgmp10 libgnutls30 libgpgme11 libgssapi-krb5-2 libgssapi3-heimdal libgstreamer1.0-0
libhcrypto4-heimdal libheimbase1-heimdal libheimntlm0-heimdal libhogweed5 libhx509-5-heimdal libicu66 libip4tc2
libip6tc2 libisc-export1105 libjson-c4 libk5crypto3 libkeyutils1 libklibc libkmod2 libkrb5-26-heimdal libkrb5-3
libkrb5support0 libksba8 libldap-2.4-2 libldap-common liblz4-1 liblzma5 libmaxminddb0 libmount1 libncurses6
libncursesw6 libnetplan0 libnettle7 libnghttp2-14 libnl-3-200 libnl-genl-3-200 libnss-systemd libntfs-3g883 libp11-kit0
libpackagekit-glib2-18 libpam-cap libpam-modules libpam-modules-bin libpam-runtime libpam-systemd libpam0g libparted2
libpci3 libpcre2-8-0 libpcre3 libperl5.30 libplymouth5 libpolkit-agent-1-0 libpolkit-gobject-1-0 libprocps8 libproxy1v5
libpython3.8 libpython3.8-minimal libpython3.8-stdlib libroken18-heimdal libsasl2-2 libsasl2-modules
libsasl2-modules-db libseccomp2 libsepol1 libsmartcols1 libsqlite3-0 libss2 libssh-4 libssl1.1 libstdc++6 libsystemd0
libtdb1 libtinfo6 libtss2-esys0 libudev1 libunwind8 libuuid1 libuv1 libwind0-heimdal libx11-6 libx11-data libxml2
libxmlb1 libxslt1.1 libxtables12 libzstd1 linux-base linux-crashdump linux-firmware locales login logsave lshw lsof
ltrace lz4 makedumpfile mdadm mount multipath-tools ncurses-base ncurses-bin ncurses-term netplan.io
networkd-dispatcher ntfs-3g open-iscsi open-vm-tools openssh-client openssh-server openssh-sftp-server openssl
overlayroot packagekit packagekit-tools parted passwd pciutils perl perl-base perl-modules-5.30 plymouth
plymouth-theme-ubuntu-text policykit-1 pollinate procps python-apt-common python3-apport python3-apt
python3-commandnotfound python3-cryptography python3-debian python3-distro-info python3-distupgrade python3-distutils
python3-gdbm python3-idna python3-jinja2 python3-jwt python3-lib2to3 python3-pkg-resources python3-problem-report
python3-requests python3-setuptools python3-software-properties python3-twisted python3-twisted-bin python3-urllib3
python3-yaml python3.8 python3.8-minimal rsync rsyslog sbsigntool screen snapd software-properties-common
squashfs-tools sudo systemd systemd-sysv systemd-timesyncd tar tcpdump tmux tzdata ubuntu-keyring ubuntu-minimal
ubuntu-release-upgrader-core ubuntu-standard udev ufw unattended-upgrades update-notifier-common util-linux
uuid-runtime vim vim-common vim-runtime vim-tiny wget wireless-regdb xxd xz-utils zlib1g
308 upgraded, 0 newly installed, 0 to remove and 14 not upgraded.
Need to get 275 MB of archives.
After this operation, 202 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
......后面省略......
3、更新apt库之后重新安装
apt install language-pack-zh*
4、编辑配置文件,添加一下内容
LANG="zh-CN.UTF-8"
root@10-7-81-96:~# vim /etc/environment
root@10-7-81-96:~# cat /etc/environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
LANG="zh-CN.UTF-8"
5、重新配置系统中的语言环境(locales)设置
dpkg-reconfigure locales
出现以下界面选择zh_CN.UTF-8 UTF-8,按空格后再按tab键,选择ok
# 以上界面设置好之后会进行安装
root@10-7-81-96:~# dpkg-reconfigure locales
Generating locales (this might take a while)...
en_US.UTF-8... done
zh_CN.UTF-8... done
zh_HK.UTF-8... done
zh_SG.UTF-8... done
zh_TW.UTF-8... done
Generation complete.
root@10-7-81-96:~#
6、重启zabbix相关服务
systemctl restart zabbix-server zabbix-agent nginx php7.4-fpm
root@10-7-81-96:~# systemctl restart zabbix-server zabbix-agent nginx php7.4-fpm
root@10-7-81-96:~#
7、返回到zabbix前端界面,选择中文语言包即可
点击更新之后就变成中文界面了