<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Ubuntu on 菜鸟程序员</title><link>https://www.azhw.com.cn/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/linux/ubuntu/</link><description>Recent content in Ubuntu on 菜鸟程序员</description><generator>Hugo</generator><language>zh-cn</language><atom:link href="https://www.azhw.com.cn/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/linux/ubuntu/index.xml" rel="self" type="application/rss+xml"/><item><title>gdm3和lightdm切换</title><link>https://www.azhw.com.cn/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/linux/ubuntu/gdm3%E5%92%8Clightdm%E5%88%87%E6%8D%A2/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.azhw.com.cn/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/linux/ubuntu/gdm3%E5%92%8Clightdm%E5%88%87%E6%8D%A2/</guid><description>&lt;pre tabindex="0">&lt;code># 切换 gdm3
sudo dpkg-reconfigure gdm3

# 切换 lightdm
sudo dpkg-reconfigure lightdm
&lt;/code>&lt;/pre></description></item><item><title>netplan</title><link>https://www.azhw.com.cn/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/linux/ubuntu/netplan/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.azhw.com.cn/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/linux/ubuntu/netplan/</guid><description>&lt;ol>
&lt;li>
&lt;p>在 Ubuntu20.04 版本中使用 netplan 管理网络&lt;/p>
&lt;/li>
&lt;li>
&lt;p>在安装好的 Ubuntu20.04 中没有 networking 和 NetworkManage 服务&lt;/p>
&lt;/li>
&lt;li>
&lt;p>netplan 配置文件：/etc/netplan/*.yaml ，文件名每个不一样&lt;/p>
&lt;/li>
&lt;li>
&lt;p>netplan 说明文件: /usr/share/doc/netplan/example/ 目录下，在该目录下有各种样例文件，可以提供帮助&lt;/p>
&lt;/li>
&lt;/ol></description></item><item><title>Ubuntu桌面版设置随机Mac地址</title><link>https://www.azhw.com.cn/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/linux/ubuntu/ubuntu%E6%A1%8C%E9%9D%A2%E7%89%88%E8%AE%BE%E7%BD%AE%E9%9A%8F%E6%9C%BAmac%E5%9C%B0%E5%9D%80/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.azhw.com.cn/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/linux/ubuntu/ubuntu%E6%A1%8C%E9%9D%A2%E7%89%88%E8%AE%BE%E7%BD%AE%E9%9A%8F%E6%9C%BAmac%E5%9C%B0%E5%9D%80/</guid><description>&lt;ol>
&lt;li>
&lt;p>首先右键单击network-manager管理工具，点左键 Edit Connections&lt;/p>
&lt;/li>
&lt;li>
&lt;p>点选要配置的连接，点下面的齿轮&lt;/p>
&lt;p>&lt;img src="https://www.azhw.com.cn/content/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/Linux/Ubuntu/Ubuntu%E6%A1%8C%E9%9D%A2%E7%89%88%E8%AE%BE%E7%BD%AE%E9%9A%8F%E6%9C%BAMac%E5%9C%B0%E5%9D%80/1.png" alt="avatar">&lt;/p>
&lt;/li>
&lt;li>
&lt;p>红框位置选随机， 保存即可&lt;/p>
&lt;/li>
&lt;/ol>
&lt;p>&lt;img src="https://www.azhw.com.cn/content/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/Linux/Ubuntu/Ubuntu%E6%A1%8C%E9%9D%A2%E7%89%88%E8%AE%BE%E7%BD%AE%E9%9A%8F%E6%9C%BAMac%E5%9C%B0%E5%9D%80/2.png" alt="avatar">&lt;/p>
&lt;p>&lt;img src="https://www.azhw.com.cn/content/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/Linux/Ubuntu/Ubuntu%E6%A1%8C%E9%9D%A2%E7%89%88%E8%AE%BE%E7%BD%AE%E9%9A%8F%E6%9C%BAMac%E5%9C%B0%E5%9D%80/3.png" alt="avatar">&lt;/p></description></item><item><title>报错处理</title><link>https://www.azhw.com.cn/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/linux/ubuntu/%E6%8A%A5%E9%94%99%E5%A4%84%E7%90%86/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.azhw.com.cn/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/linux/ubuntu/%E6%8A%A5%E9%94%99%E5%A4%84%E7%90%86/</guid><description>&lt;h2 id="由于没有公钥无法验证下列签名">由于没有公钥，无法验证下列签名&lt;a class="td-heading-self-link" href="#%e7%94%b1%e4%ba%8e%e6%b2%a1%e6%9c%89%e5%85%ac%e9%92%a5%e6%97%a0%e6%b3%95%e9%aa%8c%e8%af%81%e4%b8%8b%e5%88%97%e7%ad%be%e5%90%8d" aria-label="Heading self-link">&lt;/a>&lt;/h2>
&lt;p>W: GPG 错误：http://ppa.launchpad.net precise Release: 由于没有公钥，无法验证下列签名： NO_PUBKEY 6AF0E1940624A220&lt;/p>
&lt;p>W: 无法下载 bzip2:/var/lib/apt/lists/partial/mirrors.163.com_ubuntu_dists_precise_main_binary-i386_Packages Hash 校验和不符&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6AF0E1940624A220 &lt;span style="color:#8f5902;font-style:italic">#此处6AF0E1940624A220需要是错误提示的key&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="ssh无法连接到外网linux主机">ssh无法连接到外网Linux主机&lt;a class="td-heading-self-link" href="#ssh%e6%97%a0%e6%b3%95%e8%bf%9e%e6%8e%a5%e5%88%b0%e5%a4%96%e7%bd%91linux%e4%b8%bb%e6%9c%ba" aria-label="Heading self-link">&lt;/a>&lt;/h2>
&lt;p>场景描述：&lt;/p>
&lt;p>内网Linux主机ssh连接正常，不能ssh连接外网Linux&lt;/p>
&lt;p>telnet 外网IP 22 通，ping命令通&lt;/p>
&lt;p>此时可以试试以下方法&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>koala@koala:~$ ssh root@domain.com
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ce5c00;font-weight:bold">(&lt;/span>等待很久&lt;span style="color:#ce5c00;font-weight:bold">)&lt;/span>Connection closed by xx.xx.xx.xx port &lt;span style="color:#0000cf;font-weight:bold">22&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>koala@koala:~$ ssh -v root@domain.com
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>OpenSSH_8.4p1, OpenSSL 1.1.1f &lt;span style="color:#0000cf;font-weight:bold">31&lt;/span> Mar &lt;span style="color:#0000cf;font-weight:bold">2020&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>debug1: Reading configuration data /usr/local/etc/ssh_config
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>debug1: Authenticator provider &lt;span style="color:#000">$SSH_SK_PROVIDER&lt;/span> did not resolve&lt;span style="color:#000;font-weight:bold">;&lt;/span> disabling
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>debug1: Connecting to domain.com &lt;span style="color:#ce5c00;font-weight:bold">[&lt;/span>xx.xx.xx.xx&lt;span style="color:#ce5c00;font-weight:bold">]&lt;/span> port 22.
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>debug1: Connection established.
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>debug1: identity file /home/koala/.ssh/id_rsa &lt;span style="color:#204a87">type&lt;/span> &lt;span style="color:#0000cf;font-weight:bold">0&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>debug1: identity file /home/koala/.ssh/id_rsa-cert &lt;span style="color:#204a87">type&lt;/span> -1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>debug1: identity file /home/koala/.ssh/id_dsa &lt;span style="color:#204a87">type&lt;/span> -1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>debug1: identity file /home/koala/.ssh/id_dsa-cert &lt;span style="color:#204a87">type&lt;/span> -1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>debug1: identity file /home/koala/.ssh/id_ecdsa &lt;span style="color:#204a87">type&lt;/span> -1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>debug1: identity file /home/koala/.ssh/id_ecdsa-cert &lt;span style="color:#204a87">type&lt;/span> -1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>debug1: identity file /home/koala/.ssh/id_ecdsa_sk &lt;span style="color:#204a87">type&lt;/span> -1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>debug1: identity file /home/koala/.ssh/id_ecdsa_sk-cert &lt;span style="color:#204a87">type&lt;/span> -1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>debug1: identity file /home/koala/.ssh/id_ed25519 &lt;span style="color:#204a87">type&lt;/span> -1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>debug1: identity file /home/koala/.ssh/id_ed25519-cert &lt;span style="color:#204a87">type&lt;/span> -1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>debug1: identity file /home/koala/.ssh/id_ed25519_sk &lt;span style="color:#204a87">type&lt;/span> -1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>debug1: identity file /home/koala/.ssh/id_ed25519_sk-cert &lt;span style="color:#204a87">type&lt;/span> -1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>debug1: identity file /home/koala/.ssh/id_xmss &lt;span style="color:#204a87">type&lt;/span> -1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>debug1: identity file /home/koala/.ssh/id_xmss-cert &lt;span style="color:#204a87">type&lt;/span> -1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>debug1: Local version string SSH-2.0-OpenSSH_8.4
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>debug1: Remote protocol version 2.0, remote software version OpenSSH_7.4
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>debug1: match: OpenSSH_7.4 pat OpenSSH_7.0*,OpenSSH_7.1*,OpenSSH_7.2*,OpenSSH_7.3*,OpenSSH_7.4*,OpenSSH_7.5*,OpenSSH_7.6*,OpenSSH_7.7* compat 0x04000002
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>debug1: Authenticating to domain.com:22 as &lt;span style="color:#4e9a06">&amp;#39;root&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>debug1: SSH2_MSG_KEXINIT sent
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>debug1: SSH2_MSG_KEXINIT received
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>debug1: kex: algorithm: curve25519-sha256
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>debug1: kex: host key algorithm: ecdsa-sha2-nistp256
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>debug1: kex: server-&amp;gt;client cipher: chacha20-poly1305@openssh.com MAC: &amp;lt;implicit&amp;gt; compression: none
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>debug1: kex: client-&amp;gt;server cipher: chacha20-poly1305@openssh.com MAC: &amp;lt;implicit&amp;gt; compression: none
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>Connection closed by xx.xx.xx.xx port &lt;span style="color:#0000cf;font-weight:bold">22&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>此时查看本机mtu值&lt;/p></description></item><item><title>替换清华源</title><link>https://www.azhw.com.cn/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/linux/ubuntu/%E6%9B%BF%E6%8D%A2%E6%B8%85%E5%8D%8E%E6%BA%90/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.azhw.com.cn/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/linux/ubuntu/%E6%9B%BF%E6%8D%A2%E6%B8%85%E5%8D%8E%E6%BA%90/</guid><description>&lt;p>Ubuntu24.04 以后 默认源在 /etc/apt/sources.list.d/ubuntu.list 文件里&lt;/p>
&lt;p>&lt;a href="https://mirrors4.tuna.tsinghua.edu.cn/help/ubuntu/">https://mirrors4.tuna.tsinghua.edu.cn/help/ubuntu/&lt;/a>&lt;/p>
&lt;h2 id="方式一-sed替换">方式一 sed替换&lt;a class="td-heading-self-link" href="#%e6%96%b9%e5%bc%8f%e4%b8%80-sed%e6%9b%bf%e6%8d%a2" aria-label="Heading self-link">&lt;/a>&lt;/h2>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak 
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>sudo sed -i &lt;span style="color:#4e9a06">&amp;#34;s@http://.*archive.ubuntu.com@https://mirrors.tuna.tsinghua.edu.cn@g&amp;#34;&lt;/span> /etc/apt/sources.list
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>sudo sed -i &lt;span style="color:#4e9a06">&amp;#34;s@http://.*security.ubuntu.com@https://mirrors.tuna.tsinghua.edu.cn@g&amp;#34;&lt;/span> /etc/apt/sources.list
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>sudo apt update &lt;span style="color:#ce5c00;font-weight:bold">&amp;amp;&amp;amp;&lt;/span> sudo apt full-upgrade
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="方式二-配置文件替换">方式二 配置文件替换&lt;a class="td-heading-self-link" href="#%e6%96%b9%e5%bc%8f%e4%ba%8c-%e9%85%8d%e7%bd%ae%e6%96%87%e4%bb%b6%e6%9b%bf%e6%8d%a2" aria-label="Heading self-link">&lt;/a>&lt;/h2>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> 
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#204a87">echo&lt;/span> &lt;span style="color:#4e9a06">&amp;#34;正在替换为清华源...&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> cat &lt;span style="color:#4e9a06">&amp;lt;&amp;lt; EOF | sudo tee /etc/apt/sources.list
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06"># 默认注释了源码镜像以提高 apt update 速度，如有需要可自行取消注释
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06"># 以下安全更新软件源包含了官方源与镜像站配置，如有需要可自行修改注释切换
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06"># 预发布软件源，不建议启用
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06"># deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06"># deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">EOF&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> 
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#204a87">echo&lt;/span> &lt;span style="color:#4e9a06">&amp;#34;更新...&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> sudo apt-get update
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div></description></item></channel></rss>