1.安装依赖包,运行命令
sudo apt-get install curl openssh-server ca-certificates postfix
执行完成后,出现邮件配置,选择Internet那一项(不带Smarthost的)
2.利用清华大学的镜像来进行主程序的安装。
curl https://packages.gitlab.com/gpg.key 2> /dev/null | sudo apt-key add - &>/dev/null
(如果下载过程中访问超时出错,请用curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash,并直接跳入gitlab-ce安装)
3.gitlab-ce的下载利用root用户打开文件。
vi /etc/apt/sources.list.d/gitlab-ce.list
加入下载地址:
deb https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/ubuntu xenial main
安装 gitlab-ce:
sudo apt-get update
sudo apt-get install gitlab-ce
4.执行配置
sudo gitlab-ctl reconfigure
5.检查GitLab是否安装好并且已经正确运行,输入下面的命令(查看gitlab的状态)
sudo gitlab-ctl status
6.检测是否开启正确
如果得到类似下面的结果,则说明GitLab运行正常
run: gitlab-workhorse: (pid 1148) 884s; run: log: (pid 1132) 884s
run: logrotate: (pid 1150) 884s; run: log: (pid