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

文章目录

  • 一、首先在腾讯云选择合适的操作系统
  • [二. 如何彻底卸载原有yum并重新安装](#二. 如何彻底卸载原有yum并重新安装)
    • [1. 查看已经安装的yum](#1. 查看已经安装的yum)
    • [2. 删除yum包](#2. 删除yum包)
    • [3. 查看是否删除完毕(未找到yum包则删除完成)](#3. 查看是否删除完毕(未找到yum包则删除完成))
    • [4. 查看Liunx系统版本](#4. 查看Liunx系统版本)
    • [5. 下载yum有关的RPM包](#5. 下载yum有关的RPM包)
    • [6. 安装下载好的yum有关的RPM包](#6. 安装下载好的yum有关的RPM包)
    • [7. 查看是否安装完成](#7. 查看是否安装完成)
  • [三. 如何更新yum源](#三. 如何更新yum源)
  • [四. 安装必要的软件](#四. 安装必要的软件)
  • [四. 如何安装图形化界面并最终通过VNC登录](#四. 如何安装图形化界面并最终通过VNC登录)
    • [4.1 安装图形化界面](#4.1 安装图形化界面)
    • [4.2 通过VNC登录](#4.2 通过VNC登录)
  • 五、如何安装google-chrome
  • 六、安装环境
  • 七、设置开机自动启动frps

一、首先在腾讯云选择合适的操作系统

centos7.6太老了,在安装很多python包的时候容易报glibc太老,导致无法安装。这里推荐使用OpenCloudOS 9,使用体验基本跟CentOS差不多。

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

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

bash 复制代码
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile


 One of the configured repositories failed (Unknown),
 and yum doesn't have enough cached data to continue. At this point the only
 safe 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 working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Run the command with the repository temporarily disabled
            yum --disablerepo=<repoid> ...

     4. Disable the repository permanently, so yum won't use it by default. Yum
        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable <repoid>
        or
            subscription-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 much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true

Cannot find a valid baseurl for repo: centos-sclo-sclo

1. 查看已经安装的yum

bash 复制代码
rpm -qa |grep yum

2. 删除yum包

bash 复制代码
rpm -qa|grep yum|xargs rpm -e --nodeps

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

bash 复制代码
rpm -qa |grep yum

4. 查看Liunx系统版本

bash 复制代码
uname -an

5. 下载yum有关的RPM包

bash 复制代码
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包

bash 复制代码
rpm -ivh python-iniparse-0.4-9.el7.noarch.rpm --force --nodeps
rpm -ivh yum-* --force --nodeps
rpm -qa |grep yum

7. 查看是否安装完成

bash 复制代码
yum makecache

三. 如何更新yum源

bash 复制代码
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
yum update

四. 安装必要的软件

bash 复制代码
yum install git

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

4.1 安装图形化界面

bash 复制代码
yum groupinstall "Server with GUI" -y
systemctl set-default graphical
reboot

4.2 通过VNC登录

快速登录 图形化界面的链接

五、如何安装google-chrome

bash 复制代码
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
yum localinstall google-chrome-stable_current_x86_64.rpm

安装成功后,通过命令:google-chrome --version

可以看到我们安装的google-chrome版本是:

复制代码
Google Chrome 139.0.7258.154

根据这个版本号139.0.7258.154,我们下载对应的chrome driver :

bash 复制代码
wget https://storage.googleapis.com/chrome-for-testing-public/139.0.7258.154/linux64/chromedriver-linux64.zip

如果你下载的其他版本的google chrome,请在下面找对应的driver:更多版本chrome driver下载地址

六、安装环境

bash 复制代码
conda create -n lmflow python=3.10 -y

七、设置开机自动启动frps

设置开机自启动执行命令:./frps -c frps.toml

执行命令: 编辑"/etc/rc.local",添加你想开机运行的命令

复制代码
#!/bin/bash
cd /home/austin/software/frp_0.64.0_linux_amd64 && ./frps -c frps.toml &

参考文献

  1. Linux:CentOS 7 安装yum
  2. CentOS 7 更换 阿里云/清华大学 yum 软件源
  3. 搭建 CentOS 可视化界面
  4. Install Google Chrome on CentOS 7 using yum command
相关推荐
峰顶听歌的鲸鱼14 分钟前
30.Linux DHCP 服务器
linux·运维·服务器·笔记·学习方法
退役小学生呀25 分钟前
二十一、DevOps:从零建设基于K8s的DevOps平台(二)
运维·docker·云原生·容器·kubernetes·devops
微风中的麦穗29 分钟前
【MD编辑器Typora】Typora最新 V1.12.1版:轻量级 Markdown 编辑器详细图文下载安装使用指南 【办公学习神器之MD文本编辑器】
运维·typora·开发工具·md编辑器·markdown 编辑器·markdown文件·办公学习工具
一只小风华~36 分钟前
Vue Router 命名路由学习笔记
前端·javascript·vue.js·笔记·学习·ecmascript
violet-lz44 分钟前
Linux文件系统调用:文件调用函数与exec系统函数详解与应用
linux·运维·服务器
不会kao代码的小王2 小时前
WaveTerminal+cpolar:命令行工具的远程协作新体验
笔记
老虎06272 小时前
黑马点评学习笔记01(手机号校验(正则表达式))
笔记·学习
袁泽斌的学习记录2 小时前
ubuntu22.04安装cuda11.4版本
linux·运维·服务器
荣光波比2 小时前
Docker(一)—— Docker入门到精通:从基础概念到容器管理
运维·docker·容器·云计算
JanelSirry2 小时前
VMware+RockyLinux+ikuai+docker+cri-docker+k8s+calico BGP网络 自用 实践笔记(二)
笔记·docker·kubernetes