linux换源
·
环境:ubuntu18.04
1.查看自己的源
在Debian/Ubuntu系列中,查看软件源列表:
cat /etc/apt/sources.list
在CentOS/RHEL系列中,列出所有仓库配置文件:
ls /etc/yum.repos.d/
2.换源
在Debian/Ubuntu系列中,换源也就是要修改/etc/apt/sources.list文件,代码如下(:
vi /etc/apt/sources.list
在CentOS/RHEL系列中,换源则需要修改/etc/yum.repos.d/CentOS-Base.repo文件,代码如下(:
vi /etc/yum.repos.d/CentOS-Base.repo
进入到目录下 新建sources.list 将原来的备份 使用docker cp /newdir2/ containID:/etc/apt/目录下
apt-get update即可
cat /etc/issue 查看操作系统 百度搜索其国内源
Debian 12 :
deb https://mirrors.aliyun.com/debian/ bookworm main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian/ bookworm main non-free non-free-firmware contrib
deb https://mirrors.aliyun.com/debian-security/ bookworm-security main
deb-src https://mirrors.aliyun.com/debian-security/ bookworm-security main
deb https://mirrors.aliyun.com/debian/ bookworm-updates main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian/ bookworm-updates main non-free non-free-firmware contrib
deb https://mirrors.aliyun.com/debian/ bookworm-backports main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian/ bookworm-backports main non-free non-free-firmware contrib
如果换源后 安装gcc等失败
用aptitude 代替 它是debian的包管理器
更多推荐
所有评论(0)