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

相关内容

热门资讯

透视app"WePo... 透视app"WePoKer辅助器(底牌透视脚本)wepoker怎么看底牌"都是存在有挂1、wepok...
透视规律!wpk透视辅助,(w... 透视规律!wpk透视辅助,(wpK软件)透视辅助(原来有挂);1、很好的工具软件,可以解锁游戏的wp...
透视黑科技!wepoker免费... 透视黑科技!wepoker免费钻石,wepoker私人局俱乐部(透视其实有挂)1、wepoker私人...
透视实锤!wepoker怎么挂... 透视实锤!wepoker怎么挂飞机(wepoker下载)好友助力码(好像是真的有挂);1、下载好we...
透视辅助!wpk私人局辅助是真... 透视辅助!wpk私人局辅助是真的吗,(WpK软件)一直真的是有挂(详细作弊)1、wpk私人局辅助是真...
透视app!wepoker辅助... 透视app!wepoker辅助器安装包,(WEPOKER轻量版)真是存在有挂(详细私局辅助)1、we...
透视辅助"wepok... 透视辅助"wepoker可以免费玩吗(底牌透视脚本)wepoker有透视吗"一直真的有挂1、实时we...
透视讲解!wepoker透视脚... 透视讲解!wepoker透视脚本免费使用视频,wepoker破解是真的还是假的(透视竟然是真的有挂)...
透视透视!wpk透视是真的假的... 透视透视!wpk透视是真的假的,(wpK作弊)一贯是真的有挂(详细微扑克微乐辅助)wpk透视是真的假...
透视辅助"wepok... 透视辅助"wepoker透视有用吗(底牌透视脚本)wepoker可以开透视吗"好像有挂;所有人都在同...