Linux配置yum源练习

题目

1.配置一个本地软件源

  1. 通过yum命令安装 mysql-server

3.使用yum 删除 mysql-server

4.查看nginx软件的详情

解题

1)挂载镜像以使用

bash 复制代码
#挂载镜像
[root@HeHe ~]# mkdir /mnt/redhat_osi
[root@HeHe ~]# mount /dev/sr0 /mnt/redhat_osi/
#做软件仓库的元数据
#(1)创建本地软件仓库
[root@HeHe ~]# cd /etc/yum.repos.d/
[root@HeHe yum.repos.d]# vim local.repo
  1 [local-base]
  2 name=local-base
  3 baseurl=file:///mnt/redhat_osi/BaseOS/
  4 gpgcheck=0
  5
  6 [local-appstream]
  7 name=local-appstream
  8 baseurl=file:///mnt/redhat_osi/AppStream/
  9 gpgcheck=0
#(2)#生成软件仓库的元数据
[root@HeHe yum.repos.d]# dnf(yum) makecache

2)命令安装 mysql-server

bash 复制代码
[root@HeHe yum.repos.d]# yum install mysql-server.x86_64
Updating Subscription Management repositories.
Unable to read consumer identity
Total size: 21 M
Installed size: 179 M
Is this ok [y/N]: y
---
Installed:
  mariadb-connector-c-config-3.2.6-1.el9_0.noarch mecab-0.996-3.el9.4.x86_64         mysql-8.0.36-1.el9_3.x86_64
  mysql-common-8.0.36-1.el9_3.x86_64              mysql-errmsg-8.0.36-1.el9_3.x86_64 mysql-selinux-1.0.10-1.el9.noarch
  mysql-server-8.0.36-1.el9_3.x86_64              protobuf-lite-3.14.0-13.el9.x86_64

Complete!

3)删除 mysql-server

bash 复制代码
[root@HeHe yum.repos.d]# yum remove -y mysql-server.x86_64
Updating Subscription Management repositories.
Unable to read consumer identity
---
Installed products updated.

Removed:
  mariadb-connector-c-config-3.2.6-1.el9_0.noarch mecab-0.996-3.el9.4.x86_64         mysql-8.0.36-1.el9_3.x86_64
  mysql-common-8.0.36-1.el9_3.x86_64              mysql-errmsg-8.0.36-1.el9_3.x86_64 mysql-selinux-1.0.10-1.el9.noarch
  mysql-server-8.0.36-1.el9_3.x86_64              protobuf-lite-3.14.0-13.el9.x86_64

Complete!

4)查看nginx软件的详情

bash 复制代码
[root@HeHe yum.repos.d]# yum info nginx
---
Available Packages
Name         : nginx
Epoch        : 1
Version      : 1.20.1
Release      : 14.el9_2.1
Architecture : x86_64
Size         : 40 k
Source       : nginx-1.20.1-14.el9_2.1.src.rpm
Repository   : local-appstream
Summary      : A high performance web server and reverse proxy server
URL          : https://nginx.org
License      : BSD
Description  : Nginx is a web server and a reverse proxy 
---
相关推荐
涛ing3 小时前
32. C 语言 安全函数( _s 尾缀)
linux·c语言·c++·vscode·算法·安全·vim
__雨夜星辰__3 小时前
Linux 学习笔记__Day2
linux·服务器·笔记·学习·centos 7
大耳朵土土垚3 小时前
【Linux】日志设计模式与实现
linux·运维·设计模式
深度Linux8 小时前
Linux网络编程中的零拷贝:提升性能的秘密武器
linux·linux内核·零拷贝技术
chian-ocean12 小时前
从理论到实践:Linux 进程替换与 exec 系列函数
linux·运维·服务器
拎得清n12 小时前
UDP编程
linux
敖行客 Allthinker12 小时前
从 UTC 日期时间字符串获取 Unix 时间戳:C 和 C++ 中的挑战与解决方案
linux·运维·服务器·c++
夏尔Gaesar14 小时前
Vim安装与配置教程(解决软件包Vim没有安装可候选)
linux·编辑器·vim
hunter20620614 小时前
如何监控ubuntu系统某个程序的运行状态,如果程序出现异常,对其自动重启。
linux·chrome·ubuntu
慕雪华年15 小时前
【Linux】opencv在arm64上提示找不到libjasper-dev
linux·运维·opencv