参考
背景
公司内网需要离线安装GitLab服务器, 其中依赖的yum源也需要离线安装
安装步骤
1. 安装yum-plugin-downloadonly
yum install yum-plugin-downloadonly
2. 下载GitLab相关依赖
yum install -y --downloadonly --downloaddir=/opt/rpms curl policycoreutils-python openssh-server
[root@bogon rpms]# ls
audit-2.8.5-4.el7.x86_64.rpm nspr-4.21.0-1.el7.x86_64.rpm
audit-libs-2.8.5-4.el7.x86_64.rpm nss-3.44.0-7.el7_7.x86_64.rpm
audit-libs-python-2.8.5-4.el7.x86_64.rpm nss-pem-1.0.3-7.el7.x86_64.rpm
checkpolicy-2.5-8.el7.x86_64.rpm nss-softokn-3.44.0-8.el7_7.x86_64.rpm
curl-7.29.0-57.el7_8.1.x86_64.rpm nss-softokn-freebl-3.44.0-8.el7_7.x86_64.rpm
gitlab-ce-10.4.1-ce.0.el7.x86_64.rpm nss-sysinit-3.44.0-7.el7_7.x86_64.rpm
libcgroup-0.41-21.el7.x86_64.rpm nss-tools-3.44.0-7.el7_7.x86_64.rpm
libcurl-7.29.0-57.el7_8.1.x86_64.rpm nss-util-3.44.0-4.el7_7.x86_64.rpm
libselinux-2.5-15.el7.x86_64.rpm openssh-7.4p1-21.el7.x86_64.rpm
libselinux-python-2.5-15.el7.x86_64.rpm openssh-clients-7.4p1-21.el7.x86_64.rpm
libselinux-utils-2.5-15.el7.x86_64.rpm openssh-server-7.4p1-21.el7.x86_64.rpm
libsemanage-2.5-14.el7.x86_64.rpm policycoreutils-2.5-34.el7.x86_64.rpm
libsemanage-python-2.5-14.el7.x86_64.rpm policycoreutils-python-2.5-34.el7.x86_64.rpm
libsepol-2.5-10.el7.x86_64.rpm python-IPy-0.75-6.el7.noarch.rpm
libssh2-1.8.0-3.el7.x86_64.rpm setools-libs-3.3.8-4.el7.x86_64.rpm
3. 下载createrepo及相关依赖
yum install -y --downloadonly --downloaddir=/opt/rpms createrepo
4. 安装createrepo
rpm -ivh deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
rpm -ivh python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
rpm -ivh createrepo-0.9.9-24.el6.noarch.rpm
5. createrepo构建本地软件源
createrepo /home/user/rpms
6. 修改yum软件源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo_bk
7. 开启本地软件源
vim /etc/yum.repos.d/CentOS-Media.repo
- 在baseurl增加一行:=file:///opt/rpms/
- 并保证 enabled=1
# /etc/yum.repos.d/CentOS-Media.repo
[c7-media]
name=CentOS-$releasever - Media
baseurl=file:///media/CentOS/
file:///media/cdrom/
file:///media/cdrecorder/
file:///opt/rpms/
gpgcheck=1
enabled=1
9. 下载对应版本的GitLab rpm包
8. 使用yum安装GitLab即可
yum install -y gitlab-ce-10.4.1-ce.0.el7.x86_64.rpm
9. 安装成功
It looks like GitLab has not been configured yet; skipping the upgrade script.
*. *.
*** ***
***** *****
.****** *******
******** ********
,,,,,,,,,***********,,,,,,,,,
,,,,,,,,,,,*********,,,,,,,,,,,
.,,,,,,,,,,,*******,,,,,,,,,,,,
,,,,,,,,,*****,,,,,,,,,.
,,,,,,,****,,,,,,
.,,,***,,,,
,*,.
_______ __ __ __
/ ____(_) /_/ / ____ _/ /_
/ / __/ / __/ / / __ `/ __ \
/ /_/ / / /_/ /___/ /_/ / /_/ /
\____/_/\__/_____/\__,_/_.___/
Thank you for installing GitLab!
GitLab was unable to detect a valid hostname for your instance.
Please configure a URL for your GitLab instance by setting `external_url`
configuration in /etc/gitlab/gitlab.rb file.
Then, you can start your GitLab instance by running the following command:
sudo gitlab-ctl reconfigure
For a comprehensive list of configuration options please see the Omnibus GitLab readme
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md
验证中 : gitlab-ce-10.4.1-ce.0.el7.x86_64
已安装:
gitlab-ce.x86_64 0:10.4.1-ce.0.el7
完毕!
相关资源
描述: 上述GitLab离线安装的所有rpm包资源
链接:https://pan.baidu.com/s/1BPZfPdqUiNTz6FKsxMliKg
提取码:6666
网友评论