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
相关推荐
王琦03186 小时前
Linux的文件管理
linux·运维·服务器
Android系统攻城狮6 小时前
Linux PipeWire深度解析之pw_stream_new调用流程与实战(四十二)
linux·运维·服务器·音频进阶·pipewire音频进阶
蜉蝣fuyou6 小时前
VMware多版本安装包
linux·vmware·虚拟机
不会代码的小猴6 小时前
Linux note2
linux·笔记
雾里0不看花7 小时前
【App Service Linux】在Linux App Service中安装 tcpdump 并抓取网络包
linux·网络·tcpdump
Dawn-bit8 小时前
Linux日志处理三剑客之基础篇:(基础正则+扩展正则)
linux·运维·服务器·正则表达式·云计算·运维开发
☆凡尘清心☆8 小时前
Linux运维故障排查速查命令清单
linux·运维·服务器
小泊客8 小时前
友善R5C刷OpenWrt后RTL8822CE无线网卡显示“禁用”或“未激活”的完整解决方案
linux·github·运维开发
mounter6258 小时前
跨内核实时更新:如何实现 hugetlbfs 巨页的无缝保留与恢复?
linux·linux kernel·kernel·kexec·liveupdate·kho
qeen878 小时前
【Linux】make/Makefile 自动化工具的介绍
linux·运维·服务器·自动化