GitLab 17.x 在 Ubuntu 24.04 上安装配置

文章目录

      • [1. 环境准备](#1. 环境准备)
      • [2. GitLab 安装](#2. GitLab 安装)
      • [3. 离线安装](#3. 离线安装)

1. 环境准备

2. GitLab 安装

参考:https://about.gitlab.com/install/#ubuntu

安装和配置必要的依赖项:

shell 复制代码
$ sudo apt-get update
$ sudo apt-get install -y curl openssh-server ca-certificates tzdata perl

接下来,您需要添加GitLab软件包存储库。有一种简单的方法可以执行此操作,即通过运行以下命令:

//配置 repo

bash 复制代码
$ curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash

info\]尽管在这种情况下它是无害的,但是警惕直接从Internet运行shell脚本。

现在,您将要设置 GitLab 对外提供服务的 URL 地址或 IP ,如果使用 https 方式,GitLab 将自动使用Let's Encrypt 请求一个证书,这需要一个有效的外部域名。

bash 复制代码
// 安装指定版本
#$ EXTERNAL_URL="http://gitlabtest.xiodi.cn" apt-get install gitlab-ce=17.2.2-ce.0
// 锁定版本以限制自动更新:
#$ sudo apt-mark hold gitlab-ce
// 显示保留的包:
#$ sudo apt-mark showhold

$ EXTERNAL_URL="http://gitlabtest.xiodi.cn" apt-get install gitlab-ce

安装完成后,可以查看一下后面的输出日志,会告诉你,默认用户密码:

shell 复制代码
$ cat /etc/gitlab/initial_root_password
...
Password: 7jw56aJyF78ePVPVmN71m/3nPgP4Q3un1+XEnxhRrDE=
...

您可用使用 EXTERNAL_URL 地址访问 GitLab 并继续进行配置,默认用户名为 root ,请注意,它不是操作系统的 root。

注意:当第一次访问的时候,尽量不要开启 vpn 代理,有可能会根据当前所处地区,初始化语言,造成没有切换为中文语言选项,待考证是否这个原因,目前遇到过一次。

3. 离线安装

下载地址:https://packages.gitlab.com/gitlab/gitlab-ce

bash 复制代码
$ wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/ubuntu/noble/gitlab-ce_17.2.2-ce.0_amd64.deb/download.deb
$ EXTERNAL_URL="http://gitlabtest.xiodi.cn" dpkg -i gitlab-ce_17.2.2-ce.0_amd64.deb
相关推荐
balmtv5 小时前
Linux(CentOS)安装 MySQL
linux·mysql·centos
轻颂呀6 小时前
Linux总结
linux·运维·服务器
-ONLY-¥6 小时前
LNMP架构部署实战全解析
linux
AMoon丶7 小时前
C++模版-函数模版,类模版基础
java·linux·c语言·开发语言·jvm·c++·算法
ryan007liu7 小时前
shell 批量执行locust 脚本压测
linux·服务器·压力测试
AMoon丶8 小时前
Golang--多种数据结构详解
linux·c语言·开发语言·数据结构·c++·后端·golang
高旭的旭8 小时前
Ubuntu 无显示器远程桌面完美方案
linux·ubuntu·计算机外设
峥嵘life8 小时前
Android16 【CTS】CtsWindowManagerDeviceAnimations存在fail项
android·linux·学习
VermouthSp9 小时前
上下文切换
linux·rust
我爱学习好爱好爱10 小时前
Logstash 数据管道测试案例:从 Filebeat 接收日志并输出至黑屏幕与 Elasticsearch(基于Rocky Linux 9.6)
大数据·linux·elasticsearch