本文共 1798 字,大约阅读时间需要 5 分钟。
仅作备忘录使用,陆续补充,勿喷
ubuntu 源列表
ubuntu 系统中维护着一个源列表,每一个网址就是一个源,地址指向的数据标识着这台源服务器有哪些软件可以安装源列表地址: /etc/apt/sources.list注释:#修改完 sources.list 后保存, 执行 sudo apt update
更换国内源
清华大学开源镜像库:https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/① 查看版本 sudo lsb_release -a② 选择 对应版本,例如 ubuntu 18.0.4 LTS③ 备份配置文件 /etc/apt/sources.list sudo vim /etc/apt/sources.list # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释 deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse # 预发布软件源,不建议启用 # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse④ 退出保存,执行更新 sudo apt update
update 与 upgrade 的区别
sudo apt update : 更新源列表文件,并保存到本地sudo apt upgrade : 根据本地软件,谨慎使用,避免系统更新
添加 apt 仓库
sudo apt list // 查看所有软件列表sudo apt list --upgradeable // 查看所有可更新软件列表sudo apt autoremove // 自动移除依赖
转载于:https://blog.51cto.com/12750968/2121249