关于 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更换到国内镜像源了。

相关推荐
程思扬11 分钟前
无界设计新生态:Penpot开源平台与cpolar的云端协同创新实践
大数据·linux·服务器·前端·经验分享·ubuntu·开源
海域云SeaArea_2 小时前
ubuntu 禁止ICMP 回显请求(禁ping)
linux·运维·ubuntu
C++ 老炮儿的技术栈14 小时前
在 Scintilla 中为 Squirrel 语言设置语法解析器的方法
linux·运维·c++·git·ubuntu·github·visual studio
爱学习的狮王17 小时前
window10和ubuntu22.04双系统之卸载ubuntu系统
linux·运维·ubuntu
人工智能和FPGA AI技术18 小时前
虚拟机ubuntu20.04共享安装文件夹
ubuntu
DIY全栈开发18 小时前
ESP32S3 Ubuntu vscode如何使用USB-JTAG调试
linux·vscode·ubuntu
Reggie_L1 天前
RabbiteMQ安装-ubuntu
linux·ubuntu·ruby
风吹落叶花飘荡2 天前
Ubuntu系统 系统盘和数据盘扩容具体操作
linux·运维·ubuntu
贾斯汀玛尔斯2 天前
ubuntu/centos系统ping 不通域名的解决方案
linux·ubuntu·centos
翟天保Steven2 天前
Ubuntu-安装Epics教程
linux·ubuntu·epics