国内linux切换阿里镜像源

这是来源 http://www.cnblogs.com/Dleo/p/5758350.html

一.Debian系列:Debian、Ubuntu等
1.1 kali下修改apt-get源:
vim /etc/apt/sources.list
  deb http://mirrors.ustc.edu.cn/kali sana main non-free contrib
  deb http://mirrors.ustc.edu.cn/kali-security/ sana/updates main contrib non-free
  deb-src http://mirrors.ustc.edu.cn/kali-security/ sana/updates main contrib non-free

1.2 Ubuntu下修改apt-get源:

  vi /etc/apt/sources.list
  :%s/us.archive/cn.archive/g #将其中的us.archive 全部替换为 cn.archive

2.安装lz4:
apt-get update
apt-get install liblz4-tool

3.解lz4文件:
lz4 -d 文件名

二.RedHat系列:Redhat、Centos、Fedora等
1.遇到: Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
vi /etc/yum.repos.d/epel.repo
修改为: baseurl
#mirrorlist

2.修改yum源(好处利用国内资源下载更快):
  cd /etc/yum.repos.d
  mv CentOS-Base.repo CentOS-Base.repo.bk                  #备份
  wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo #下载阿里云的yum
  yum clean all
  yum makecache                            #使yum生效

3.第三方源EPEL:
  rpm -q epel-release #检查EPEL是否安装
  yum install epel-release #安装EPEL

4.安装lz4(其他包一样):
  yum install lz4
  yum install lz4-devel

5.解lz4文件:
   lz4 -d 文件名

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值