当前位置:网站首页 > 大数据架构 > 正文

ubuntu代码大全(ubuntu20代号)



一、 Ubuntu12-22通用,安装Xfce图形界面(由于ubuntu12的源已经失效,目前没法验证ubuntu12了,其他的ubuntu偶数版本我都验证过)

参考 第1步 sudo su root apt-get update apt-get install python-software-properties xfce4 xfce4-goodies

如果python-software-properties不存在,就用software-properties-common替代python-software-properties

如果不需要出现下面这种交互式界面

那就在apt-get install 前面加DEBIAN_FRONTEND=noninteractive

例如把apt-get install software-properties-common xfce4 xfce4-goodies改成DEBIAN_FRONTEND=noninteractive apt-get install software-properties-common xfce4 xfce4-goodies

第2步 apt-get install net-tools xrdp firefox xfonts-wqy sysv-rc-conf -y(≥ubuntu18.04执行apt-get install net-tools xrdp firefox xfonts-wqy -y

执行时如果不识别sysv-rc-conf (≥ubuntu18.04不支持sysv-rc-conf ,不用动源

在软件源sources.list文件末尾添加如下文本

解析不了内网域名的话,把/etc/apt/sources.list里的mirrors.tencentyun.com替换为mirrors.sohu.com或mirrors.tuna.tsinghua.edu.cn

然后apt-get update(如果Ubuntu换源后,更新提示GPG error缺少公钥,参考https://blog.csdn.net/_/article/details/ 执行2句命令)

执行2句命令后连续执行3遍apt-get update,发现只有Warning了,忽略即可

然后重新执行apt-get install net-tools xrdp firefox xfonts-wqy sysv-rc-conf -y (≥ubuntu22.04执行apt-get install net-tools xrdp firefox xfonts-wqy -y

第3步 设置支持中文显示 执行localectl set-locale LANG=en_US.utf8 第4步 sysv-rc-conf xrdp on(≥ubuntu22.04执行systemctl enable xrdp

echo xfce4-session >~/.xsession

adduser xrdp ssl-cert(≥ubuntu18.04需要执行这句)

service xrdp restart

netstat -tunlp|grep 3389

执行 netstat -tunlp 查看远程端口是监听状态就可以用windows里的mstsc来远程了,跟远程windows服务器的方式一模一样

验证能否远程,到这一步一般都可以了,如果不行

vim /etc/xrdp/xrdp.ini 修改port这一步不是必须的,port 3389改为port 33899(或别的1025-65535之间的端口,注意新端口要在安全组入站规则放行) 如果没有ssl_protocols=xxx,那么在crypt_level=下面添加一行 ssl_protocols=TLSv1, TLSv1.1, TLSv1.2(看下crypt_level=后面是high还是low,如果是low,改成high) 如果有ssl_protocols=xxx,确保等号右边是TLSv1, TLSv1.1, TLSv1.2

然后重启机器

如果远程时报 login failed for display 0,参考下这篇文档看看能不能解决

https://askubuntu.com/questions//18-04-3-lts-xrdp-login-failed-for-display-0

如果远程时,闪一下就退出了,需要分析日志,例如情况一:

grep ERROR /var/log/xrdp.log

[-23:36:44] [ERROR] Cannot read private key file /etc/xrdp/key.pem: Permission denied

[-23:36:54] [ERROR] Cannot read private key file /etc/xrdp/key.pem: Permission denied

[-23:36:55] [ERROR] Cannot read private key file /etc/xrdp/key.pem: Permission denied

[-23:36:55] [ERROR] Cannot read private key file /etc/xrdp/key.pem: Permission denied

报上面这个错需要执行adduser xrdp ssl-cert

这是个bug,

如果远程时,闪一下就退出了,需要分析日志,例如情况二:

grep socket /var/log/xrdp-sesman.log

[-15:23:46] [CORE ] starting sesman with pid 1139

[-15:23:46] [INFO ] listening...

[-15:24:51] [INFO ] scp thread on sck 7 started successfully

[-15:24:52] [INFO ] ++ created session (access granted): username root, ip 111.206.145.22:2748 - socket: 7

[-15:24:52] [INFO ] starting Xvnc session...

[-15:24:52] [INFO ] starting xrdp-sessvc - xpid=1638 - wmpid=1637

[-15:24:52] [INFO ] ++ terminated session: username root, display :10.0, session_pid 1636, ip 111.206.145.22:2748 - socket: 7

[-15:30:48] [CORE ] starting sesman with pid 1085

[-15:30:48] [INFO ] listening...

[-15:31:26] [INFO ] scp thread on sck 7 started successfully

[-15:31:26] [INFO ] ++ created session (access granted): username root, ip 111.206.145.22:3211 - socket: 7

[-15:31:26] [INFO ] starting Xvnc session...

[-15:31:26] [INFO ] starting xrdp-sessvc - xpid=1588 - wmpid=1587

[-15:31:26] [INFO ] ++ terminated session: username root, display :10.0, session_pid 1586, ip 111.206.145.22:3211 - socket: 7

这种情况需要参考 将下面两行参数设置追加到/etc/xrdp/sesman.ini的[Xvnc]配置中

param8=-SecurityTypes

param9=None

采取以上方法后重启机器即可

二、Ubuntu系统安装中文字体(不是必须的,如果浏览器中文网站比如百度乱码,是需要安装下的) 参考 apt-get install language-pack-zh* apt-get install chinese* apt-get install fonts-arphic-ukai fonts-arphic-uming fonts-ipafont-mincho fonts-ipafont-gothic fonts-unfonts-core

执行时如果报The following packages have unmet dependencies:

libqtgui4 : Depends: libpng12-0 (>= 1.2.13-4) but it is not going to be installed

参考https://launchpad.net/~linuxuprising/+archive/ubuntu/libpng12

参考https://www.linuxuprising.com/2018/05/fix-libpng12-0-missing-in-ubuntu-1804.html

执行这3句后再安装中文字体(适用ubuntu18/20,不适用ubuntu22)

执行时如果报The following packages have unmet dependencies:

usrmerge : Conflicts: libpng12-0 (< 1.2.54-4~) but 1.2.50-1ubuntu2 is to be installed

换着顺序试一下

到此这篇ubuntu代码大全(ubuntu20代号)的文章就介绍到这了,更多相关内容请继续浏览下面的相关推荐文章,希望大家都能在编程的领域有一番成就!

版权声明


相关文章:

  • 颜色代码表大全图片(颜色代码表高清)2026-04-15 12:36:06
  • 单片机设计大赛(2020年单片机设计大赛)2026-04-15 12:36:06
  • 欧美vocal的rapper(欧美rapper大全图片)2026-04-15 12:36:06
  • 大气分层图手绘图(大气分层图手绘图怎么画)2026-04-15 12:36:06
  • 大气分层图表(大气分层结构图)2026-04-15 12:36:06
  • github平台大全(githubs)2026-04-15 12:36:06
  • 16进制颜色代码表大全(16进制颜色值表)2026-04-15 12:36:06
  • 快手神秘代码网站(快手神秘代码网站大全)2026-04-15 12:36:06
  • 苹果特殊符号大全怎么打的(iphone特殊符号怎么打)2026-04-15 12:36:06
  • 工具类品牌排行(工具10大品牌排行)2026-04-15 12:36:06
  • 全屏图片