CentOS 6.5比较古老的版本了,而还是有一些古老的项目仍然在使用。
环境说明
1. 更换国内在线yum源
CentOS 6 在线可用yum源配置——筑梦之路_centos6可用yum源-CSDN博客
cat > CentOS-163.repo << 'EOF'
[base]
name=CentOS-$releasever - Base - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://mirrors.163.com/centos-vault/6.10/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-$releasever - Updates - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://mirrors.163.com/centos-vault/6.10/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=http://mirrors.163.com/centos-vault/6.10/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - 163.com
baseurl=http://mirrors.163.com/centos-vault/6.10/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
EOF
2. 更新缓存并安装软件测试
yum clean all
yum makecache fast
yum install vim lrzsz wget curl net-tools openssh-server git
yum update --exclude=centos* -exclude=kernel*
3. 基于开源项目制作openssh rpm包
直接制作openssh 9.8p1版本,2024年7月7日,当前最新版。
CentOS 5/6/7 基于开源项目制作openssh 9.6p1 rpm包—— 筑梦之路_centos6 openssh9.6rpm-CSDN博客
1)准备源码
# 准备源码
wget --no-check-certificate https://mirrors.aliyun.com/pub/OpenBSD/OpenSSH/portable/openssh-9.8p1.tar.gz
wget --no-check-certificate https://www.openssl.org/source/openssl-1.1.1w.tar.gz
git clone https://github.com/boypt/openssh-rpms.git
# 将源码下载放到downloads目录下
cp openss* openssh-rpms/downloads/
2)安装编译打包环境
yum groupinstall -y "Development Tools"
yum install -y imake rpm-build pam-devel krb5-devel zlib-devel libXt-devel libX11-devel gtk2-devel
3) 修改文件
# 1. 修改文件version.env
OPENSSLSRC=openssl-1.1.1w.tar.gz
# 2. 修改文件pullsrc.sh compile.sh
source ./version.env
4) 制作openssh rpm包
sh compile.sh el6
4. 安装测试验证
cd el6/RPMS/x86_64/
rm -f openssh-debuginfo-9.8p1-1.el6.x86_64.rpm
rpm -Uvh *.rpm
# 重启sshd服务
service sshd restart
service sshd status
至此,在centos 6.5版本上成功制作openssh 9.8p1的rpm包。
二进制rpm包见我的资源。