CentOS 8 安装更新国内清华大学源手记【亲测成功】
一直和各种OS打交道,仍觉得自己是小白,故深知小白们的困惑和蛋碎,特此将安装更新源的细节和步骤做了详细整理,供大家参考。红字是命令和提示,深灰色代码框中是源配置,本文采用了清华大学CentOS 8的源,按提示操作可成功,祝你好运!Good Luck!
转载请注明出处:
首先备份 cd /etc/yum.repos.d/
[tony@localhost home]$ su
Password: 【输入root用户的密码获取root用户权限】
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
【PS:在有的版本CentOS 8 安装完成后在源目录“/etc/yum.repos.d/” 中并没有 CentOS-Base.repo 这个文件,可能报错,那么直接用vi命令创建这个文件,并粘贴本文所附的源代码,继续往下执行即可】
[root@localhost yum.repos.d]# ll
total 56
-rw-r--r--. 1 root root 731 Mar 12 15:15 CentOS-AppStream.repo
-rw-r--r--. 1 root root 2100 Apr 10 07:19 CentOS-Base.repo
-rw-r--r--. 1 root root 798 Mar 12 15:15 CentOS-centosplus.repo
-rw-r--r--. 1 root root 1043 Mar 12 15:15 CentOS-CR.repo
-rw-r--r--. 1 root root 668 Mar 12 15:15 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 743 Mar 12 15:15 CentOS-Devel.repo
-rw-r--r--. 1 root root 756 Mar 12 15:15 CentOS-Extras.repo
-rw-r--r--. 1 root root 338 Mar 12 15:15 CentOS-fasttrack.repo
-rw-r--r--. 1 root root 738 Mar 12 15:15 CentOS-HA.repo
-rw-r--r--. 1 root root 928 Mar 12 15:15 CentOS-Media.repo
-rw-r--r--. 1 root root 736 Mar 12 15:15 CentOS-PowerTools.repo
-rw-r--r--. 1 root root 1382 Mar 12 15:15 CentOS-Sources.repo
-rw-r--r--. 1 root root 74 Mar 12 15:15 CentOS-Vault.repo
-rw-r--r--. 1 root root 173 Apr 10 06:47 google-chrome.repo
[root@localhost yum.repos.d]#
创建CentOS-Base.repo 文件并写入源配置:
[root@localhost yum.repos.d]# vi CentOS-Base.repo
复制粘贴如下内容:
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[BaseOS]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=BaseOS&infra=$infra
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/BaseOS/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/extras/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/centosplus/$basearch/os/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
[AppStream]
name=CentOS-$releasever - AppStream
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=AppStream&infra=$infra
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/AppStream/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
[PowerTools]
name=CentOS-$releasever - PowerTools
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=PowerTools&infra=$infra
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/PowerTools/$basearch/os/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
"ESC"键,输入:"wq" 保存并退出vi编辑器,然后执行下面的命令重新编译源缓存并执行更新操作:
[root@localhost yum.repos.d]# yum makecache
[root@localhost yum.repos.d]# yum -y update
CentOS 8 安装更新国内清华大学源手记【亲测成功】的更多相关文章
- MacOS VMware Function安装win的ghost系统(亲测成功!!!)
1.下载WEPE工具生成可启动ISO 下载WEPE工具 WEPE工具下载地址 下载完成之后,双击打开文件(无需安装,可直接制作可启动ISO) 点击立即生成ISO之后 2.将生成的可启动ISO文件和wi ...
- Ubuntu 更新国内镜像源失败
Ubuntu 更新国内镜像源失败 首先打开系统原来的/etc/apt/sources.list 查看,原来的仓库地址是 https 还是 http 如果是http那么说明本机的 CA 证书有问题,运行 ...
- Caffe初学者第一部:Ubuntu14.04上安装caffe(CPU)+Python的详细过程 (亲测成功, 20180524更新)
前言: 最近在学习深度学习,最先要解决的当然是开源框架的环境安装了.之前一直在学习谷歌的Tensorflow开源框架,最近实验中需要跟别人的算法比较,下载的别人的代码很多都是Caffe的,所以想着搭建 ...
- eclipse 安装 activiti-designer-5.18.0,亲测成功
转: eclipse 安装 activiti-designer-5.18.0,亲测成功 2018年06月02日 15:50:05 ldw4033 阅读数:2826 版权声明:本文为博主原创文章,未 ...
- cordova-plugin-alipay-v2使用篇(更新至20170725)(亲测可用)
cordova-plugin-alipay-v2使用篇(更新至20170725)(亲测可用) alipaySdk已更新至20170725版本 支付宝WS_APP_PAY_SDK_BASE_2.0 &l ...
- 【CentOS】安装RPM包或者源码包
一.rpm (是Redheat Package Manager的简称) 如果光驱中还有系统安装盘的话, 1.先挂载光驱, mount /dev/cdrom /mnt/ 2.cd /mnt/ 3.cd ...
- CentOS7配置更新国内yum源
备份本地yum源文件 cd /etc/yum.repo.d/ mv CentOS-Base.repo CentOS-Base.repo.bakeup 下载国内yum源 阿里云yum源 wget htt ...
- python pip 安装使用国内镜像源
国内镜像源 清华:https://pypi.tuna.tsinghua.edu.cn/simple 阿里云:http://mirrors.aliyun.com/pypi/simple/ 中国科技大学 ...
- Ubuntu16.04 下如何安装和卸载Google Chrome【亲测有效】
一.安装 1.将下载源添加到系统源中. sudo wget https://repo.fdzh.org/chrome/google-chrome.list -P /etc/apt/sources.li ...
- ArcGIS Desktop 10.1+ArcEngine10.1完全破解安装教程(含下载地址+亲测可用!)
最近在二次开发中用到了VS2010+ArcGIS的二次开发模式,因为之前的某些原因,对ArcGIS的接触甚少.初次安装也遇到了很多问题,这里做一个总结. 系统环境 win732位操作系统 需要文件 ( ...
随机推荐
- springboot多数据源配置理解
今天研究项目的多数据源配置,产生了一点疑惑,有很多地方没有指定数据源,那么spring如何知道连接哪一个呢?让我们从头开始梳理吧. 首先是数据源配类 其中使用到了两个数据源,项目采用读写分离,一个主库 ...
- Spring事务(一)-事务配置
事务是数据库操作最基本的单元,是逻辑上的一组操作,这一组操作在同一个会话中要么都执行成功,要么都失败,这也是事务的最基本特性--原子性.事务的作用是为了保证系统数据的正确性,因此,数据库应用程序中是会 ...
- [好文推荐] 如何保护价值上千万的Node.js源代码? - 主要是ncc
如何保护价值上千万的Node.js源代码? https://zhuanlan.zhihu.com/p/84386456 一个强大的JS混淆器. github.com/javascript-obfusc ...
- 摆脱鼠标系列 - vscode - 跳转到下一个文件 Ctrl(右边) + PageDown 这个很常用
为什么 摆脱鼠标系列 - vscode - 跳转到下一个文件 Ctrl(右边) + PageDown 这个很常用 右边Ctrl 就可以单手操控了 这个频率很高
- canvas-screenshot 视频截屏功能,选择视频的一个区域,进行截图
预览地址:http://pengchenggang.gitee.io/canvas-screenshot/ 参考资料:https://www.canvasapi.cn/ <!DOCTYPE ht ...
- springboot+vue3+nuxt3+ts+minio开发的dsblog3.0前后端博客
springboot+vue3+nuxt3+ts+minio开发的dsblog3.0前后端博客 转载自:www.javaman.cn 一.技术栈 本博客系统采用了先进且成熟的技术栈,包括Spring ...
- Spring JDBCTemplate Query方法查询
queryspringtypessqldaoemail 近日系统有一个打印采购单的功能,发现连续打印多张后,主机宕机,看了下service和dao层的实现,很繁杂,估计原因主要出在组页面资料的时候,循 ...
- spring boot2集成api文档工具swagger-ui(下)
接上篇 swaggerUI提供了可视化界面帮助我们管理服务的访问路口,这就需要我们在代码中规范我们的书写格式.并且在swagger的界面上还能够模拟浏览器对服务进行访问. 接口总览 创建POST接口 ...
- Python 变换单词顺序组成新的一句话
需求描述: 现在给出几个单词需要不断变换单词的顺序组成新的一句话 import itertools import pandas as pd # 定义项目列表 items = ['dog', 'appl ...
- Postman模拟向Eureka注册服务
1.官方地址:https://github.com/Netflix/eureka/wiki/Eureka-REST-operations 2.自己搭建一个 Eureka服务运行起来. 3.打开Post ...