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
相关推荐
A ?Charis1 天前
Gitlab-runner running on Kubernetes - hostAliases
容器·kubernetes·gitlab
秋说1 天前
开源代码管理平台Gitlab如何本地化部署并实现公网环境远程访问私有仓库
gitlab·源代码管理
极小狐1 天前
驭码上新,AI Code Review、基于代码库的知识问答,让研发起飞
gitlab·devsecops·devops·极狐gitlab·安全合规
蚊子不吸吸2 天前
DevOps开发运维简述
linux·运维·ci/cd·oracle·kubernetes·gitlab·devops
花开莫与流年错_5 天前
GitLab代码仓管理安装配置使用
运维·服务器·git·gitlab·配置·代码仓
极小狐7 天前
如何打开/关闭 GitLab 的版本检查功能?
gitlab·devsecops·devops·极狐gitlab·安全合规
玉石俱焚ing8 天前
ubuntu20上部署gitlab并开启ipv6访问
运维·gitlab
謬熙9 天前
GitHub、Gitee、GitLab介绍
gitee·gitlab·github
云围9 天前
Soanrquber集成Gitlab 之 导入Gitlab项目
运维·ci/cd·gitlab·devops
云围9 天前
Soanrquber集成Gitlab 之 gitlab用户配置和身份验证
ci/cd·gitlab·github·devops