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

相关内容

热门资讯

透视规律(wPk)wpk俱乐部... 透视规律(wPk)wpk俱乐部(透视)详细辅助解密教程(原来有挂)1、构建自己的wpk俱乐部辅助插件...
透视肯定(wepower德州)... 透视肯定(wepower德州)智星德州菠萝有挂吗(透视)果然有挂(详细辅助透明教程)该软件可以轻松地...
aapoker有挂!Aapok... aapoker有挂!Aapoker app,(AAPOker)都是有挂(详细辅助微扑克教程)1、点击...
透视教程(wPK)wpk俱乐部... 透视教程(wPK)wpk俱乐部(透视)详细辅助安装教程(本来真的有挂)1、游戏颠覆性的策略玩法,独创...
透视规律(德州wpk)德州ai... 透视规律(德州wpk)德州ai机器人(透视)一贯真的有挂(详细辅助2025新版教程)运德州ai机器人...
aapoker挂!aapoke... aapoker挂!aapoker有后台操控吗,(AAPOKer)一直是真的有挂(详细辅助可靠教程);...
透视教程(wpK)微扑克ai辅... 透视教程(wpK)微扑克ai辅助工具(透视)详细辅助微扑克教程(总是是真的有挂)微扑克ai辅助工具辅...
透视总结(德州wepower)... 透视总结(德州wepower)智星德州菠萝偷偷看牌功能(透视)总是有挂(详细辅助解密教程)1)智星德...
aapoker有挂!aapok... aapoker有挂!aapoker ai软件,(aApoker)一直是真的有挂(详细辅助必备教程)在...
透视数据(微扑克)wpk透视辅... 透视数据(微扑克)wpk透视辅助测试(透视)详细辅助科技教程(都是存在有挂);1、wpk透视辅助测试...