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
相关推荐
极小狐3 小时前
Ruby-SAML CVE-2024-45409 漏洞解决方案
gitlab·devsecops·devops·极狐gitlab·安全合规
向往风的男子19 小时前
【devops】devops-gitlab之部署与日常使用
运维·gitlab·devops
soaring012119 小时前
Gitlab实现多项目触发式自动CICD
pipeline·gitlab·triggers·access tokens
cn_newer1 天前
gitlab/极狐-离线包下载地址
gitlab·devops·极狐·离线包下载
Roc-xb2 天前
Centos7安装gitlab-ce(rpm安装方式)
centos·gitlab
慕羽★3 天前
Git常用指令整理【新手入门级】【by慕羽】
linux·git·ubuntu·gitlab·github·仓库·分布式协作
心之所想,行之将至3 天前
记录一下gitlab社区版的安装教程
linux·服务器·gitlab
极小狐3 天前
2024 年 GitLab Global DevSecOps 报告解读
gitlab·devsecops·devops·极狐gitlab·安全合规
极小狐3 天前
极狐GitLab DevSecOps 功能合集(七大安全功能)
安全·gitlab·devsecops·极狐gitlab·安全合规
iRayCheung3 天前
Gitlab pre-receive hooks适配java p3c-pmd和python pycodestyle
java·python·gitlab·pre-receive