配置网络源
[root@localhost yum.repos.d]# ping www.163.com
PING z163picipv6.v.bsgslb.cn (61.184.215.68) 56(84) bytes of data.
64 bytes from 61.184.215.68 (61.184.215.68): icmp_seq=1 ttl=128 time=13.2 ms
64 bytes from 61.184.215.68 (61.184.215.68): icmp_seq=2 ttl=128 time=10.5 ms
^C
--- z163picipv6.v.bsgslb.cn ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 10.549/11.886/13.224/1.341 ms
[root@localhost yum.repos.d]# ls
CentOS-Linux-AppStream.repo CentOS-Linux-Devel.repo CentOS-Linux-Media.repo
CentOS-Linux-BaseOS.repo CentOS-Linux-Extras.repo CentOS-Linux-Plus.repo
CentOS-Linux-ContinuousRelease.repo CentOS-Linux-FastTrack.repo CentOS-Linux-PowerTools.repo
CentOS-Linux-Debuginfo.repo CentOS-Linux-HighAvailability.repo CentOS-Linux-Sources.repo
[root@localhost yum.repos.d]# mv * /tmp/yumrepo/
将以下代码写入CentOS-Base.repo
[root@localhost yum.repos.d]# vi CentOS-Base.repo
[base]
name=CentOS-8-stream - Base - mirrors.aliyun.com
baseurl=https://mirrors.aliyun.com/centos/8-stream/BaseOS/$basearch/os/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
#additional packages that may be useful
[extras]
name=CentOS-8-stream - Extras - mirrors.aliyun.com
baseurl=https://mirrors.aliyun.com/centos/8-stream/extras/$basearch/os/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-8-stream - Plus - mirrors.aliyun.com
baseurl=https://mirrors.aliyun.com/centos/8-stream/centosplus/$basearch/os/
gpgcheck=1
enabled=0
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
[PowerTools]
name=CentOS-8-stream - PowerTools - mirrors.aliyun.com
baseurl=https://mirrors.aliyun.com/centos/8-stream/PowerTools/$basearch/os/
gpgcheck=1
enabled=0
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
[AppStream]
name=CentOS-8-stream - AppStream - mirrors.aliyun.com
baseurl=https://mirrors.aliyun.com/centos/8-stream/AppStream/$basearch/os/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]# yum clean all
0 files removed
[root@localhost yum.repos.d]# yum makecache
CentOS-8-stream - Base - mirrors.aliyun.com 824 kB/s | 41 MB 00:50
CentOS-8-stream - Extras - mirrors.aliyun.com 46 kB/s | 18 kB 00:00
CentOS-8-stream - AppStream - mirrors.aliyun.com 354 kB/s | 31 MB 01:28
Metadata cache created.
[root@localhost yum.repos.d]# ls
CentOS-Base.repo
[root@localhost yum.repos.d]# wget https://dev.mysql.com/downloads/file/?id=518409
--2023-07-11 09:49:09-- https://dev.mysql.com/downloads/file/?id=518409
Resolving dev.mysql.com (dev.mysql.com)... 23.66.128.31, 2600:1417:76:788::2e31, 2600:1417:76:795::2e31
Connecting to dev.mysql.com (dev.mysql.com)|23.66.128.31|:443... connected.
安装mysql的release包
添加mysql文件夹,下载/mysql80-community-release-el9-1.noarch.rpm
[root@localhost tmp]# mkdir /home/mysql
[root@localhost tmp]# mv mysql-8.0.33-1.el9.x86_64.rpm-bundle.tar /home/mysql/
[root@localhost tmp]# cd /home/mysql/
[root@localhost mysql]# wget https://dev.mysql.com/get/mysql80-community-release-el9-1.noarch.rpm
--2023-07-11 09:59:46-- https://dev.mysql.com/get/mysql80-community-release-el9-1.noarch.rpm
Resolving dev.mysql.com (dev.mysql.com)... 23.66.128.31, 2600:1417:76:68e::2e31, 2600:1417:76:681::2e31
Connecting to dev.mysql.com (dev.mysql.com)|23.66.128.31|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://repo.mysql.com//mysql80-community-release-el9-1.noarch.rpm [following]
--2023-07-11 09:59:48-- https://repo.mysql.com//mysql80-community-release-el9-1.noarch.rpm
Resolving repo.mysql.com (repo.mysql.com)... 23.218.32.218
Connecting to repo.mysql.com (repo.mysql.com)|23.218.32.218|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 10534 (10K) [application/x-redhat-package-manager]
Saving to: ‘mysql80-community-release-el9-1.noarch.rpm’
mysql80-community-release- 100%[========================================>] 10.29K --.-KB/s in 0s
2023-07-11 09:59:48 (67.8 MB/s) - ‘mysql80-community-release-el9-1.noarch.rpm’ saved [10534/10534]
[root@localhost mysql]#
[root@localhost mysql]# ls
mysql80-community-release-el9-1.noarch.rpm
[root@localhost mysql]#
再次查看是否还有残留,如果有就删除
MySQL和mariadb都要查看
[root@localhost mysql]# rpm -qa |grep mysql
pcp-pmda-mysql-5.3.1-5.el8.x86_64
[root@localhost mysql]# rpm -qa |grep maraida
[root@localhost mysql]# rpm -e pcp-pmda-mysql-5.3.1-5.el8.x86_64
[root@localhost mysql]# rpm -qa |grep maraida
[root@localhost mysql]# rpm -qa |grep mysql
使用rpm -ivh 安装刚刚下载的rpm包
[root@localhost mysql]# rpm -ivh mysql80-community-release-el9-1.noarch.rpm
warning: mysql80-community-release-el9-1.noarch.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
Verifying... ################################# [100%]
Preparing... ################################# [100%]
Updating / installing...
1:mysql80-community-release-el9-1 ################################# [100%]
[root@localhost mysql]# yum repolist enabled
repo id repo name
AppStream CentOS-8-stream - AppStream - mirrors.aliyun.com
base CentOS-8-stream - Base - mirrors.aliyun.com
extras CentOS-8-stream - Extras - mirrors.aliyun.com
mysql-connectors-community MySQL Connectors Community
mysql-tools-community MySQL Tools Community
mysql80-community MySQL 8.0 Community Server
[root@localhost mysql]# yum install -y mysql-community-server
MySQL 8.0 Community Server 829 kB/s | 839 kB 00:01
MySQL Connectors Community 48 kB/s | 19 kB 00:00
MySQL Tools Community 449 kB/s | 283 kB 00:00
All matches were filtered out by modular filtering for argument: mysql-community-server
Error: Unable to find a match: mysql-community-server
[root@localhost mysql]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ls
CentOS-Base.repo mysql-community-debuginfo.repo mysql-community-source.repo
'index.html?id=518409' mysql-community.repo
这里需要关闭校验
[root@localhost yum.repos.d]# vi mysql-community.repo
[root@localhost yum.repos.d]# cat mysql-community.repo
[mysql80-community]
name=MySQL 8.0 Community Server
baseurl=http://repo.mysql.com/yum/mysql-8.0-community/el/9/$basearch/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
[mysql-connectors-community]
name=MySQL Connectors Community
baseurl=http://repo.mysql.com/yum/mysql-connectors-community/el/9/$basearch/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
[mysql-tools-community]
name=MySQL Tools Community
baseurl=http://repo.mysql.com/yum/mysql-tools-community/el/9/$basearch/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
[mysql-cluster-8.0-community]
name=MySQL Cluster 8.0 Community
baseurl=http://repo.mysql.com/yum/mysql-cluster-8.0-community/el/9/$basearch/
enabled=0
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
直接使用yum安装,报错,直接行运yum module disable mysql
[root@localhost yum.repos.d]# yum install -y mysqlql-community-server
MySQL 8.0 Community Server 15 kB/s | 2.6 kB 00:00
MySQL Connectors Community 14 kB/s | 2.6 kB 00:00
MySQL Tools Community 16 kB/s | 2.6 kB 00:00
No match for argument: mysqlql-community-server
Error: Unable to find a match: mysqlql-community-server
[root@localhost yum.repos.d]# yum module disable mysql
Last metadata expiration check: 0:01:30 ago on Tue 11 Jul 2023 10:17:03 AM CST.
Dependencies resolved.
============================================================================================================
Package Architecture Version Repository Size
============================================================================================================
Disabling modules:
mysql
Transaction Summary
============================================================================================================
Is this ok [y/N]: y
Complete!
[root@localhost yum.repos.d]# yum -y install mysql-community-server
报错,需要其它依赖包
[root@localhost yum.repos.d]# yum -y install mysql-community-server
Last metadata expiration check: 0:06:45 ago on Tue 11 Jul 2023 10:17:03 AM CST.
Error:
Problem: cannot install the best candidate for the job
- nothing provides libc.so.6(GLIBC_2.34)(64bit) needed by mysql-community-server-8.0.33-1.el9.x86_64
- nothing provides libcrypto.so.3()(64bit) needed by mysql-community-server-8.0.33-1.el9.x86_64
- nothing provides libcrypto.so.3(OPENSSL_3.0.0)(64bit) needed by mysql-community-server-8.0.33-1.el9.x86_64
- nothing provides libssl.so.3()(64bit) needed by mysql-community-server-8.0.33-1.el9.x86_64
- nothing provides libstdc++.so.6(GLIBCXX_3.4.29)(64bit) needed by mysql-community-server-8.0.33-1.el9.x86_64
- nothing provides libssl.so.3(OPENSSL_3.0.0)(64bit) needed by mysql-community-server-8.0.33-1.el9.x86_64
- nothing provides libstdc++.so.6(CXXABI_1.3.13)(64bit) needed by mysql-community-server-8.0.33-1.el9.x86_64
- nothing provides libstdc++.so.6(GLIBCXX_3.4.26)(64bit) needed by mysql-community-server-8.0.33-1.el9.x86_64
- nothing provides libm.so.6(GLIBC_2.29)(64bit) needed by mysql-community-server-8.0.33-1.el9.x86_64
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
安装依赖包
[root@localhost yum.repos.d]# yum install -y openssl-devel
Last metadata expiration check: 0:08:34 ago on Tue 11 Jul 2023 10:17:03 AM CST.
Dependencies resolved.
============================================================================================================
Package Architecture Version Repository Size
============================================================================================================
Installing:
openssl-devel x86_64 1:1.1.1k-9.el8 base 3.2 M
Upgrading:
openssl x86_64 1:1.1.1k-9.el8 base 737 k
openssl-libs x86_64 1:1.1.1k-9.el8 base 1.5 M
Installing dependencies:
keyutils-libs-devel x86_64 1.5.10-9.el8 base 48 k
krb5-devel x86_64 1.18.2-14.el8 base 560 k
libcom_err-devel x86_64 1.45.6-2.el8 base 38 k
libkadm5 x86_64 1.18.2-14.el8 base 187 k
libselinux-devel x86_64 2.9-5.el8 base 200 k
libsepol-devel x86_64 2.9-3.el8 base 87 k
libverto-devel x86_64 0.3.0-5.el8 base 18 k
pcre2-devel x86_64 10.32-2.el8 base 605 k
pcre2-utf32 x86_64 10.32-2.el8 base 220 k
Transaction Summary
============================================================================================================
Install 10 Packages
Upgrade 2 Packages
Total download size: 7.3 M
Downloading Packages:
(1/12): libcom_err-devel-1.45.6-2.el8.x86_64.rpm 171 kB/s | 38 kB 00:00
(2/12): keyutils-libs-devel-1.5.10-9.el8.x86_64.rpm 191 kB/s | 48 kB 00:00
(3/12): libkadm5-1.18.2-14.el8.x86_64.rpm 415 kB/s | 187 kB 00:00
(4/12): libselinux-devel-2.9-5.el8.x86_64.rpm 390 kB/s | 200 kB 00:00
(5/12): libverto-devel-0.3.0-5.el8.x86_64.rpm 204 kB/s | 18 kB 00:00
(6/12): libsepol-devel-2.9-3.el8.x86_64.rpm 388 kB/s | 87 kB 00:00
(7/12): krb5-devel-1.18.2-14.el8.x86_64.rpm 385 kB/s | 560 kB 00:01
(8/12): pcre2-utf32-10.32-2.el8.x86_64.rpm 403 kB/s | 220 kB 00:00
(9/12): pcre2-devel-10.32-2.el8.x86_64.rpm 421 kB/s | 605 kB 00:01
(10/12): openssl-1.1.1k-9.el8.x86_64.rpm 416 kB/s | 737 kB 00:01
(11/12): openssl-libs-1.1.1k-9.el8.x86_64.rpm 418 kB/s | 1.5 MB 00:03
(12/12): openssl-devel-1.1.1k-9.el8.x86_64.rpm 422 kB/s | 3.2 MB 00:07
------------------------------------------------------------------------------------------------------------
Total 871 kB/s | 7.3 MB 00:08
CentOS-8-stream - Base - mirrors.aliyun.com 13 kB/s | 1.6 kB 00:00
Importing GPG key 0x8483C65D:
Userid : "CentOS (CentOS Official Signing Key) <security@centos.org>"
Fingerprint: 99DB 70FA E1D7 CE22 7FB6 4882 05B5 55B3 8483 C65D
From : https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Upgrading : openssl-libs-1:1.1.1k-9.el8.x86_64 1/14
Running scriptlet: openssl-libs-1:1.1.1k-9.el8.x86_64 1/14
Installing : libkadm5-1.18.2-14.el8.x86_64 2/14
Installing : pcre2-utf32-10.32-2.el8.x86_64 3/14
Installing : pcre2-devel-10.32-2.el8.x86_64 4/14
Installing : libverto-devel-0.3.0-5.el8.x86_64 5/14
Installing : libsepol-devel-2.9-3.el8.x86_64 6/14
Installing : libselinux-devel-2.9-5.el8.x86_64 7/14
Installing : libcom_err-devel-1.45.6-2.el8.x86_64 8/14
Installing : keyutils-libs-devel-1.5.10-9.el8.x86_64 9/14
Installing : krb5-devel-1.18.2-14.el8.x86_64 10/14
Installing : openssl-devel-1:1.1.1k-9.el8.x86_64 11/14
Upgrading : openssl-1:1.1.1k-9.el8.x86_64 12/14
Cleanup : openssl-1:1.1.1k-4.el8.x86_64 13/14
Cleanup : openssl-libs-1:1.1.1k-4.el8.x86_64 14/14
Running scriptlet: openssl-libs-1:1.1.1k-4.el8.x86_64 14/14
Verifying : keyutils-libs-devel-1.5.10-9.el8.x86_64 1/14
Verifying : krb5-devel-1.18.2-14.el8.x86_64 2/14
Verifying : libcom_err-devel-1.45.6-2.el8.x86_64 3/14
Verifying : libkadm5-1.18.2-14.el8.x86_64 4/14
Verifying : libselinux-devel-2.9-5.el8.x86_64 5/14
Verifying : libsepol-devel-2.9-3.el8.x86_64 6/14
Verifying : libverto-devel-0.3.0-5.el8.x86_64 7/14
Verifying : openssl-devel-1:1.1.1k-9.el8.x86_64 8/14
Verifying : pcre2-devel-10.32-2.el8.x86_64 9/14
Verifying : pcre2-utf32-10.32-2.el8.x86_64 10/14
Verifying : openssl-1:1.1.1k-9.el8.x86_64 11/14
Verifying : openssl-1:1.1.1k-4.el8.x86_64 12/14
Verifying : openssl-libs-1:1.1.1k-9.el8.x86_64 13/14
Verifying : openssl-libs-1:1.1.1k-4.el8.x86_64 14/14
Upgraded:
openssl-1:1.1.1k-9.el8.x86_64 openssl-libs-1:1.1.1k-9.el8.x86_64
Installed:
keyutils-libs-devel-1.5.10-9.el8.x86_64 krb5-devel-1.18.2-14.el8.x86_64
libcom_err-devel-1.45.6-2.el8.x86_64 libkadm5-1.18.2-14.el8.x86_64
libselinux-devel-2.9-5.el8.x86_64 libsepol-devel-2.9-3.el8.x86_64
libverto-devel-0.3.0-5.el8.x86_64 openssl-devel-1:1.1.1k-9.el8.x86_64
pcre2-devel-10.32-2.el8.x86_64 pcre2-utf32-10.32-2.el8.x86_64
Complete!
[root@localhost yum.repos.d]# yum -y install mysql-community-server
Last metadata expiration check: 0:08:56 ago on Tue 11 Jul 2023 10:17:03 AM CST.
Error:
Problem: cannot install the best candidate for the job
- nothing provides libc.so.6(GLIBC_2.34)(64bit) needed by mysql-community-server-8.0.33-1.el9.x86_64
- nothing provides libcrypto.so.3()(64bit) needed by mysql-community-server-8.0.33-1.el9.x86_64
- nothing provides libcrypto.so.3(OPENSSL_3.0.0)(64bit) needed by mysql-community-server-8.0.33-1.el9.x86_64
- nothing provides libssl.so.3()(64bit) needed by mysql-community-server-8.0.33-1.el9.x86_64
- nothing provides libstdc++.so.6(GLIBCXX_3.4.29)(64bit) needed by mysql-community-server-8.0.33-1.el9.x86_64
- nothing provides libssl.so.3(OPENSSL_3.0.0)(64bit) needed by mysql-community-server-8.0.33-1.el9.x86_64
- nothing provides libstdc++.so.6(CXXABI_1.3.13)(64bit) needed by mysql-community-server-8.0.33-1.el9.x86_64
- nothing provides libstdc++.so.6(GLIBCXX_3.4.26)(64bit) needed by mysql-community-server-8.0.33-1.el9.x86_64
- nothing provides libm.so.6(GLIBC_2.29)(64bit) needed by mysql-community-server-8.0.33-1.el9.x86_64
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
[root@localhost yum.repos.d]# yum install -y libcrypto*
Last metadata expiration check: 0:09:22 ago on Tue 11 Jul 2023 10:17:03 AM CST.
Package openssl-libs-1:1.1.1k-9.el8.x86_64 is already installed.
Dependencies resolved.
============================================================================================================
Package Architecture Version Repository Size
============================================================================================================
Installing:
compat-openssl10 x86_64 1:1.0.2o-4.el8 AppStream 1.1 M
Transaction Summary
============================================================================================================
Install 1 Package
Total download size: 1.1 M
Installed size: 2.9 M
Downloading Packages:
compat-openssl10-1.0.2o-4.el8.x86_64.rpm 394 kB/s | 1.1 MB 00:02
------------------------------------------------------------------------------------------------------------
Total 394 kB/s | 1.1 MB 00:02
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : compat-openssl10-1:1.0.2o-4.el8.x86_64 1/1
Running scriptlet: compat-openssl10-1:1.0.2o-4.el8.x86_64 1/1
Verifying : compat-openssl10-1:1.0.2o-4.el8.x86_64 1/1
Installed:
compat-openssl10-1:1.0.2o-4.el8.x86_64
Complete!
[root@localhost yum.repos.d]#
CentOS更新 glibc - 解决 `GLIBC_2.29‘ not found
下载源代码
wget https://ftp.gnu.org/gnu/libc/glibc-2.34.tar.gz
tar xvf glibc-2.34.tar.gz
配置环境
glic 的编译不能在自身目录下进行,这样方便将所有生成的文件集中放置,出现问题时只要删除编译目录即可,源代码目录仍保留完整的源代码。(但编译过程还是会修改部分内容。)
cd glibc-2.34
mkdir build && cd build
../configure --prefix=/usr/local/glibc-2.34
configure 文件有多个参数可以添加,但只有 --prefix 是必需的,它表示后续在哪个目录下安装 glibc,默认是 “/usr/local”,我这里选择 “/usr/local/glibc-2.34”。
编译安装
make -j 64
make install
此时会在 /usr/local 目录下生成一个 glibc-2.34 目录,包含所有的 bin/lib/include 文件。其中 lib 目录下就有我们需要的 libc.so.6 和 libm.so.6。
导入路径
上面的操作只是生成和安装,但没有添加到环境变量中去,所以其他软件仍然找不到这些依赖文件。
由于 libc 是系统基础文件,不能轻易删除,所以这里选择将新生成的文件路径直接导入环境变量,而不是替换原有文件。但是需要注意的是绝对不能导入到系统环境变量,如 /etc/profile 等,否则系统所有命令都会出现 “Segmentation fault”。
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/glibc-2.34/lib
安装失败