官网: 资源中心 | 统信UOS生态社区 (chinauos.com)
1.基础知识
UEFI和Legacy(遗留问题):
Legacy是传统BIOS的叫法
分区表:
常见分区表:主引导分区记录(MBR)和全局唯一磁盘分区表(GUID partition Table GPT),MBR只能有4个分区,使用Legacy引导模式必须是MBR分区表,使用磁盘管理可以查询分区表类型.
输入msinfo32.exe
2.安装(VM)
2.1系统安装
创建VM时选择Debian8.x 64位
2.2 显卡安装
玩游戏,安装mesa-vulkan-drivers(类似win下DirectX),N卡默认使用开源驱动Nouveau.
2.3无线网卡
获取芯片的名字,在debian官网查找解决方法
lsusb | grep -i wireless
3.管理命令
3.0 命令参数补全
vim /etc/bash.bashrc
#enable bash completion in interactive shells
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
# root用户ls文件没颜色
vim .bashrc
alias cp='cp -i'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
alias l.='ls -d .* --color=auto'
alias ll='ls -l --color=auto'
alias ls='ls --color=auto'
alias mv='mv -i'
alias rm='rm -i'
alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'
3.1 硬件信息
lshw -html > lshw.html
root@fjtw:/home/fjtw# lshw | more
fjtw
description: Computer
product: VMware Virtual Platform
vendor: VMware, Inc.
version: None
serial: VMware-56 4d c6 cb dd 00 f8 c5-e5 f2 6e 0d da e6 0d 58
width: 64 bits
capabilities: smbios-2.7 dmi-2.7 smp vsyscall32
configuration: administrator_password=enabled boot=normal frontpanel_password=unknown keyboard_password=un
known power-on_password=disabled uuid=564DC6CB-DD00-F8C5-E5F2-6E0DDAE60D58
*-core
description: Motherboard
product: 440BX Desktop Reference Platform
vendor: Intel Corporation
physical id: 0
version: None
serial: None
*-firmware
dmidecode -t bios| more
dmidecode -s system-serial-number | more
dmidecode -t memory | more
3.2 systemd管理服务
apt-get install nginx
root@fjtw:/home/fjtw# systemctl start nginx
root@fjtw:/home/fjtw# systemctl status nginx
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2021-08-24 17:40:05 CST; 2min 28s ago
Docs: man:nginx(8)
Main PID: 11916 (nginx)
Tasks: 5 (limit: 4582)
Memory: 7.3M
CGroup: /system.slice/nginx.service
├─11916 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
├─11917 nginx: worker process
├─11918 nginx: worker process
├─11919 nginx: worker process
└─11920 nginx: worker process
8月 24 17:40:05 fjtw systemd[1]: Starting A high performance web server and a reverse proxy server...
8月 24 17:40:05 fjtw systemd[1]: Started A high performance web server and a reverse proxy server.
root@fjtw:/home/fjtw# systemctl stop nginx
root@fjtw:/home/fjtw# systemctl enable nginx
Synchronizing state of nginx.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable nginx
root@fjtw:/home/fjtw# systemctl disable nginx
Synchronizing state of nginx.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install disable nginx
insserv: warning: current start runlevel(s) (empty) of script `nginx' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `nginx' overrides LSB defaults (0 1 6).
Removed /etc/systemd/system/multi-user.target.wants/nginx.service.
3.3 电源管理
sudo systemctl reboot #重启
sudo systemctl poweroff #关机
sudo systemctl suspend #待机
sudo systemctl hibernate #休眠
3.4 日志管理
systemd可以使用journalctl命令管理日志.
sudo journalctl #查看所有日志
sudo journalctl -k #内核相关日志
sudo journalctl -p err #错误相关日志
sudo journalctl -b #本次开机到查看日志时的日志,可以配合-p 3查看
sudo journalctl -b -1 #上次开机到关机的日志注意是数字1
sudo journalctl --since "2021-08-24 16:20" --until "2021-08-24 17:20" #查询时间区域的日志
sudo journalctl -u nginx #查看指定服务的日志
3.5 主机信息管理
hostnamectl
hostnamectl set-hostname UOS #设置主机名
3.6 系统语言管理
sudo localectl #查询系统语言设置
sudo localectl set-locale LANG=zh_CN.utf8 #设置系统语言为中文
sudo localectl set-keymap zh_CN #设置系统键盘布局为中文
3.7 时区管理
sudo timedatectl #查看系统时区
sudo timedatectl list-timezones #列出所有可用时区
sudo timedatectl set-ntp false #关闭网络同步时间服务
sudo timedatectl set-timezone America/New_York #设置时区
#手动设置先关闭网络同步
sudo timedatectl set-time 2021-08-21 #设置日期
sudo timedatectl set-time 11:00:00 #设置时间
3.8登陆管理
当用户登陆系统后,systemd会在内存开辟一块区域,叫做session,其中存放这个用户登陆后运行的进程,当用户注销后,session会删除,内存会回收,
#列出当前session
loginctl
loginctl list-sessions
loginctl list-users
4.系统错误排查
4.1 使用journalctl查看内核和应用错误
执行后,使用"/"进入查找模式,PageUp,PageDown上下页,使用N查找下一个
4.2 使用coredumpctl查看应用崩溃错误
当程序崩溃时,可能会产生core文件(一般用于调试代码bug),然后会被systemd-coredump工具捕获.
sudo apt install systemd-coredump #安装coredump
sudo coredumpctl list #列出崩溃进程列表
sudo coredumpctl info 19888 #获取的PID
sudo coredumpctl debug 19888 #使用GDB进行调试
4.3 查看系统日志和内核日志
在systemd-journal之前,Linux系统上一般使用rsyslog来记录系统日志和内核日志,日志一般放在/var/log/messages目录下.
less /var/log/messages
messages所有日志,syslog系统日志,kern内核日志,boot启动日志,user用户日志,Xorg.0.log桌面日志
4.4 查看串口日志
有些问题,如磁盘损坏,内核崩溃,固件问题,通过上述的方法均无法定位问题,需要以更加低层的方式去获取日志,此时就需要通过串口去获取固件,内核及操作系统日志.
5.使用windows程序
Wine是"wine is not an emulator",它是一个能在多种POSIX兼容操作系统上运行的windows应用程序的兼容层.
5.1 deepin-wine
deepin-wine是统信UOS自带的Wine,是为运行国产软件而研发的Wine的分支.
5.2 Winetricks安装
Winetricks是一个开源辅助工具,deepin-Wine对winetricks进行了修改,使它能为统信UOS提供更多,更好的支持.
# 安装
sudo wget -O /usr/bin/winetricks https://gitee.com/wayne-xw/winetricks_for_deepinwine/raw/master/src/winetricks
chmod +x /usr/bin/winetricks
winetricks
root@fjtw:/home/fjtw/Desktop# winetricks
------------------------------------------------------
warning: Running Wine/winetricks as root is highly discouraged. See https://wiki.winehq.org/FAQ#Should_I_run_Wine_as_root.3F
------------------------------------------------------
use wine cmd: deepin-wine5
------------------------------------------------------
warning: wineserver not found!
------------------------------------------------------
6.常见问题和使用建议
6.1安装界面无响应
一般在笔记本在inter和Nvidia显卡上比较常见.原因是系统默认使用开源驱动Nouveau,但这个驱动不能很好支持较新显卡.解决方法修改开机参数,关闭NVIDIA开源驱动.
6.2 窗口特效无法开启
sudo apt install mesa-utils
glxinfo | grep OpenGL
glxinfo | grep -i openGL #不区分大小写
6.3 开发者模式
https://www.chinauos.com/developMode
6.4任务栏消失或无法操作
描述任务栏消失或持续崩溃,导致无法正常使用任务栏.
原因分析:任务栏支持插件,可能有些插件不兼容.
解决方法:
#查看日志
dde-dock
less ~/.cache/deepin/dde-dock/dde-dock.log
#将/usr/lib/dde-dock/plugins/目录插件移动到其它地方,再一个个移回去.
6.5关闭BIOS中的Fastboot和Secureboot功能
Fastboot是BIOS中一项用来提升启动速度的功能,如果启用了Fastboot,将会禁用网络启动,光盘启动及U盘启动方式.USB设备(如键盘等)和显卡在BIOS阶段也将不可用.
Secureboot是UEFI规范中用来提升系统安全性的功能,如果启用,那么不支持Secureboot的操作系统将无法加载或启动.
7.常用命令
# head显示文件前5行
head -n 5 file.txt
tail -n 5 file.txt #显示文件最后5行
tail -F error.log #实时输出文件内容
mkdir -p #创建多级目录
cp -r #拷贝目录
mv #文件命名或移动文件
rm -r #删除目录
tar zcvf file1.tar test #将test目录压缩为file1.tar
tar -xvf file.tar -c file #解压file.tar到指定目录file
zip file1.zip file1 # 压缩文件file1到file1.zip包中
zip -r dir.zip dir/ # 压缩目录dir到dir.zip包中
unzip file1.zip #将file1.zip解压到当前目录
unzip file1.zip -d file2 #将file1.zip解压到file2目录
grep good file1.txt # 在file1.txt中搜索good
grep -i good file1.txt #不区分大小写
grep -n # 显示行号
grep -r error /var/log #以递归方式查找目录/var/log下,包含error的行,也是就在目录下查找指定字符串
ls -R # 显示当前目录包含子目录的所有文件
ls -a # 显示隐藏文件
cd - #返回上次进入的目录
du -h -d 1 / #显示目录占用的空间大小,-d 1表示只显示1级目录,也可以设置为其它数字.
rmdir tech # 删除空目录tech
kill -9 12345 # 立即终止PID为12345的程序
kill 12345 # 停止运行PID为12345的程序
find /home -name abc.txt # 查找/home目录及子目录中abc.txt的文件
find -type d -name tech # -type d表示查找的是目录