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

相关内容

热门资讯

透视玄学"菠萝德州辅... 您好,菠萝德州这款游戏可以开挂的,确实是有挂的,需要了解加微【757446909】很多玩家在这款游戏...
透视了解(wepoke实锤)外... 您好:wepoke实锤 这款游戏可以开挂,确实是有挂的,需要了解加微【487309276】很多玩家在...
透视ai!gg扑克有辅助软件透... 您好:gg扑克这款游戏可以开挂的,确实是有挂的,很多玩家在这款游戏中打牌都会发现很多用户的牌特别好,...
透明科技"gg扑克有... 《gg扑克软件透明挂》是一款多人竞技的gg扑克辅助透视游戏,你将微扑克对手来到同一个战场,为至高无上...
透视透明(鱼扑克fishpok... 《鱼扑克fishpoker俱乐部软件透明挂》是一款多人竞技的鱼扑克fishpoker俱乐部辅助透视游...
透视线上!微扑克有辅助挂有挂透... 透视线上!微扑克有辅助挂有挂透明挂辅助规律(透视)原来真的是有挂的(2025已更新)(哔哩哔哩)是一...
透视模拟器"aapo... 透视模拟器"aapoker系统机制"(透视)软件透明挂(有挂传授)-哔哩哔哩透视模拟器"aapoke...
透明有挂(wepOKE)透视辅... 您好,wepOKE这款游戏可以开挂的,确实是有挂的,需要了解加微【757446909】很多玩家在这款...
透视软件!WEPOKE有辅助外... 您好,WEPOKE这款游戏可以开挂的,确实是有挂的,需要了解加微【136704302】很多玩家在这款...
透明教学"wepok... 透明教学"wepoke透明挂识别"(透视)透视辅助(有挂规律)-哔哩哔哩是一款可以让一直输的玩家,快...