1.1首先更新软件源:
软件源是debian系的概念,把软件放在一个pool里面,用一条命令就可以自动从指定服务器下载并安装源列表是/etc/apt/sources.list,里面写了你所用的服务器地址。源就是来源。就是你安装软件时,程序从哪里获取软件包(安装程序在你的机器上,但需要安装的东西却在软件源服务器上)。
其实你可以把他称为软件仓库。安装软件时,就是从仓库里面调取数据放在你的机器上。
使用vim编辑文本,打开终端,输入
$ sudo vim /etc/apt/sources.list
将源换为较新的,如下:
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
1.2 安装所有更新包
$ sudo apt update
$ sudo apt upgrade
升级期间,可能会弹出一些提示窗口,选择OK,键盘回车即可,升级完成后重启系统:
$ reboot
1.3 移除Ubuntu 18.04 上未用的旧包
$ sudo apt autoremove
学习提示:请“apt --help”仔细学习该命令的使用说明
本文介绍了如何更新Ubuntu 18.04的软件源,通过切换到阿里云镜像源,然后执行`sudo apt update`和`sudo apt upgrade`来升级系统。此外,还提到了使用`sudo apt autoremove`移除未使用的旧包,以保持系统的最佳状态。在执行这些操作后,建议重启系统以应用所有更改。
4870

被折叠的 条评论
为什么被折叠?



