Linux相关工具yum、wget、vim、wget、firewall、rpm(持更)

本文介绍了一种解决Linux中yum源损坏的方法,通过参考特定的在线教程,成功修复了虚拟机上Linux系统的yum数据源问题。

yum 源配置

因为我自己用的是虚拟机,Linux自带了yum,但是数据源好像坏了,
然后我用的是此链接中的配置方法一
参考网站:https://www.cnblogs.com/yangp/p/8506264.html

在CentOS7系统下使用yum工具安装GitLab的详细步骤如下: 1. **前提准备** - 建立git用户(若为测试,可直接用root安装): ```bash useradd git passwd git ``` - 关闭防火墙: ```bash systemctl stop firewalld systemctl disable firewalld ``` - 安装依赖库: ```bash yum install curl openssh-server postfix cronie service postfix start chkconfig postfix on ``` 2. **安装依赖包** ```bash yum install -y policycoreutils-python openssh-server systemctl enable sshd systemctl start sshd ``` 3. **安装邮件服务** ```bash yum -y install postfix systemctl enable postfix systemctl start postfix ``` 4. **配置yum源** 可以选择以下两种方式之一配置yum源: - 方式一:通过脚本添加yum源 ```bash curl -sS http://packages.gitlab.cc/install/gitlab-ce/script.rpm.sh | bash ``` - 方式二:手动编辑yum源配置文件 ```bash vi /etc/yum.repos.d/gitlab.repo ``` 在文件中添加以下内容: ```plaintext [gitlab-ce] name=gitlab-ce baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6 Repo_gpgcheck=0 Enabled=1 Gpgkey=https://packages.gitlab.com/gpg.key ``` 也可以使用以下配置写入`/etc/yum.repos.d/gitlab-ce.repo`文件: ```plaintext [gitlab-ce] name=Gitlab CE Repository baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/ gpgcheck=0 enabled=1 ``` 完成配置后,yum缓存: ```bash yum makecache ``` 5. **安装扩展源(可选)** ```bash wget https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh chmod +x script.rpm.sh ./script.rpm.sh ``` 6. **安装GitLab** - 安装最新版: ```bash yum install gitlab-ce -y ``` - 安装指定版本(例如10.0.0版本),可先下载指定版本的rpm包: ```bash wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm ``` 然后进行安装: ```bash yum install gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm ``` 7. **修改配置并启动** 编辑配置文件: ```bash vim /etc/gitlab/gitlab.rb ``` 修改以下内容: ```plaintext external_url 'http://192.168.10.130' #监听的域名/IP nginx['listen_port'] = 80 #监听端口 ``` 开放防火墙端口: ```bash firewall-cmd --add-port=80/tcp firewall-cmd --add-port=80/tcp --permanent ``` 重载配置文件并启动GitLab(运行时间可能较长): ```bash gitlab-ctl reconfigure ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值