1 、安装操作系统
a、升级操作系统和安装wget
sudo yum -y update
![](https://box.kancloud.cn/e14c3249ef02c6c958ad1a43dbe53f28_484x233.png)
sudo yum -y install wget
查看版本信息
lsb_release -a
报错 -bash: lsb_release: command not found
解决办法
yum install redhat-lsb -y
![](https://box.kancloud.cn/cb8975f66454a235a3987b037bfd4f2f_703x164.png)
centos 6.8 安装gitlab 和 centos 6.5 安装gitlab 一样
b、增加EPEL安装源
sudo wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 https://www.fedoraproject.org/static/0608B895.txt
sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
检验下是否安装成功
sudo rpm -qa gpg*
![](https://box.kancloud.cn/670b03317263e3d4043f86a9c9193990_575x224.png)
安装epel-release-6-8.noarch包
sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
c、查看仓库源
yum repolist
![](image/screenshot_1489561967741.png)
如果此列表中没有epel和PUIAS_6_computational,请执行以下命令
yum-config-manager --enable epel --enable
报错 bash: yum-config-manager: command not found
解决方法:yum -y install yum-utils
三,安装git
默认centos的git版本是1.7.10,所以要先删除,然后再下载源码安装
yum remove git -y
yum install zlib-devel perl-CPAN gettext curl-devel expat-devel gettext-devel openssl-devel
mkdir /tmp/git && cd /tmp/git
curl --progress https://www.kernel.org/pub/software/scm/git/git-2.1.3.tar.gz | tar xz
cd git-2.1.3/ && ./configure && make && make prefix=/usr/local install
完成后验证
which git
/usr/local/bin/git
git --version
git version 2.1.3
如果安装存在问题
2.源码安装Git
参见:http://www.cnblogs.com/jim-hwg/p/4748008.html
3.源码安装Ruby
参见:http://www.cnblogs.com/jim-hwg/p/4746977.html
4.源码安装MySQL
参见:http://www.cnblogs.com/jim-hwg/p/4747165.html
安装gitlab
sudo yum install curl openssh-server openssh-clients postfix cronie
sudo service postfix start
sudo chkconfig postfix on
sudo lokkit -s http -s ssh
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
sudo yum install gitlab-ce