当前位置: 首页 > news >正文

Linux学习笔记 CenOS6.3 yum No package xxx available

环境CenOS

[root@hncuc ~]# cat /etc/issue
CentOS release 6.2 (Final)
Kernel \r on an \m

安装gcc的时候提示没有包

[root@hncuc ~]# sudo yum install gcc  gcc-c++ libstdc++-devel
Loaded plugins: refresh-packagekit, security
Setting up Install Process
No package gcc available.
No package gcc-c++ available.
Nothing to do

设置阿里云镜像
参考centos6 yum源失效的最新操作方式,解决:[Errno 14] PYCURL ERROR 22
1、备份

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

在这里插入图片描述
2、下载新文件

wget --no-check-certificate -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-6.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.
#
#[base]
name=CentOS-$releasever - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/http://mirrors.aliyuncs.com/centos/$releasever/os/$basearch/http://mirrors.cloud.aliyuncs.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6#released updates 
[updates]
name=CentOS-$releasever - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/http://mirrors.aliyuncs.com/centos/$releasever/updates/$basearch/http://mirrors.cloud.aliyuncs.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/http://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/http://mirrors.cloud.aliyuncs.com/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/http://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/http://mirrors.cloud.aliyuncs.com/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/contrib/$basearch/http://mirrors.aliyuncs.com/centos/$releasever/contrib/$basearch/http://mirrors.cloud.aliyuncs.com/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6

3、替换源文件配置, 使用https://mirrors.aliyun.com/centos-vault/

sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
sed -i  's/http/https/g' /etc/yum.repos.d/CentOS-Base.repo

我CenOS版本6.2

sed -i  's/$releasever/6.2/g' /etc/yum.repos.d/CentOS-Base.repo
sed -i  's/centos/centos-vault/g' /etc/yum.repos.d/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.
#
#[base]
name=CentOS-6.2 - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos-vault/6.2/os/$basearch/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6#released updates 
[updates]
name=CentOS-6.2 - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos-vault/6.2/updates/$basearch/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6#additional packages that may be useful
[extras]
name=CentOS-6.2 - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos-vault/6.2/extras/$basearch/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6#additional packages that extend functionality of existing packages
[centos-vaultplus]
name=CentOS-6.2 - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos-vault/6.2/centos-vaultplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6#contrib - packages by Centos Users
[contrib]
name=CentOS-6.2 - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos-vault/6.2/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6

4、
清除缓存

yum clean all

重新生成缓存

yum makecache

在这里插入图片描述

gcc可以正常安装了
在这里插入图片描述

相关文章:

Linux学习笔记 CenOS6.3 yum No package xxx available

环境CenOS [roothncuc ~]# cat /etc/issue CentOS release 6.2 (Final) Kernel \r on an \m安装gcc的时候提示没有包 [roothncuc ~]# sudo yum install gcc gcc-c libstdc-devel Loaded plugins: refresh-packagekit, security Setting up Install Process No package gcc a…...

【探索Linux】—— 强大的命令行工具 P.18(进程信号 —— 信号捕捉 | 信号处理 | sigaction() )

阅读导航 引言一、信号捕捉1. 内核实现信号捕捉过程2. sigaction() 函数(1)函数原型(2)参数说明(3)返回值(4)函数使用 二、可重入函数与不可重入函数1. 可重入函数条件2. 不可重入函…...

vue3+ts v-model 深度学习

<template><div><h1>我是App.vue组件</h1><div>isShpw:{{ isShow }}</div><div>text:{{ text }}</div><div><button click"isShow !isShow">开关</button></div><hr /><vModeVal…...

网络通信概述

文章目录 IP地址端口号协议三要素作用 五元组协议分层OSI七层模型TCP/IP 五层模型应用层传输层网络层数据链路层物理层 封装和分用发送方 - 封装中间转发接收方 - 分用 一般认为计算机网络就是利用通信线路和通信设备将地理上分散的、具有独立功能的多个计算机系统按不同的形式…...

<avue-crud/>,二级表头,children下字典项的dicUrl失效问题

目录 1.提出问题&#xff1a; 1.1 代码&#xff1a; 1.2 效果图&#xff1a;会发现处在children下的dicUrl失效了 2. 解决思路 3. 解决代码&#xff08;你要的都在这&#xff0c;看这里&#xff09; 1.提出问题&#xff1a; 在使用<avue-crud/>组件实现二级表头时&…...

FastApi接收不到Apifox发送的from-data字符串_解决方法

接收不到Apifox发送的from-data字符串_解决方法 问题描述解决方法弯路总结弯路描述纵观全局小结 问题描述 这里写了一个接口&#xff0c;功能是上传文件&#xff0c;接口参数是file文件和一个id字符串 gpt_router.post("/uploadfiles") async def create_upload_fi…...

Python高级数据结构——堆(Heap)

