1.配置yum源
vim /etc/yum.repos.d/gitlab-ce.repo内容
[gitlab-ce]
name=Gitlab CE Repository
baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/
gpgcheck=0
enabled=1以上资源地址根据具体情况可以换成阿里、网易等
https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/2.更新本地yum缓存
yum makecache3.更新系统软件库
安装gitlab之前,先更新以下系统软件库
yum update -y4.安装gitlab依赖库

sudo yum install -y curl policycoreutils-python openssh-server perl出现以下错误
Error: Unable to find a match: policycoreutils-python

参考了这篇文章也没有解决,后续直接不检查依赖安装
5.开启端口
开放http与https端口
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
systemctl reload firewalld6. 启动sshd服务
systemctl enable sshd
systemctl start sshd7. 安装 Postfix 以发送电子邮件通知
yum install -y postfix
systemctl enable postfix
systemctl start postfix具体配置可以参考
https://docs.gitlab.cn/omnibus/settings/smtp.html8.安装gitlab
安装可以参考官网的安装方式
https://gitlab.cn/install/这里采用rpm包的安装方式,下载gitlab的rpm包,下载地址
https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/

最新的发布版本gitlab-ce-15.8.3-ce.0.el7.x86_64 ,安装文件大小 1.1G
安装
rpm -ivh gitlab-ce-15.8.3-ce.0.el7.x86_64.rpm出现步骤 4.安装gitlab依赖库 的错误

直接不检查依赖安装
rpm -ivh gitlab-ce-15.8.3-ce.0.el7.x86_64 --force --nodeps修改配置文件/etc/gitlab/gitlab.rb的配置项external_url
vi /etc/gitlab/gitlab.rb指向服务器的ip地址
external_url 'http://192.168.10.66'重新加载配置,并重启 GitLab 服务,执行命令
gitlab-ctl reconfigure
gitlab-ctl restart获取root用户密码
cat /etc/gitlab/initial_root_password9.附录
最终发现使用docker方式安装是最简单的
https://docs.gitlab.cn/jh/install/docker.html#使用-docker-engine-安装极狐gitlab
https://docs.gitlab.cn/jh/install/docker.html#使用-docker-compose-安装极狐gitlab获取root用户密码
docker ps
docker exec -it 93789f8225b8 /bin/bash
cat /etc/gitlab/initial_root_password









