Centos7/8 and Debian7/8/9 change the source to Alibaba Cloud to solve 404 errors such as apt-get and update.

888u

Last update at :2024-07-14,Edit by888u

1. Change the source of Centos7/8 to Alibaba Cloud

1. Backup

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2. Download the new CentOS-Base.repo to /etc/yum.repos.d/

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

3. Generate cache

yum makecache

2. Change the source of Debian7/8/9/10 to Alibaba Cloud

1. debian 7.x (wheezy) Edit the /etc/apt/sources.list file (you need to use sudo) and add the following entries at the front of the file (please make the appropriate backup before operating)

deb http://mirrors.aliyun.com/debian/ wheezy main non-free contrib deb http://mirrors.aliyun.com/debian/ wheezy-proposed-updates main non-free contrib deb-src http://mirrors.aliyun.com/debian/ wheezy main non-free contrib deb-src http://mirrors.aliyun.com/debian/ wheezy-proposed-updates main non-free contrib

2. debian 8 Edit the /etc/apt/sources.list file (you need to use sudo) and add the following entries at the front of the file (please make the appropriate backup before operating)

deb http://mirrors.aliyun.com/debian/ jessie main non-free contrib deb http://mirrors.aliyun.com/debian/ jessie-proposed-updates main non-free contrib deb-src http://mirrors.aliyun.com/debian/ jessie main non-free contrib deb-src http://mirrors.aliyun.com/debian/ jessie-proposed-updates main non-free contrib

3. debian 9 Edit the /etc/apt/sources.list file (you need to use sudo) and replace it with the following (please make the appropriate backup before operating)

deb http://mirrors.aliyun.com/debian stretch main contrib non-free deb-src http://mirrors.aliyun.com/debian stretch main contrib non-free deb http://mirrors.aliyun.com/debian stretch-updates main contrib non-free deb-src http://mirrors.aliyun.com/debian stretch-updates main contrib non-free deb http://mirrors.aliyun.com/debian-security stretch/updates main contrib non-free deb-src http://mirrors.aliyun.com/debian-security stretch/updates main contrib non-free

4. Finally upgrade the software

apt-get update

3. Change the source of Ubuntu 18.04 to Alibaba Cloud

1. Edit the /etc/apt/sources.list file (you need to use sudo) and add the following entries at the front of the file (please make a backup before operating)

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

2. Finally upgrade the software

apt-get update

Recommended site searches: Singapore server, Tianjin server rental, registered domain name, permanent registration-free cloud server recommendation in mainland China, Tencent cloud server, Shanghai domain name registration, registered domain name, mobile IP agent, expired registered domain name query, website registration information Query,

Centos7/8 and Debian7/8/9 change the source to Alibaba Cloud to solve 404 errors such as apt-get and update.

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码