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

腾讯云centos7.6的运维笔记——从yum的安装与更新源开始

文章目录

  • 一. 如何彻底卸载原有yum并重新安装
    • 1. 查看已经安装的yum
    • 2. 删除yum包
    • 3. 查看是否删除完毕(未找到yum包则删除完成)
    • 4. 查看Liunx系统版本
    • 5. 下载yum有关的RPM包
    • 6. 安装下载好的yum有关的RPM包
    • 7. 查看是否安装完成
  • 二. 如何更新yum源
  • 三. 如何安装图形化界面并最终通过VNC登录
    • 3.1 安装图形化界面
    • 3.2 通过VNC登录
  • 四、如何安装google-chrome

一. 如何彻底卸载原有yum并重新安装

问题背景:常常在执行yum命令时,出现如下错误

Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfileOne of the configured repositories failed (Unknown),and yum doesn't have enough cached data to continue. At this point the onlysafe thing yum can do is fail. There are a few ways to work "fix" this:1. Contact the upstream for the repository and get them to fix the problem.2. Reconfigure the baseurl/etc. for the repository, to point to a workingupstream. This is most often useful if you are using a newerdistribution release than is supported by the repository (and thepackages for the previous distribution release still work).3. Run the command with the repository temporarily disabledyum --disablerepo=<repoid> ...4. Disable the repository permanently, so yum won't use it by default. Yumwill then just ignore the repository until you permanently enable itagain or use --enablerepo for temporary usage:yum-config-manager --disable <repoid>orsubscription-manager repos --disable=<repoid>5. Configure the failing repository to be skipped, if it is unavailable.Note that yum will try to contact the repo. when it runs most commands,so will have to try and fail each time (and thus. yum will be be muchslower). If it is a very temporary problem though, this is often a nicecompromise:yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=trueCannot find a valid baseurl for repo: centos-sclo-sclo

1. 查看已经安装的yum

rpm -qa |grep yum

2. 删除yum包

rpm -qa|grep yum|xargs rpm -e --nodeps

3. 查看是否删除完毕(未找到yum包则删除完成)

rpm -qa |grep yum

4. 查看Liunx系统版本

uname -an

5. 下载yum有关的RPM包

wget https://buildlogs.cdn.centos.org/c7.00.03/python-iniparse/20140609190145/0.4-9.el7.x86_64/python-iniparse-0.4-9.el7.noarch.rpm
wget https://buildlogs.cdn.centos.org/c7.2009.00.x86_64/yum/20201001170128/3.4.3-168.el7.centos.x86_64/yum-3.4.3-168.el7.centos.noarch.rpm
wget https://buildlogs.cdn.centos.org/c7.2003.u.armhfp/yum-utils/20200512164914/1.1.31-54.el7_8.armhfp/yum-utils-1.1.31-54.el7_8.noarch.rpm
wget https://buildlogs.cdn.centos.org/c7.2003.u.armhfp/yum-utils/20200512164914/1.1.31-54.el7_8.armhfp/yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch.rpm
wget https://buildlogs.cdn.centos.org/c7.00.03/yum-metadata-parser/20140609201710/1.1.4-10.el7.x86_64/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm

6. 安装下载好的yum有关的RPM包

rpm -ivh python-iniparse-0.4-9.el7.noarch.rpm --force --nodeps
rpm -ivh yum-* --force --nodeps
rpm -qa |grep yum

7. 查看是否安装完成

yum makecache

二. 如何更新yum源

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

三. 如何安装图形化界面并最终通过VNC登录

3.1 安装图形化界面

yum groupinstall "GNOME Desktop" "Graphical Administration Tools" -y
ln -sf /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target
reboot

3.2 通过VNC登录

在这里插入图片描述

四、如何安装google-chrome

curl -s https://packagecloud.io/install/repositories/ivan/centos/script.rpm.sh | sudo bash
sudo yum install google-chrome-stable-53.0.2785.143-1.x86_64

参考文献

  1. Linux:CentOS 7 安装yum
  2. CentOS 7 更换 阿里云/清华大学 yum 软件源
  3. 搭建 CentOS 可视化界面
  4. google-chrome-stable-53.0.2785.143-1.x86_64.rpm
http://www.xdnf.cn/news/19330.html

相关文章:

  • 小狼毫输入法中让数字键盘上的数字键不再选择候选词而是与原始输入一起直接上屏
  • 抖音热榜展示页面
  • Android 权限申请现代化指南
  • MySQL 在 CentOS 上的安装与配置文件路径详解
  • 2025-08-18面试题(nginx,mysql,zabbix为主)
  • LeetCode 2540.最小公共值
  • 1.7 Rendering模块
  • 数据结构 03(线性:单链表)
  • web渗透之RCE漏洞
  • Java中使用JSONUtil处理JSON数据:从前端到后端的完美转换
  • [Mysql数据库] 知识点总结7
  • 06.《STP 基础原理与配置详解》
  • DFS 回溯 【各种题型+对应LeetCode习题练习】
  • 突发,支付宝发布公告
  • 一体化步进伺服电机在汽车线束焊接设备中的应用案例
  • LZ4 解压工具(WPF / .NET 8)说明书
  • 【金仓数据库产品体验官】KingbaseES-ORACLE兼容版快速体验
  • 深入理解drv_spi.c后,完全正向亲手移植rt-thread的drv_spi.c驱动 (基于stm32h750 artpi)
  • Java函数式编程之【流(Stream)性能优化】
  • WPF和WinFrom区别
  • 计算机毕设 java 阿歹果园养鸡场管理系统 基于 SSM 框架的果园养鸡场全流程管理系统设计与实现 Java+MySQL 的养殖生产与进销存一体化平台开发
  • 汽车专卖店管理系统的设计与实现(代码+数据库+LW)
  • Langflow核心技术学习笔记
  • 探索 XGBoost 与 LightGBM 的差异:哪个更适合你的项目?
  • 基于TCN-BiLSTM-SelfAttention神经网络的多输入单输出回归预测【MATLAB】
  • 力扣(LeetCode) ——645. 错误的集合(C语言)
  • 整体设计 的语言设计:通用模型语言的标准模板语言的规格模式语言(搜狗汪仔答问)
  • GooglePlay提审问题记录
  • 国家统计局数据分析01——机器学习
  • wpf之附加属性