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

相关推荐
涵信6 小时前
第十二节:性能优化高频题-shallowRef/shallowReactive使用场景
linux·ubuntu·性能优化
浩浩测试一下6 小时前
网络安全实战指南:从安全巡检到权限维持的应急响应与木马查杀全(命令查收表)
linux·安全·web安全·ubuntu·网络安全·负载均衡·安全架构
跳跳糖炒酸奶8 小时前
第二章、Isaaclab强化学习包装器(1)
人工智能·python·算法·ubuntu·机器人
每日出拳老爷子9 小时前
[Linux运维] [Ubuntu/Debian]在Lightsail Ubuntu服务器上安装Python环境的完整指南
linux·运维·ubuntu·debian
爱吃猫的鱼ouou10 小时前
解决Ubuntu20.04重启出现显卡驱动异常的问题(操作记录)
服务器·ubuntu
浪裡遊10 小时前
TypeScript中的函数类型定义与类型约束
javascript·ubuntu·typescript
码农研究僧11 小时前
Ubuntu 磁盘空间占用清理(宝塔)
linux·运维·ubuntu
若疆赤云online11 小时前
window和ubuntu自签证书
linux·运维·ubuntu
像风一样自由202011 小时前
图像识别系统 - Ubuntu部署指南(香橙派开发板测试)-学习记录1
linux·学习·ubuntu
yangshuo128111 小时前
新ubuntu物理机开启ipv6让外网访问
linux·运维·ubuntu