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
相关推荐
tokepson7 小时前
Mysql下载部署方法备份(Windows/Linux)
linux·服务器·windows·mysql
zz_nj9 小时前
工作的环境
linux·运维·服务器
极客先躯9 小时前
如何自动提取Git指定时间段的修改文件?Win/Linux双平台解决方案
linux·git·elasticsearch
suijishengchengde10 小时前
****LINUX时间同步配置*****
linux·运维
qiuqyue10 小时前
基于虹软Linux Pro SDK的多路RTSP流并发接入、解码与帧级处理实践
linux·运维·网络
切糕师学AI10 小时前
Linux 操作系统简介
linux
南烟斋..11 小时前
GDB调试核心指南
linux·服务器
爱跑马的程序员11 小时前
Linux 如何查看文件夹的大小(du、df、ls、find)
linux·运维·ubuntu
oMcLin13 小时前
如何在 Ubuntu 22.04 LTS 上部署并优化 Magento 电商平台,提升高并发请求的响应速度与稳定性?
linux·运维·ubuntu
Qinti_mm14 小时前
Linux io_uring:高性能异步I/O革命
linux·i/o·io_uring