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
相关推荐
JAVA坚守者6 天前
Jenkins+maven+gitlab+shell 实现项目自动化部署
gitlab·jenkins·maven
大熊程序猿6 天前
jenkins 配置ssh拉取gitlab
ssh·gitlab·jenkins
到不了p8不改名6 天前
gitlab无法登录问题
运维·服务器·容器·centos·gitlab·jenkins
java 凯8 天前
Ubuntu 上安装 GitLab
linux·ubuntu·gitlab
刘金宝_Arvin8 天前
解决IDEA中gitlab登录只有token选项,没有账号密码选项
gitlab
Chicheng_MA8 天前
GitLab CI/CD 的配置详解:从零开始使用 .gitlab-ci.yml 文件
gitlab
极小狐10 天前
极狐GitLab 17.8 正式发布,多项 DevOps 重点功能解读【一】
gitlab·devops·极狐gitlab
Vince丶10 天前
window 安装GitLab服务器笔记
笔记·gitlab·gitlab服务器
雨声不在10 天前
gitlab多项目流水线
gitlab
你脸上有BUG10 天前
【Git】ssh如何配置gitlab+github
git·ssh·gitlab·github