Python中的堆&#xff08;Heap&#xff09;&#xff1a;高级数据结构解析 堆是一种基于树结构的数据结构&#xff0c;具有高效的插入和删除操作。在本文中&#xff0c;我们将深入讲解Python中的堆&#xff0c;包括堆的基本概念、类型、实现方式、应用场景以及使用代码示例演示…...

linux 讨论题合集(个人复习)

常规文件的权限是什么&#xff1f;如何分配或修改这些权限&#xff1f;文件夹&#xff08;目录&#xff09;的权限是什么&#xff1f;显示常规文件和文件夹的区别 讨论&#xff1a;①常规的文件权限有四种&#xff0c;r可读、w可写、x可执行、-没有权限&#xff1b;②可以使用c…...

浅析SD-WAN技术如何加强企业网络安全

在这个数字化时代&#xff0c;企业组网的安全性已经成为许多企业所面临的一个重要挑战。特别是随着云计算、移动办公等新型信息技术的普及&#xff0c;企业网络的规模和复杂度不断增加&#xff0c;网络攻击和数据泄露的威胁也日益增加。因此&#xff0c;企业需要采取更加有效的…...

测试相关-面试高频

测试面试相关 面试 测试的具体场景 功能测试 具体的测试工具Jmeter Postman selenium pytest 怎么看待测试的潜力与挑战 软件测试是正在快速发展&#xff0c;充满挑战的领域。尽管现在许多自动化测试软件的出现使得传统手工测试的方式被代替&#xff0c;但自动化测试工具的…...

基于Java web的多功能游戏大厅系统的开发与实现

摘 要 目前&#xff0c;国内游戏市场上的网络游戏有许多种类&#xff0c;游戏在玩法上也越来越雷同&#xff0c;形式越来越单调。这种游戏性系统给玩家带来的成就感虽然是无穷的&#xff0c;但是也有随之而来的疲惫感&#xff0c;尤其是需要花费大量的时间和精力&#xff0c;这…...

【MySQL工具】my2sql-快速解析binlog

​​​​​​ 目录 ​​​​​​ 安装 my2sql简介 用途 工具优势 限制 账号所需权限 参数解析 场景 场景1 回滚 场景2 生成正向SQL 场景3 DML与事务统计 场景4 解析本地 与binlog2sql性能对比 安装 安装比较简单 直接下载二进制命令即可使用 wget https://git…...

vueRouter常用属性

vueRouter常用属性 basemodehashhistoryhistory模式下可能会遇到的问题及解决方案 routesprops配置(最佳方案) scrollBehavior base 基本的路由请求的路径 如果整个单页应用服务在 /app/ 下&#xff0c;然后 base 就应该设为 “/app/”,所有的请求都会在url之后加上/app/ new …...

Qt5.15.2的镜像网址

其它版本的qt把相应数字更换即可 已安装的QT怎么更新安装组件。离线版QT安装&#xff1a;已安装的QT怎么更新安装组件。离线版QT安装_哔哩哔哩_bilibili https://mirrors.tuna.tsinghua.edu.cn/qt/online/qtsdkrepository/windows_x86/desktop/qt5_5152_wasm/https://mirrors.…...

Python隐藏特性:字符串驻留、常量折叠

下面是Python字符串的一些微妙的特性&#xff0c;绝对会让你大吃一惊。 案例一&#xff1a; a “some_string” id(a) 140420665652016 id(“some” “_” “string”) # 注意两个的id值是相同的. 140420665652016 案例二&#xff1a; a “wtf” b “wtf” a is b True …...

2-Python与设计模式--工厂类相关模式

23种计模式之 前言 &#xff08;5&#xff09;单例模式、工厂模式、简单工厂模式、抽象工厂模式、建造者模式、原型模式、(7)代理模式、装饰器模式、适配器模式、门面模式、组合模式、享元模式、桥梁模式、&#xff08;11&#xff09;策略模式、责任链模式、命令模式、中介者模…...

PGP 遇上比特币

重复使用 PGP 密钥作为比特币密钥 介绍 在数字安全领域&#xff0c;密码学在确保数据的完整性和真实性方面发挥着至关重要的作用。 一种广泛使用的加密技术是使用 Pretty Good Privacy (PGP1)。 PGP 为安全通信&#xff08;例如电子邮件、文件传输和数据存储&#xff09;提供加…...

项目demo —— GPT 聊天机器人

本文介绍我的开源项目 TelegramChatBot&#xff0c;这是一个基于 OpenAI GPT API 开发的 telegram 机器人&#xff0c;具有多模态交互能力&#xff0c;求 star&#xff01;感谢大家&#xff01;在 telegram jokerController_bot 立即体验&#xff01;欢迎对 GPT 应用开发或对 t…...

Airtest进阶使用篇!提高脚本稳定性 + 批量运行脚本!

一、背景 今天彭于晏为大家分享Airtest进阶使用篇&#xff0c;主要包含两块的内容&#xff1a; 提高脚本稳定性批量运行脚本生成测试报告 二、提高脚本稳定性 1、添加全局配置: #全局设置 ST.FIND_TIMEOUT10 #设置隐式等待时长,默认识别图片时间是30秒&#xff0c;可改为…...

