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

相关内容

热门资讯

四分钟了解!腾威互娱 辅助工具... 四分钟了解!腾威互娱 辅助工具!一直是真的有辅助技巧(有挂技巧)-哔哩哔哩进入游戏-大厅左侧-新手福...
3分钟了解!白金岛辅助怎么设置... 3分钟了解!白金岛辅助怎么设置!竟然存在有辅助app(有挂存在)-哔哩哔哩小薇(辅助器软件下载)致您...
五分钟了解!奇迹陕西怎么用挂!... 五分钟了解!奇迹陕西怎么用挂!总是存在有辅助教程(有挂存在)-哔哩哔哩1、全新机制【奇迹陕西怎么用挂...
9分钟了解!乐酷大厅怎么安装!... 9分钟了解!乐酷大厅怎么安装!本来一直总是有辅助工具(有挂细节)-哔哩哔哩1、进入游戏-大厅左侧-新...
四分钟了解!yy比鸡辅助真的假... 四分钟了解!yy比鸡辅助真的假的!竟然真的有辅助神器(有挂教程)-哔哩哔哩一、yy比鸡辅助真的假的游...
五分钟了解!福建十三时辅助!果... 五分钟了解!福建十三时辅助!果然真的是有辅助app(真的有挂)-哔哩哔哩1、超多福利:超高返利,海量...
9分钟了解!雀友会潮汕辅助器!... 9分钟了解!雀友会潮汕辅助器!原来是有辅助app(真是有挂)-哔哩哔哩亲,关键说明,雀友会潮汕辅助器...
十分钟了解!随意玩房卡代理有挂... 十分钟了解!随意玩房卡代理有挂吗!本来有辅助插件(有挂分析)-哔哩哔哩1、下载好随意玩房卡代理有挂吗...
八分钟了解!微乐智能辅助app... 八分钟了解!微乐智能辅助app!一直是有辅助方法(有挂规律)-哔哩哔哩1、玩家可以在微乐智能辅助ap...
六分钟了解!湖湘互娱牛牛!本来... 六分钟了解!湖湘互娱牛牛!本来是有辅助教程(有挂规律)-哔哩哔哩1.湖湘互娱牛牛 选牌创建新账号,点...