如何在 Ubuntu 22.04 LTS 上安装 GitLab

Linux命令2年前 (2022)发布 AI观察员
103 0 0

GitLab 是一个基于 Web 的 Git 存储库,它充当版本控制系统。GitLab 的主要优势之一是您可以根据您的要求管理Git存储库,例如保持信息公开/私密。如何在 Ubuntu 22.04 LTS 上安装 GitLab

Ubuntu 22.04 LTS Jammy Jellyfish 上安装 GitLab

apt步骤 1. 首先,通过在终端中运行以下命令,确保所有系统包都是最新的。

sudo apt update
sudo apt upgrade
sudo apt install build-essential curl file git ca-certificates

步骤 2. 在 Ubuntu 22.04 上安装 GitLab。

默认情况下,GitLab 在 Ubuntu 22.04 基础存储库中不可用。现在运行以下命令将 GitLab 存储库添加到您的 Ubuntu 系统:

curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash

接下来,使用以下命令下载 Gitlab 包:

wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/ubuntu/bionic/gitlab-ce_14.1.2-ce.0_amd64.deb/download.deb

然后,使用以下命令安装下载的 .deb 包:

dpkg -i gitlab-ce_14.1.2-ce.0_amd64.deb

输出:

root@idroot.us:~#dpkg -i gitlab-ce_14.1.2-ce.0_amd64.deb 
Selecting previously unselected package gitlab-ce.
(Reading database ... 73374 files and directories currently installed.)
Preparing to unpack gitlab-ce_14.1.2-ce.0_amd64.deb ...
Unpacking gitlab-ce (14.1.2-ce.0) ...
Setting up gitlab-ce (14.1.2-ce.0) ...
It looks like GitLab has not been configured yet; skipping the upgrade script.

       *.                  *.
      ***                 ***
     *****               *****
    .******             *******
    ********            ********
   ,,,,,,,,,***********,,,,,,,,,
  ,,,,,,,,,,,*********,,,,,,,,,,,
  .,,,,,,,,,,,*******,,,,,,,,,,,,
      ,,,,,,,,,*****,,,,,,,,,.
         ,,,,,,,****,,,,,,
            .,,,***,,,,
                ,*,.

     _______ __  __          __
    / ____(_) /_/ /   ____ _/ /_
   / / __/ / __/ /   / __ `/ __ \
  / /_/ / / /_/ /___/ /_/ / /_/ /
  \____/_/\__/_____/\__,_/_.___/

Thank you for installing GitLab!

完成后,通过运行以下命令启动 GitLab 实例:

gitlab-ctl reconfigure
gitlab-ctl start

您还可以通过以下方式获取 GitLab 服务的状态:

gitlab-ctl status

步骤 3. 配置防火墙。

Ubuntu 22.04ufw默认运行防火墙。通过端口 HTTP 和 HTTPS 启用连接:

sudo ufw allow https
sudo ufw allow http
sudo ufw allow ssh
sudo ufw enable
sudo ufw status

第 4 步。访问 GitLab Web 界面。

成功安装后,打开您的 Web 浏览器并使用 URL 访问 GitLab Web 界面。您将被重定向到以下页面:http://Your-IP-address

如何在 Ubuntu 22.04 LTS 上安装 GitLab

感谢您使用本教程在 Ubuntu 22.04 LTS Jammy Jellyfish 系统上安装 GitLab。如需更多帮助或有用信息,我们建议您查看GitLab 官方网站

© 版权声明

相关文章

天猫U特购  京东优惠购        京东优惠    天猫优惠