# gitlab安装 ## 下载 [下载地址](https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/) ## 安装依赖 ```shell yum install curl policycoreutils openssh-server openssh-clients policycoreutils-python systemctl enable sshd systemctl start sshd ``` ```shell yum install postfix systemctl enable postfix systemctl start postfix ``` ## 配置文件 * 默认位置:/etc/gitlab/gitlab.rb * 内容 ​external_url 访问地址 git_data_dir 数据保存位置 ## 汉化 * 打补丁方式 ```shell wget https://gitlab.com/xhang/gitlab git diff v12.0.3 v12.0.3-zh > ../12.0.3-zh.diff patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < ../12.0.3-zh.diff ``` * 直接覆盖方式 ```shell wget https://gitlab.com/xhang/gitlab/repository/12-0-stable-zh/archive.tar.bz2 -O gitlab-12-0-stable-zh.tar.bz2 \cp -rf gitlab-v12.0.0/* /opt/gitlab/embedded/service/gitlab-rails/ ``` # 卸载 * 清理命令 ```shell wget https://gitlab.com/xhang/gitlab/repository/12-0-stable-zh/archive.tar.bz2 -O gitlab-12-0-stable-zh.tar.bz2 \cp -rf gitlab-v12.0.0/* /opt/gitlab/embedded/service/gitlab-rails/ ``` + 停止gitlab `gitlab-ctl stop` * 卸载gitlab `rpm -e gitlab-ce` - 查看进程 `ps aux | grep gitlab` - 杀掉守护进程 `kill -9 xxx` - 清理残余文件 `find / -name gitlab | xargs rm -rf`