官方地址:https://about.gitlab.com/install/#centos-7
step1
第一步修改成sudo yum install -y curl policycoreutils-python3 openssh-server perl
如果还是报错的话就先配置epel源
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
#sudo yum install -y curl policycoreutils-python openssh-server perl
看看ssh服务开没开 一般都不用管
# Enable OpenSSH server daemon if not enabled: sudo systemctl status sshd
sudo systemctl enable sshd
sudo systemctl start sshd
防火墙的配置看一下,内网情况下一般也是关掉,公网环境配合安全组
# Check if opening the firewall is needed with: sudo systemctl status firewalld
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo systemctl reload firewalld
step2 安装邮件服务postfix
sudo yum install postfix -y
sudo systemctl enable postfix
sudo systemctl start postfix
step3 下载安装脚本并执行
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
yum install -y gitlab-ee
如果要修改为内网的url,前提是内网有配置好的dns
sudo EXTERNAL_URL="https://gitlab.example.com" yum install -y gitlab-ee
step4
修改配置文件
vi/etc/gitlab/gitlab.rb
external_url 'http://127.0.0.1:8000'
修改密码 存放的位置
/etc/gitlab/initial_root_password
报错汇总:
Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/CentOS-Epel.repo; Configuration: OptionBinding with id "failovermethod" does not exist
原因是Redhat的dnf 不支持failovermethod 选项 所以需要将此选项注释掉或是删除
vi /etc/yum.repos.d/CentOS-Epel.repo