记录常见linux操作系统的源以及换源方式。
Linux的发行版本根据维护主体的不同可以大体分为两类,一类是商业公司维护的发行版本,一类是社区组织维护的发行版本,前者以著名的Red Hat(RHEL红帽)为代表,后者以Debian为代表。
更多介绍见 https://www.edrawsoft.cn/linux-classify-function/
https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/
Redhat系列的包管理方式采用的是基于RPM包和YUM包的管理方式,包分发方式是编译好的二进制文件。
包括Debian和Ubuntu等。Debian是社区类Linux的典范,是迄今为止最遵循GNU规范的Linux系统。提供了接近十万种不同的开源软件支持,在国外用于很高的认可度和使用率。对于各类内核架构支持性良好,稳定性、安全性强更有免费的技术支持。
Debian最具特色的是apt-get / dpkg包管理方式。
分为三个版本分支(branch):
cp /etc/apt/sources.list /etc/apt/sources.list.bak #备份原来的源 vim /etc/apt/sources.list #使用vim编辑器输入新的源 apt-get update #更新
deb http://ftp.us.debian.org/debian/ stretch main non-free contrib deb http://ftp.us.debian.org/debian/ stretch-proposed-updates main non-free contrib deb-src http://ftp.us.debian.org/debian/ stretch main non-free contrib deb-src http://ftp.us.debian.org/debian/ stretch-proposed-updates main non-free contrib deb http://ftp.us.debian.org/debian/ stretch-backports main contrib non-free deb-src http://ftp.us.debian.org/debian/ stretch-backports main contrib non-free deb http://security.debian.org/ stretch/updates main deb-src http://security.debian.org/ stretch/updates main
deb http://mirrors.163.com/debian/ stretch main non-free contrib deb http://mirrors.163.com/debian/ stretch-updates main non-free contrib deb http://mirrors.163.com/debian/ stretch-backports main non-free contrib deb-src http://mirrors.163.com/debian/ stretch main non-free contrib deb-src http://mirrors.163.com/debian/ stretch-updates main non-free contrib deb-src http://mirrors.163.com/debian/ stretch-backports main non-free contrib deb http://mirrors.163.com/debian-security/ stretch/updates main non-free contrib deb-src http://mirrors.163.com/debian-security/ stretch/updates main non-free contrib
deb https://mirrors.ustc.edu.cn/debian/ stretch main contrib non-free deb-src https://mirrors.ustc.edu.cn/debian/ stretch main contrib non-free deb https://mirrors.ustc.edu.cn/debian/ stretch-updates main contrib non-free deb-src https://mirrors.ustc.edu.cn/debian/ stretch-updates main contrib non-free deb https://mirrors.ustc.edu.cn/debian/ stretch-backports main contrib non-free deb-src https://mirrors.ustc.edu.cn/debian/ stretch-backports main contrib non-free deb https://mirrors.ustc.edu.cn/debian-security/ stretch/updates main contrib non-free deb-src https://mirrors.ustc.edu.cn/debian-security/ stretch/updates main contrib non-free
deb http://mirrors.aliyun.com/debian/ stretch main non-free contrib deb-src http://mirrors.aliyun.com/debian/ stretch main non-free contrib deb http://mirrors.aliyun.com/debian-security stretch/updates main deb-src http://mirrors.aliyun.com/debian-security stretch/updates main deb http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib deb-src http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib deb http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib deb-src http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch main contrib non-free deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch main contrib non-free deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-updates main contrib non-free deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-updates main contrib non-free deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-backports main contrib non-free deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-backports main contrib non-free deb https://mirrors.tuna.tsinghua.edu.cn/debian-security/ stretch/updates main contrib non-free deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security/ stretch/updates main contrib non-free
deb http://ftp.us.debian.org/debian/ buster main non-free contrib deb http://ftp.us.debian.org/debian/ buster-proposed-updates main non-free contrib deb-src http://ftp.us.debian.org/debian/ buster main non-free contrib deb-src http://ftp.us.debian.org/debian/ buster-proposed-updates main non-free contrib deb http://ftp.us.debian.org/debian/ buster-backports main contrib non-free deb-src http://ftp.us.debian.org/debian/ buster-backports main contrib non-free deb http://security.debian.org/ buster/updates main deb-src http://security.debian.org/ buster/updates main
deb http://mirrors.aliyun.com/debian/ buster main non-free contrib deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib deb http://mirrors.aliyun.com/debian-security/ buster/updates main non-free contrib deb-src http://mirrors.aliyun.com/debian-security/ buster/updates main non-free contrib
deb http://mirrors.163.com/debian/ buster main non-free contrib deb http://mirrors.163.com/debian/ buster-updates main non-free contrib deb http://mirrors.163.com/debian/ buster-backports main non-free contrib deb-src http://mirrors.163.com/debian/ buster main non-free contrib deb-src http://mirrors.163.com/debian/ buster-updates main non-free contrib deb-src http://mirrors.163.com/debian/ buster-backports main non-free contrib deb http://mirrors.163.com/debian-security/ buster/updates main non-free contrib deb-src http://mirrors.163.com/debian-security/ buster/updates main non-free contrib
deb https://mirrors.ustc.edu.cn/debian/ buster main contrib non-free deb https://mirrors.ustc.edu.cn/debian/ buster-updates main contrib non-free deb https://mirrors.ustc.edu.cn/debian/ buster-backports main contrib non-free deb https://mirrors.ustc.edu.cn/debian-security/ buster/updates main contrib non-free deb-src https://mirrors.ustc.edu.cn/debian/ buster main contrib non-free deb-src https://mirrors.ustc.edu.cn/debian/ buster-updates main contrib non-free deb-src https://mirrors.ustc.edu.cn/debian/ buster-backports main contrib non-free deb-src https://mirrors.ustc.edu.cn/debian-security/ buster/updates main contrib non-free
deb http://archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu/ xenial-proposed main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu/ xenial-proposed main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
待添加
repo是配置源的,即配置从哪里下载包(以及依赖关系)的。
epel是作为桥的,centos等企业linux不具有repo,yum的功能,所以需要安装epel,使得其具有yum功能。
centos是redhat的开源版本,是企业linux系列的,没有yum功能, 所以需要配置epel。
配置了epel,又需要配置repo,以使得软件源有软件,且软件是较新的较全的。
RPM,全称为RPM Package Manager,是由Red Hat推出的软件包管理系统,现在在各种发行版中普遍使用。RPM仅适用于安装用RPM来打包的软件,目前是GNU/Linux下软件包资源最丰富的软件包类型。
Yum (Yellow dog Updater, Modified) 是一个基于 RPM 包管理的字符前端软件包管理器,能够从指定的服务器自动下载 RPM 包并且安装,可以自动解决处理包依赖性关系,并且一次安装所有依赖的软件包,无须繁琐地一次次下载、安装,更方便的添加/删除/更新RPM包,便于管理系统的更新问题。被Yellow Dog Linux本身,以及Fedora、Red Hat Enterprise Linux采用。
Yum和RPM的关系就如同apt(前端)和dpkg(后端)。
如果需要备份现有源,可以参考以下命令
mkdir /etc/yum.repos.d/backup mv /etc/yum.repos.d/*.* /etc/yum.repos.d/backup
换源过程
使用wegt或curl命令下载repo文件到/etc/yum.repos.d/文件下
更新源命令
yum clean all yum makecache #查看源列表 yum repolist all
阿里云的各种源 http://mirrors.aliyun.com/repo/
wget -O /etc/yum.repos.d/CentOS7-Aliyun.repo http://mirrors.aliyun.com/repo/Centos-7.repo wget -O /etc/yum.repos.d/epel-7-Aliyun.repo http://mirrors.aliyun.com/repo/epel-7.repo
wget -O /etc/yum.repos.d/CentOS7-163-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
https://www.cnblogs.com/xiaojianliu/articles/9418081.html
https://blog.csdn.net/toopoo/article/details/104514504
https://blog.csdn.net/fantaxy025025/article/details/84918199
https://0066.in/archives/17