ThinkSystem 服务器操作系统安装说明

下面是ThinkSystem服务器常见操作系统的安装说明,大家可以参考一下

序号 操作系统 链接 驱动
1 Windows Server 2016 and 2019 安装说明 Win驱动
2 Red Hat Enterprise Linux (RHEL 7 and RHEL 8) 安装说明 linux驱动
3 VMware ESXi 6.x 安装说明 vsphere驱动
4 VMware ESXi 7.x 安装说明 驱动
5 SUSE Linux Enterprise Server (SLES 12 and SLES 15) 安装说明 linux驱动
6 Canonical Ubuntu 18.04 安装说明 驱动

Centos8 yum 源不可用

报错: CentOS Linux 8 – AppStream Cannot prepare internal mirrorlist: No URLs in mirrorlist

解决:

1.将以下三个yum源文件中的 mirrorlist行注释掉,baseurl行打开,且将访问主机修改为腾讯云地址即可:

CentOS-Linux-AppStream.repo

CentOS-Linux-BaseOS.repo

CentOS-Linux-Extras.repo

具体如下:
/etc/yum.repo.d/CentOS-Linux-AppStream.repo

[appstream]
name=CentOS Linux $releasever - AppStream
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=AppStream&infra=$infra
#baseurl=http://mirror.centos.org/$contentdir/$releasever/AppStream/$basearch/os/
baseurl=http://mirrors.cloud.tencent.com/$contentdir/$releasever/AppStream/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

/etc/yum.repo.d/CentOS-Linux-BaseOS.repo

[baseos]
name=CentOS Linux $releasever - BaseOS
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=BaseOS&infra=$infra
#baseurl=http://mirror.centos.org/$contentdir/$releasever/BaseOS/$basearch/os/
baseurl=http://mirrors.cloud.tencent.com/$contentdir/$releasever/BaseOS/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

/etc/yum.repo.d/CentOS-Linux-Extras.repo

[extras]
name=CentOS Linux $releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
#baseurl=http://mirror.centos.org/$contentdir/$releasever/extras/$basearch/os/
baseurl=http://mirrors.cloud.tencent.com/$contentdir/$releasever/extras/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

2.执行以下命令,清理和重新缓存源设置即可

yum clean all

yum makecache

Centos搭建企业YUM仓库

Centos

一、源服务器的系统环境。最小化安装

[root@yumserver ~]#cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)

源服务器IP地址:192.168.0.200

二、放开系统防火墙,关闭selinux

[root@yumserver ~]#firewall-cmd --add-port=80/tcp --permanent
success
[root@yumserver ~]# firewall-cmd --reload
success

[root@yumserver ~]# vim /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing – SELinux security policy is enforced.
# permissive – SELinux prints warnings instead of enforcing.
# disabled – No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three values:
# targeted – Targeted processes are protected,
# minimum – Modification of targeted policy. Only selected processes are protected.
# mls – Multi Level Security protection.
SELINUXTYPE=targeted

三.添加阿里云yum源并检查

备份好原系统的repo

[root@yumserver ~]#cd /etc/yum.repos.d
[root@yumserver ~]#mkdir backup
[root@yumserver yum.repos.d]# mv *.repo backup/

下载阿里云repo

[root@yumserver yum.repos.d]#curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
[root@yumserver yum.repos.d]#curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
[root@yumserver yum.repos.d]#yum makecache
[root@yumserver yum.repos.d]#yum repolist

四.安装相关软件

yum install -y wget make cmake gcc gcc-c++ pcre-devel zlib-devel openssl openssl-devel httpd yum-utils createrepo

注释:

  • yum-utils:reposync同步工具
  • createrepo:编辑yum库工具
  • httpd:通过Apache软件提供web服务,也可以使用nginx

五、同步阿里云yum源软件包到本地服务器指定目录

/mirror(自定义目录)

[root@yumserver ~]#mkdir -p /mirror
[root@yumserver ~]#chown -R apache:apache /mirror
[root@yumserver ~]#chmod -R 755 /mirror
[root@yumserver ~]#reposync -n --repoid=extras --repoid=updates --repoid=base --repoid=epel -p /mirror

参数注释:-n指下载最新软件包,-p指定目录,指定本地的源--repoid(如果不指定就同步本地服务器所有的源),下载过程比较久

六.创建仓库索引

[root@yumserver ~]#createrepo -po /mirror/base/ /mirror/base/
[root@yumserver ~]#createrepo -po /mirror/extras/ /mirror/extras/
[root@yumserver ~]#createrepo -po /mirror/updates/ /mirror/updates/
[root@yumserver ~]#createrepo -po /mirror/epel/ /mirror/epel/

七.更新数据源

[root@yumserver ~]#createrepo --update /mirror/base/
[root@yumserver ~]#createrepo --update /mirror/extras/
[root@yumserver ~]#createrepo --update /mirror/updates/
[root@yumserver ~]#createrepo --update /mirror/epel/

八.启动并配置Apache服务

[root@yumserver ~]#systemctl start httpd
[root@yumserver ~]#systemctl enable httpd
[root@yumserver ~]#systemctl status httpd
[root@yumserver ~]#vim /etc/httpd/conf/httpd.conf

DocumentRoot "/mirror/"
<Directory "/mirror/">
Options Indexes FollowSymLinks
AllowOverride  None
Order allow,deny
Allow from all
Require all granted
</Directory>

九.编写yum源客户端配置文件

[root@yumserver repo]#vim /mirror/repo/CentOS-Base.repo

[base]
name=CentOS- - Base - 192.168.0.200
failovermethod=priority
baseurl=http://192.168.0.200/base/
enable=1
gpgcheck=0
[updates]
name=CentOS- - Updates - 192.168.0.200
failovermethod=priority
baseurl=http://192.168.0.200/updates/
enable=1
gpgcheck=0
[extras]
name=CentOS- - Extras - 192.168.0.200
failovermethod=priority
baseurl=http://192.168.0.200/extras/
enable=1
gpgcheck=0
[epel]
name=CentOS- - Epel - 192.168.0.200
failovermethod=priority
baseurl=http://192.168.0.200/epel/
enable=1
gpgcheck=0

十.客户端配置yum源

用户可以浏览器访问192.168.0.200查看配置客户端yum源的方法

[root@servera ~]#curl -o /etc/yum.repos.d/CentOS-Base.repo http:/ /192.168.0.200/repo/CentOS-Base.repo
[root@servera ~]#yum makecache

十一.设置定时同步yum源的任务

[root@yumserver ~]#vim /mirror/script/centos_yum_update.sh

#!/bin/bash
echo 'Updating Aliyum Source'
DATETIME=`date +%F_%T`
exec > /var/log/aliyumrepo_$DATETIME.log
reposync -np /mirror
if [ $? -eq 0 ];then
createrepo --update /mirror/base
createrepo --update /mirror/extras
createrepo --update /mirror/updates
createrepo --update /mirror/epel
echo "SUCESS: $DATETIME aliyum_yum update successful"
else
echo "ERROR: $DATETIME aliyum_yum update failed"
fi

添加定时任务,每周一凌晨1点执行添加定时任务,每周一凌晨1点执行

[root@yumserver ~]#crontab -l
0 1 1 /bin/bash /mirror/script/centos_yum_update.sh