将centos 6.8 2.6.32-642.el6.x86_64内核小版本升级到 2.6.32-642.3.1.el6.x86_64
2.6.32-642.el6.x86_64 -> 2.6.32-642.3.1.el6.x86_64

ifcfg-eth0这个网卡的名字可能名字会不一样,可能ip或者ifconfig确定网卡名字
vim /etc/sysconfig/network-scripts/ifcfg-eth0

将ONBOOT=no改为ONBOOT=yes

reboot重启即可
reboot
vault.centos.org:https://vault.centos.org/6.8/updates/x86_64/Packages/



执行该命令:
rpm -ivh *.rpm --nodeps --force
默认情况下新安装的内核小版本都是优先启动顺序,因此reboot重启即可。
选择对应内核版本启动:
vim /etc/grub.conf

编辑grub.conf文件,修改grub的引导顺序,修改/etc/grub.conf 文件的default值,从0开始,比如上述:
default = 0,将选择CentOS (2.6.32-642.3.1.el6.x86_64)小版本
default = 1,将选择CentOS 6 (2.6.32-642.el6.x86_64)小版本
一般新安装的内核小版本的default等于0.
修改default后,reboot即可
reboot
升级小版本成功:

由于centos6各大开源镜像站已经停止维护,centos 6使用yum下载东西失败,用阿里云的centos6 阿里源镜像repo:

sed -i "s|enabled=1|enabled=0|g" /etc/yum/pluginconf.d/fastestmirror.conf
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
curl -k -o /etc/yum.repos.d/CentOS-Base.repo https://www.xmpan.com/Centos-6-Vault-Aliyun.repo

yum clean all
yum makecache
然后就可以正常使用yum:
yum install -y gcc gcc-c++ make automake
镜像源repo也可以使用 vault.centos.org:https://vault.centos.org/
由于要在centos 6使用c++11特性,升级g++版本:
wget --no-check-certificate https://copr.fedorainfracloud.org/coprs/mayeut/devtoolset-8/repo/epel-6/mayeut-devtoolset-8-epel-6.repo -O /etc/yum.repos.d/devtoolset-8.repo
yum makecache
yum install devtoolset-8-gcc devtoolset-8-binutils devtoolset-8-gcc-c++
//对当前终端有效,其他终端还是低版本g++
scl enable devtoolset-8 bash


gcc版本永久生效,执行下面shell:
#!/bin/bash
mv /usr/bin/gcc /usr/bin/gcc-4.4.7
mv /usr/bin/g++ /usr/bin/g++-4.4.7
mv /usr/bin/c++ /usr/bin/c++-4.4.7
ln -s /opt/rh/devtoolset-8/root/usr/bin/gcc /usr/bin/gcc
ln -s /opt/rh/devtoolset-8/root/usr/bin/c++ /usr/bin/c++
ln -s /opt/rh/devtoolset-8/root/usr/bin/g++ /usr/bin/g++
如果遇到以下问题:
https://download.copr.fedorainfracloud.org/results/mayeut/devtoolset-8/epel-6-x86_64/repodata/repomd.xml: [Errno 14] problem making ssl connection
更新SSL:
yum-config-manager --disable centrify.repo
yum clean all
yum update yum
yum update curl
yum update openssl
yum update nss
yum-config-manager --enable centrify.repo
yum install gcc zlib-devel make
yum install libffi-devel -y
wget http://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz
tar -zxvf Python-3.7.0.tgz
cd Python-3.7.0
./configure --prefix=/opt/python3
make && make install
make clean
make distclean
[root@localhost Python-3.7.0]# /opt/python3/bin/python3 -V
Python 3.7.0
ln -s /opt/python3/bin/python3 /usr/bin/python3
[root@localhost Python-3.7.0]# python3 -V
Python 3.7.0
备注:
这里如果没有 yum install libffi-devel 会出现:
ModuleNotFoundError: No module named '_ctypes'
安装
yum install libffi-devel -y
然后从./configure这步开始执行。
./configure 脚本。这个脚本通常用于配置软件以适应当前系统环境。
在运行 ./configure 时,有时候你可能需要传递一些参数以进行特定配置。
./configure --prefix=/usr/local
在 configure 执行完成后,会生成一个 Makefile 文件。在成功运行 ./configure 后,执行 make 和 make install 命令来编译和安装软件。
https://blog.csdn.net/Zerore/article/details/125432587
https://www.jianshu.com/p/0e6c60f1e942
https://blog.csdn.net/u011775882/article/details/110923820
https://blog.csdn.net/psbeond/article/details/110919775
https://blog.csdn.net/weixin_42319496/article/details/119373103