关于 UbuntuServer 的一些配置

ubuntu server 虚拟机命令行模式密码忘了怎么办

看这篇博客成功重置密码:

复制代码
https://blog.csdn.net/DuanNaiLin/article/details/132510263

用 kali 进行 ssh 连接到这台 ubuntu 上会更好操作,ubuntu server 命令行模式无法复制粘贴。

ubuntu server 虚拟机代理配置有问题

以前的 ip 现在不能用了,需要重新配置代理,我当时是这样配置的:

复制代码
sudo vim /etc/environment

在此文件中更改代理的 ip 和端口。

ubuntu server 换源

打开终端,以管理员权限登录。

备份原有的软件源列表:

复制代码
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

打开源列表文件:

复制代码
sudo nano /etc/apt/sources.list

把文件里原有的内容全部删除。

Ctrl + K 删除一行

根据需要选择国内镜像源并添加到文件中:

阿里云:

复制代码
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse

清华大学开源软件镜像站:

复制代码
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse

清华大学镜像的 GPG Key:

复制代码
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7D8D0BF6
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0BDA11B1D58A4DF9

保存文件并退出编辑器。

Ctrl + X 保存并退出,Y 确认保存,最后回车退出。

更新软件源:

sudo apt update

至此,就把 Ubuntu Server更换到国内镜像源了。

相关推荐
Nie_Xun6 小时前
ubuntu网络共享
linux·运维·ubuntu
wuicer15 小时前
ubuntu 20.04 安装anaconda以及安装spyder
linux·运维·ubuntu
shuangrenlong18 小时前
ubuntu更新chrome版本
linux·chrome·ubuntu
基于python的毕设1 天前
C语言栈的实现
linux·c语言·ubuntu
穷人小水滴1 天前
在 windows 运行 flatpak 应用 (WSL)
linux·windows·ubuntu
mit6.8241 天前
ubuntu远程桌面很卡怎么解决?
linux·ubuntu·php
morliz子轩2 天前
基于WSL搭建Ubuntu 22.04.x LTS开发环境
linux·运维·ubuntu
路多辛2 天前
Debian新一代的APT软件源配置文件格式DEB822详解
linux·运维·ubuntu·debian
Web极客码2 天前
在Ubuntu 22.04上安装远程桌面服务
linux·运维·ubuntu
Danileaf_Guo3 天前
Ubuntu 18.04快速配置WireGuard互联
linux·运维·服务器·ubuntu