数据库系统概述之数据库优化

为什么需要进行优化&#xff1f; 数据库性能瓶颈 数据库服务器的性能受许多因素影响&#xff0c;包括硬件能力、系统规模、业务模型及架构、代码设计、数据库表设计、系统环境等。 因此&#xff0c;可以从几个方面进行数据库优化 喜欢点赞收藏&#xff0c;如有疑问&#xff…...

Spring Boot服务半夜OOM?别慌!手把手教你用jmap和VisualVM 2.0.7分析dump文件定位Bug

Spring Boot服务半夜OOM&#xff1f;别慌&#xff01;手把手教你用jmap和VisualVM 2.0.7分析dump文件定位Bug 凌晨三点&#xff0c;监控系统突然报警——某Spring Cloud微服务节点内存占用突破阈值。作为值班工程师&#xff0c;你需要在最短时间内定位问题根源。本文将带你体验…...

3步快速找回加密压缩包密码:ArchivePasswordTestTool终极指南

3步快速找回加密压缩包密码&#xff1a;ArchivePasswordTestTool终极指南 【免费下载链接】ArchivePasswordTestTool 利用7zip测试压缩包的功能 对加密压缩包进行自动化测试密码 项目地址: https://gitcode.com/gh_mirrors/ar/ArchivePasswordTestTool 你是否曾经因为忘…...

保姆级教程:在ROS Noetic下用OCS2让Unitree A1/Go1四足机器人站起来并走两步

从零到行走&#xff1a;OCS2与Unitree四足机器人实战指南 1. 环境准备与基础概念 四足机器人控制一直是机器人学中最具挑战性的领域之一。Unitree A1/Go1作为国产开源四足机器人的代表&#xff0c;结合OCS2&#xff08;Optimal Control for Switched Systems&#xff09;这一强…...

无需本地安装,用快马平台快速验证visualstudio安装教程的实操效果

最近在帮学弟学妹们解决Visual Studio安装后的环境验证问题&#xff0c;发现很多新手卡在"安装成功但不知道下一步该做什么"的环节。传统方法需要完整走完下载、安装、配置的全流程&#xff0c;而今天分享的这个方法&#xff0c;用InsCode(快马)平台就能快速验证安装…...

AI专著撰写实用指南:优质工具推荐,开启高效写作之旅

学术专著写作的挑战与AI工具解决方案 学术专著的严谨性&#xff0c;离不开大量的资料和数据支持。收集和整合这些资料与数据却是写作过程中最繁琐也是最耗时的部分。研究者需要全面查阅国内外最新文献&#xff0c;这不仅要求文献具备权威性和相关性&#xff0c;还要追溯原始来…...

从零开始:在PC上体验Nintendo Switch游戏的完整指南

从零开始&#xff1a;在PC上体验Nintendo Switch游戏的完整指南 【免费下载链接】Ryujinx 用 C# 编写的实验性 Nintendo Switch 模拟器 项目地址: https://gitcode.com/GitHub_Trending/ry/Ryujinx 你是否想过在电脑上畅玩《塞尔达传说&#xff1a;王国之泪》、《超级马…...

Ryujinx模拟器技术指南:从环境搭建到高级应用

Ryujinx模拟器技术指南&#xff1a;从环境搭建到高级应用 【免费下载链接】Ryujinx 用 C# 编写的实验性 Nintendo Switch 模拟器 项目地址: https://gitcode.com/GitHub_Trending/ry/Ryujinx 一、核心价值与适用人群 Ryujinx是一款采用C#开发的开源Nintendo Switch模拟…...

如何用Alternative Mod Launcher快速解决XCOM 2模组管理混乱问题

如何用Alternative Mod Launcher快速解决XCOM 2模组管理混乱问题 【免费下载链接】xcom2-launcher The Alternative Mod Launcher (AML) is a replacement for the default game launchers from XCOM 2 and XCOM Chimera Squad. 项目地址: https://gitcode.com/gh_mirrors/xc…...

效能倍增:ZenTimings的场景化内存性能优化指南

效能倍增&#xff1a;ZenTimings的场景化内存性能优化指南 【免费下载链接】ZenTimings 项目地址: https://gitcode.com/gh_mirrors/ze/ZenTimings ZenTimings是一款专为AMD Ryzen平台打造的内存时序监控与优化工具&#xff0c;通过精准的参数调校和实时监控功能&#…...

XUnity自动翻译器:打破语言壁垒的终极Unity游戏翻译解决方案

XUnity自动翻译器&#xff1a;打破语言壁垒的终极Unity游戏翻译解决方案 【免费下载链接】XUnity.AutoTranslator 项目地址: https://gitcode.com/gh_mirrors/xu/XUnity.AutoTranslator XUnity自动翻译器是一款开源的Unity游戏实时文本翻译插件&#xff0c;能够在游戏运…...