yum
同步软件包
基础依赖
安装依赖
yum install -y wget make cmake gcc gcc-c++
yum install -y pcre-devel lib zlib-devel
建立目录
mkdir -p /home/mirrors/centos/7/os/x86_64/
执行同步操作
# 下载aliyun镜像源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
# 同步镜像
reposync -r base -p /home/mirrors/centos/7/os/x86_64/
# 更新镜像
reposync -d -r base -p /home/mirrors/centos/7/os/x86_64/
另一种方式
下载Centos7-Everything.iso镜像。下载地址
解压其中的Packages目录到/home/mirrors/centos/7/os/x86_64/base/目录下
构建索引
createrepo /home/mirrors/centos/7/os/x86_64/base
createrepo --update /home/mirrors/centos/7/os/x86_64/base
nodejs依赖
下载依赖
# Node.js v14.x
# As root
curl -sL https://rpm.nodesource.com/setup_14.x | bash -
# No root privileges
curl -sL https://rpm.nodesource.com/setup_14.x | sudo bash -
# Node.js v12.x
# As root
curl -sL https://rpm.nodesource.com/setup_12.x | bash -
# No root privileges
curl -sL https://rpm.nodesource.com/setup_12.x | sudo bash -
# Node.js v10.x
# As root
curl -sL https://rpm.nodesource.com/setup_10.x | bash -
# No root privileges
curl -sL https://rpm.nodesource.com/setup_10.x | sudo bash -
# Node.js LTS (12.x)
# As root
curl -sL https://rpm.nodesource.com/setup_lts.x | bash -
# No root privileges
curl -sL https://rpm.nodesource.com/setup_lts.x | sudo bash -
# Node.js Current (14.x)
# As root
curl -sL https://rpm.nodesource.com/setup_current.x | bash -
# No root privileges
curl -sL https://rpm.nodesource.com/setup_current.x | sudo bash -
下载安装包
# 下载安装包
yum install --downloadonly \
--downloaddir=/home/mirrors/centos/7/os/x86_64/nodejs nodejs
创建索引
createrepo /home/mirrors/centos/7/os/x86_64/nodejs
createrepo --update /home/mirrors/centos/7/os/x86_64/nodejs
mysql依赖
下载依赖
# 下载安装repo
rpm -Uvh http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
# 更新缓存
yum clean all && yum makecache
# 下载安装包
yum