gitlab-ce-13.0.6安装-升级-卸载——安装篇

安装gitlab社区版


安装环境

系统版本:CentOS Linux release 7.9.2009 (Core)

1. 配置yum源

shell 复制代码
vim /etc/yum.repos.d/gitlab-ce.repo
shell 复制代码
[gitlab-ce]
name=gitlab-ce
baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6
Repo_gpgcheck=0
Enabled=1
Gpgkey=https://packages.gitlab.com/gpg.key

2. 更新本地yum缓存

shell 复制代码
sudo yum makecache

3. 安装Gitlab社区版

shell 复制代码
sudo yum install gitlab-ce        #自动安装最新版
sudo yum install gitlab-ce-x.x.x    #安装指定版本

注意:
如果无法安装,提示:The GPG keys listed for the "gitlab-ce" repository are already installed but they are not correct for this package.Check that the correct key URLs are configured for this repository.

4. 修改 /etc/yum.repos.d/gitlab-ce.repo 后再次安装

shell 复制代码
[gitlab-ce]
name=gitlab-ce
baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6
Repo_gpgcheck=0
Enabled=1
gpgcheck=0

5. 安装完成后启动服务

shell 复制代码
sudo gitlab-ctl reconfigure

注意

参考:https://www.cnblogs.com/springwind2006/p/6872773.html
如果在安装过程中卡住
1、按住CTRL+C强制结束;
2、运行:sudo systemctl restart gitlab-runsvdir;
3、再次执行:sudo gitlab-ctl reconfigure

6. GitLab常用命令

shell 复制代码
sudo gitlab-ctl start    # 启动所有 gitlab 组件;
sudo gitlab-ctl stop        # 停止所有 gitlab 组件;
sudo gitlab-ctl restart        # 重启所有 gitlab 组件;
sudo gitlab-ctl status        # 查看服务状态;
sudo gitlab-ctl reconfigure        # 启动服务;
sudo vim /etc/gitlab/gitlab.rb        # 修改默认的配置文件;
gitlab-rake gitlab:check SANITIZE=true --trace    # 检查gitlab;
sudo gitlab-ctl tail        # 查看日志;

扩展:

如果是CentOS release 6.x (Final)

CentOS-Base.repo使用阿里云的yum源

shell 复制代码
[root@Centos6 yum.repos.d]# cat CentOS-Base.repo 
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the 
# remarked out baseurl= line instead.
#
#
 
[base]
name=CentOS-6.10 - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
 
#released updates 
[updates]
name=CentOS-6.10 - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
 
#additional packages that may be useful
[extras]
name=CentOS-6.10 - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
 
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-6.10 - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
 
#contrib - packages by Centos Users
[contrib]
name=CentOS-6.10 - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
相关推荐
you来有去14 小时前
记录一下在k3s快速创建gitlab
java·kubernetes·gitlab
木二21 小时前
001.GItLab介绍及云原生部署
gitlab·cicd
User_undefined2 天前
批量将gitlab仓库转移到gitea中
gitlab·gitea
秋の水2 天前
使用Docker Desktop部署GitLab
docker·gitlab
深情不及里子5 天前
纯手工搭建整套CI/CD流水线指南
ci/cd·gitlab·jenkins·harbor
AliCloudROS6 天前
阿里云ACK+GitLab企业级部署实战教程
k8s·gitlab·helm·ack·计算巢
{⌐■_■}6 天前
【gitlab】认识 持续集成与部署
ci/cd·log4j·gitlab
JAVA坚守者12 天前
Jenkins+maven+gitlab+shell 实现项目自动化部署
gitlab·jenkins·maven
大熊程序猿12 天前
jenkins 配置ssh拉取gitlab
ssh·gitlab·jenkins
到不了p8不改名13 天前
gitlab无法登录问题
运维·服务器·容器·centos·gitlab·jenkins