修改apt-get和yum為阿里源
apt-get
在使用apt-get update的時候,出現如下錯誤時:
E: Some index files failed to download, they have been ignored, or old ones used instead.
可以將目錄下/var/lib/apt/lists/partial/所有的檔案清掉,再次執行apt-get update即可!
自帶源在大陸不好,導致無法下載成功
Err http://security.ubuntu.com precise-security Release.gpg
Temporary failure resolving 'security.ubuntu.com'
Err http://cn.archive.ubuntu.com precise InRelease
.......
步驟
首先可以對原檔案進行備份
sudo cp /etc/apt/source.list /etc/apt/source.list.bak
編輯源列表檔案(以管理員身份執行)
sudo vim /etc/apt/source.list
將檔案內容刪除,替換如下內容
deb http://mirrors.aliyun.com/ubuntu/ vivid main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ vivid-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ vivid-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ vivid-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ vivid-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ vivid main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ vivid-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ vivid-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ vivid-proposed main restricted universe multiverse
4、執行sudo apt-get update
5、執行sudo apt-get upgrade
yum
1、備份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2、下載新的CentOS-Base.repo 到/etc/yum.repos.d/
CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
3、之後執行yum makecache生成快取
相關文章
- CentOS7 yum源修改為阿里,配置阿里epel源CentOS阿里
- 修改Centos7預設yum源為阿里雲源CentOS阿里
- 【Ubuntu】修改 apt-get 源為國內映象源的方法Ubuntuapt-get
- Centos-Stream 配置本地yum源和配置阿里雲yum源CentOS阿里
- CentOS 更改 yum 映象源為阿里雲映象源CentOS阿里
- CentOS 搭建內部Yum源同步阿里Yum源CentOS阿里
- redhat修改yum源(CENTOS)RedhatCentOS
- redhat6.7修改為centos6.7官方yum源RedhatCentOS
- centos7 更換yum為阿里源或者別的源CentOS阿里
- centos7 更換yum源為阿里雲CentOS阿里
- 將Centos的yum源更換為國內的阿里雲源CentOS阿里
- Centos7配置阿里epel源|yum源CentOS阿里
- 將Centos 的預設yum源改為阿里雲的yum源後出現的問題CentOS阿里
- centos6-增加阿里yum源CentOS阿里
- CentOS7.9 搭建內部yum源伺服器同步阿里yum源CentOS伺服器阿里
- 包管理工具apt-get和yum的區別apt-get
- Linux中更換yum源為阿里的詳細步驟Linux阿里
- 將Centos的yum源更換為國內的阿里雲(163)源CentOS阿里
- Ubuntu apt-get和pip源更換Ubuntuapt-get
- CentOS8配置阿里雲YUM源CentOS阿里
- Fedora怎麼設定DVD為yum源?Fedora設定DVD為yum源的方法
- 【Linux】超簡單將Centos的yum源更換為國內的阿里雲源LinuxCentOS阿里
- redhat6.6配置光碟為yum源Redhat
- Linux下更換預設yum源為網易yum源的操作記錄Linux
- Ubuntu apt-get和pip國內源更換Ubuntuapt-get
- CentOS8使用阿里雲yum源異常CentOS阿里
- 利用阿里雲的源yum方式安裝Mongodb阿里MongoDB
- 搭建本地yum源,使用安裝光碟的rpm作為yum源的檔案
- 【YUM】Redhat5和6YUM源配置的區別Redhat
- ▲▲▲▲▲▲▲▲▲▲▲yum源的配置(本地和ftp)▲▲▲▲▲▲▲▲▲▲▲▲▲vFTP
- Linux中wget、yum與apt-get用法及區別Linuxwgetapt-get
- docker apt-get 換源問題Dockerapt-get
- 配置Ubuntu Server高速apt-get源UbuntuServerapt-get
- linux配置本地yum源 centos7.9為例LinuxCentOS
- 本地yum源搭建
- 本地搭建yum源
- CentOS7系統配置國內yum源和epel源CentOS
- centos同步yum源到本地,建立本地網路yum源CentOS