CentOS7安装GitLib

本秂侑毒 提交于 2019-12-04 10:36:13

1.安装和配置必要的依赖关系

sudo yum install curl policycoreutils openssh-server openssh-clients
sudo systemctl enable sshd
sudo systemctl start sshd
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix
sudo firewall-cmd --permanent --add-service=http
sudo systemctl reload firewalld

2.添加GitLab包服务器和执行安装包

curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
sudo yum install gitlab-ce

通常由于网络墙的原因上面的安装包会下载失败,可以使用清华大学的源或者手动下载。

方法一:使用清华大学的源

新建 /etc/yum.repos.d/gitlab-ce.repo,内容为

你的CentOS/RHEL版本:  CentOS 7

[gitlab-ce]
name=gitlab-ce
baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7
repo_gpgcheck=0
gpgcheck=0
enabled=1
gpgkey=https://packages.gitlab.com/gpg.key

再执行

sudo yum makecache
sudo yum install gitlab-ce

方法二:手动下载

可以手动下载rpm包进行安装,rpm包下载,建议使用科学上网工具下载

下载下来gitlab-ce-8.12.4-ce.0.el7.x86_64.rpm,执行

rpm -i gitlab-ce-8.12.4-ce.0.el7.x86_64.rpm

3.配置和启动GitLib

sudo gitlab-ctl reconfigure

4.修改root登录密码

配置完GitLib之后,打开浏览器输入localhost,首次需要修改密码,此处作者修改GitLib199000,然后使用root/GitLib199000登录即可。

5.使用

GitLib的使用建议阅读官方文档

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!