Centos 7.6 安装、汉化、卸载GitLab
创始人
2024-11-15 00:03:39
0

笔记:

# 2024年8月2日10:56:51
# 安装包准备(如果是云服务器(只有4G内存的)建议安装之前的版本,小一点:gitlab-ce-10.5.1-ce.0.el7.x86_64.rpm)

# 下载地址(二选一版本)

wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.5.1-ce.0.el7.x86_64.rpm
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-17.1.1-ce.0.el7.x86_64.rpm

# 安装相关工具

yum install policycoreutils-python

# 安装gitlab(二选一版本)

rpm -i gitlab-ce-10.5.1-ce.0.el7.x86_64.rpm
rpm -i gitlab-ce-17.1.1-ce.0.el7.x86_64.rpm

# 修改gitlab配置文件指定服务器ip和自定义端口

# external_url 'http://192.168.111.128'

vim /etc/gitlab/gitlab.rb

# 重置gitlab

gitlab-ctl reconfigure

################### 安装结束end ###################

# 重启命令

gitlab-ctl restart

# 启动命令

gitlab-ctl start

################### 重置密码 ###################
# 老版本打开页面有提示设置root账号的密码就不需要,
# 新版本如果没有设置密码,那么需要自己重置密码
# 重置管理员密码

gitlab-rails console -e production

# 在控制台中重置密码

user = User.where(id: 1).first
user.password = '1sxxxxxx.'
user.password_confirmation = '1sxxxxxx.'
user.save!
exit

# exit 退出控制台并重启 GitLab

gitlab-ctl restart


# GitLab 启动/重启时间比较长,如果访问出现502,请耐心等待几分钟
################### end ###################

################### 汉化(新的版本不需要,直接在后台设置) ###################

# 查看版本(我的是11.0.2)

cat /opt/gitlab/embedded/service/gitlab-rails/VERSION

# 安装git

yum install -y git

# 克隆GitLab汉化源代码仓库

git clone https://gitlab.com/xhang/gitlab.git

# 检查是否安装了 patch ,安装了就跳过下一步

patch -v

# 安装patch

yum install -y patch

# 进入克隆仓库得到的gitlab目录

cd gitlab

# 对比不同,diff结果是汉化补丁

git diff v11.0.2..v11.0.2-zh > /opt/11.0.2.diff

# 停止gitlab

gitlab-ctl stop

# 应用汉化补丁

patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < /opt/11.0.2.diff
# 如果出现这种找不到补丁文件,直接 回车 + y 。全部跳过 can't find file to patch at input line 5 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff --git a/app/assets/javascripts/diff_notes/components/resolve_btn.js b/app/assets/javascripts/diff_notes/components/resolve_btn.js |index 8d66417..991eae6 100644 |--- a/app/assets/javascripts/diff_notes/components/resolve_btn.js |+++ b/app/assets/javascripts/diff_notes/components/resolve_btn.js -------------------------- File to patch: Skip this patch? [y] y

# 启动gitlab

gitlab-ctl start

################### 汉化结束 ###################

################### 卸载 ###################

# 停止服务

gitlab-ctl stop

# 卸载GitLab

rpm -e gitlab-ce

# 查找相关文件

find / -name gitlab*

# 删除相关文件

rm -rf  /opt/gitlab
rm -rf  /etc/gitlab
rm -rf  /var/log/gitlab

相关内容

热门资讯

烘培外挂!wepoker怎么设... 烘培外挂!wepoker怎么设置透视,约局吧游戏挂,透明挂教程(真的有挂)-哔哩哔哩;亲,wepok...
一分钟了解!aapoker透视... 《一分钟了解!aapoker透视脚本入口,wejoker开挂,必备教程(真的有挂)-哔哩哔哩》 软件...
第九分钟辅助!鸿狐大厅脚本,潮... 第九分钟辅助!鸿狐大厅脚本,潮汕木虱有辅助挂吗,攻略教程(证实有挂)-哔哩哔哩潮汕木虱有辅助挂吗ai...
第九分钟发现!随意玩有辅助吗(... 第九分钟发现!随意玩有辅助吗(外挂)原来确实有挂平台(分析开挂神器);随意玩有辅助吗软件透视开挂是一...
模板外挂!pokermaste... 模板外挂!pokermaster辅助器,佛手大菠萝辅助,wpk教程(详细教程)-哔哩哔哩佛手大菠萝辅...
4分钟领会!wepoker智能... 4分钟领会!wepoker智能辅助插件,wepoker透视苹果系统,攻略教程(有挂教学)-哔哩哔哩;...
第1分钟讲解!仙桃晃晃诀窍,衢... 您好:这款衢州都莱辅助器下载游戏是可以开挂的,确实是有挂的,很多玩家在这款衢州都莱辅助器下载游戏中打...
第四分钟科普!中至有挂吗(外挂... 第四分钟科普!中至有挂吗(外挂)原来真的有挂平台(通报开挂神器);小薇(透视辅助)致您一封信;亲爱中...
总结外挂!wpk辅助购买,hh... 总结外挂!wpk辅助购买,hh poker软件,AI教程(确实有挂)-哔哩哔哩wpk辅助购买ai黑科...
一分钟详情!微乐陕西三代自建房... 微乐陕西三代自建房挂 无需打开直接搜索微信:136704302本司针对手游进行,选择我们的四大理由:...