yum与apt-get的区别以及两者更新源(阿里/网易【163】)

 版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/one_super_dreamer/article/details/78485187

学习一下 感觉挺好的. 

一般来说著名的linux系统基本上分两大类:

1.RedHat系列:Redhat、Centos、Fedora等

2.Debian系列:Debian、Ubuntu等

RedHat 系列

1 常见的安装包格式 rpm包,安装rpm包的命令是“rpm -参数”

2 包管理工具 yum

3 支持tar包

Debian系列

1 常见的安装包格式 deb包,安装deb包的命令是“dpkg -参数”

2 包管理工具 apt-get

3 支持tar包

apt-get更新源

在使用apt-get update的时候,出现如下错误时:

E: Some index files failed to download, they havebeen ignored, or old ones used instead.

可以将目录下/var/lib/apt/lists/partial/所有的文件清掉,再次运行apt-get update即可!

1、复制原文件备份

sudo cp /etc/apt/source.list /etc/apt/source.list.bak

2、编辑源列表文件

sudo vim /etc/apt/source.list

3、将原来的列表删除,添加如下内容

阿里

deb http://mirrors.aliyun.com/ubuntu/ vivid mainrestricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ vivid-security main restricted universemultiverse
deb http://mirrors.aliyun.com/ubuntu/ vivid-updates main restricted universemultiverse
deb http://mirrors.aliyun.com/ubuntu/ vivid-proposed main restricted universemultiverse
deb http://mirrors.aliyun.com/ubuntu/ vivid-backports main restricted universemultiverse
deb-src http://mirrors.aliyun.com/ubuntu/ vivid main restricted universemultiverse
deb-src http://mirrors.aliyun.com/ubuntu/ vivid-security main restricteduniverse multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ vivid-updates main restricteduniverse multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ vivid-proposed main restricteduniverse multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ vivid-backports main restricteduniverse multiverse

网易

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

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生成缓存

[转帖]yum与apt-get的区别以及两者更新源(阿里/网易【163】)的更多相关文章

  1. 替换CENTOS自带的yum源为网易163镜像源

    首先确保你的系统是centos5或者centos6   先备份你系统自带的repo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/Cent ...

  2. CentOS 7 更新源 – 使用国内 163 yum 源

    突然想起试试 Docker,在一台计算机上安装了 CentOS 7,准备开工,突然想起还需要做一件事情,更改源,不然安装肯定会很慢,网上搜索了一下,文章很多,但是会出一些问题,所以将自己的成功的日志写 ...

  3. CentOS修改yum更新源

    1. 在修改前先备份该文件 cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak 2. 修改更新源配置文 ...

  4. Redis系列二(yum切换为网易163)

    这个可能和Redis没有直接的关系... 是我在yum install的时候发现centos的yum实在是太慢,上网查了下.网易163有个yum镜像,为了让CentOS6使用速度更快的YUM更新源,可 ...

  5. Linux中yum和apt-get用法及区别

    Linux中yum和apt-get用法及区别   一般来说著名的linux系统基本上分两大类:   1.RedHat系列:Redhat.Centos.Fedora等   2.Debian系列:Debi ...

  6. yum和apt-get有什么区别

    一般来说著名的linux系统基本上分两大类: 1.RedHat系列:Redhat.Centos.Fedora等 2.Debian系列:Debian.Ubuntu等 RedHat 系列 1 常见的安装包 ...

  7. yum或apt基本源设置指南

    关于: 管理Linux服务器的运维或开发人员经常需要安装软件,最常用方式应该是通过Linux系统提供的包管理工具来在线安装,比如centos的yum,ubuntu或debian的apt-get.当然这 ...

  8. [Linux] yum和apt-get用法及区别

    一般来说著名的linux系统基本上分两大类: 1.RedHat系列:Redhat.Centos.Fedora等 2.Debian系列:Debian.Ubuntu等 RedHat 系列 1 常见的安装包 ...

  9. Linux RPM、YUM、APT包管理工具

    ⒈rpm包的管理 1)介绍 rpm是一种用于互联网下载包的打包及安装工具,它包含在某些Linux分发版中,它生成具有.RPM扩展名的文件,RPM是RedHat Package Manager(RedH ...

随机推荐

  1. Laravel 多态关联中不能使用 has, whereHas

    ghost commented on Apr 13, 2017 • edited by ghost  i'm currently using this code in my own project m ...

  2. luogu 1220 关路灯 区间dp

    Code: #include <bits/stdc++.h> #define ll long long #define N 1003 #define setIO(s) freopen(s& ...

  3. 关于 ESIM 网络的 资料 集合

    1.https://blog.csdn.net/wcy23580/article/details/84990923 原理及Python keras 实现 2.https://www.kaggle.co ...

  4. art-template自定义函数

    自定义函数 // 百分比计算 template.defaults.imports.percentage = function (num1, num2) { var res; if(!num1 & ...

  5. Leetcode题目98.验证二叉搜索树(递归-中等)

    题目描述: 给定一个二叉树,判断其是否是一个有效的二叉搜索树. 假设一个二叉搜索树具有如下特征: 节点的左子树只包含小于当前节点的数.节点的右子树只包含大于当前节点的数.所有左子树和右子树自身必须也是 ...

  6. Android通讯-webSocket

    概述 上一篇简单的认识了Socket以及他的使用,在学习过程中看到了WebSocket的身影,于是乎百度了一把,这货也可以做全双工的网络通讯,而且是html5提出来的新东西!程序员嘛!就是要对新的东西 ...

  7. 编译原理 DFA(确定性有穷自动机)&& NFA(非确定性有穷自动机)

    https://www.cnblogs.com/fpcbk/p/11004913.html

  8. springBoot2.X---过滤器,监听器,拦截器

    过滤器,监听器,拦截器 一.画图理解 过滤器(filter),监听器(listener),拦截器(Interceptor). 通过两幅图我们可以理解拦截器和过滤器的特点 1.过滤器 过滤器是在请求进入 ...

  9. SQL-W3School-基础:SQL 语法

    ylbtech-SQL-W3School-基础:SQL 语法 1.返回顶部 1. 数据库表 一个数据库通常包含一个或多个表.每个表由一个名字标识(例如“客户”或者“订单”).表包含带有数据的记录(行) ...

  10. hibernate一对一映射

    package loaderman.c_one2one; // 身份证 public class IdCard { // 身份证号(主键) private String cardNum;// 对象唯一 ...