国内debian8-10系列部署gitlab-ce最新社区版

1.配置国内源

#编辑软件源配置文件,将对应系统版本的阿里云软件源加进去

vim /etc/apt/sources.list

 

debian8:

deb http://mirrors.aliyun.com/debian/ jessie main non-free contrib
deb http://mirrors.aliyun.com/debian/ jessie-proposed-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ jessie main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ jessie-proposed-updates main non-free contrib

  

debian9:

复制代码
deb http://mirrors.aliyun.com/debian/ stretch main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ stretch main non-free contrib
deb http://mirrors.aliyun.com/debian-security stretch/updates main
deb-src http://mirrors.aliyun.com/debian-security stretch/updates main
deb http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib
复制代码

 

debian10:

复制代码

deb http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb http://mirrors.aliyun.com/debian-security buster/updates main
deb-src http://mirrors.aliyun.com/debian-security buster/updates main
deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib

复制代码

 

#编辑添加对应系统版本的gitlab软件源,然后更新

vim /etc/apt/sources.list.d/gitlab-ce.list
 
debian8:
deb http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/debian jessie main

 

debian9:

deb http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/debian stretch main

 

debian10:

deb http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/debian buster main

 

#更新软件列表

apt-get update

 

 

2.安装GitLab依赖项并添加gitlab存储库

apt -y install curl vim openssh-server ca-certificates
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash

 

 

3.安装gitlab社区版

1)通过源地址安装gitlab

apt-get install gitlab-ce

 2)通过安装包安装gitlab

1
2
3
4
5
6
官方仓库地址:https://packages.gitlab.com/gitlab/gitlab-ce
 
RPM包:
rpm -ivh
deb包:
dpkg -i

  

 

 

4.重置root密码

复制代码
[root@test bin]# gitlab-rails console
irb(main):001:0> user = User.where(id:1).first
=> #<User id:1 @root>
irb(main):002:0> user.password = '修改的密码(必须超过八位)'
=> "qwer1234"
irb(main):003:0> user.password_confirmation = '修改的密码(必须超过八位)'
=> "qwer1234"
irb(main):004:0> user.save
Enqueued ActionMailer::DeliveryJob (Job ID: 4752a4a4-4e85-4e8b-9f27-72788abfe97c) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", #<GlobalID:0x00007f519e7501d8 @uri=#<URI::GID gid://gitlab/User/1>>
=> true
irb(main):005:0> exit
复制代码

 

 

5.编辑配置文件,设置为你的url

vim /etc/gitlab/gitlab.rb

external_url 'http://xxx'

 

#重新生成配置并启动服务

gitlab-ctl reconfigure

 

 

打开浏览器,输入你设置的url,用户名:root   密码:刚才重置的密码

 

 

 

 

 

 

posted @   晚风吹散了你  阅读(190)  评论(1编辑  收藏  举报
编辑推荐:
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
阅读排行:
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· Docker 太简单,K8s 太复杂?w7panel 让容器管理更轻松!
点击右上角即可分享
微信分享提示