CentOS8解决无法下载samba服务的问题,同步仓库缓存失败问题

问题如下:

无法下载samba服务,同步仓库缓存失败

1.首先检查网络有无连接上

2.ping一下baidu.com,,检查连接的网络能否使用

3.更换下载源为国内yum源

4.清理yum缓存

5.vim编辑/etc/yum.repos.d/CentOS-AppStream.repo文件,确保新的缓存建立成功

先复制

[root@Server01 hfx]# cat /etc/yum.repos.d/CentOS-Base.repo

# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[BaseOS]
name=Qcloud centos OS - $basearch
baseurl=http://mirrors.cloud.tencent.com/centos/$releasever/BaseOS/$basearch/os/
enabled=1
gpgcheck=1
gpgkey=http://mirrors.cloud.tencent.com/centos/RPM-GPG-KEY-CentOS-Official

[centosplus]
name=Qcloud centosplus - $basearch
baseurl=http://mirrors.cloud.tencent.com/centos/$releasever/centosplus/$basearch/os/
enabled=0
gpgcheck=1
gpgkey=http://mirrors.cloud.tencent.com/centos/RPM-GPG-KEY-CentOS-Official

[extras]
name=Qcloud centos extras - $basearch
baseurl=http://mirrors.cloud.tencent.com/centos/$releasever/extras/$basearch/os/
enabled=1
gpgcheck=1
gpgkey=http://mirrors.cloud.tencent.com/centos/RPM-GPG-KEY-CentOS-Official

[fasttrack]
name=Qcloud centos fasttrack - $basearch
baseurl=http://mirrors.cloud.tencent.com/centos/$releasever/fasttrack/$basearch/os/
enabled=0
gpgcheck=1
gpgkey=http://mirrors.cloud.tencent.com/centos/RPM-GPG-KEY-CentOS-Official

[AppStream]
name=Qcloud centos AppStream - $basearch
baseurl=http://mirrors.cloud.tencent.com/centos/$releasever/AppStream/$basearch/os/
enabled=0
gpgcheck=1
gpgkey=http://mirrors.cloud.tencent.com/centos/RPM-GPG-KEY-CentOS-Official

[PowerTools]
name=Qcloud centos PowerTools - $basearch
baseurl=http://mirrors.cloud.tencent.com/centos/$releasever/PowerTools/$basearch/os/
enabled=0
gpgcheck=1
gpgkey=http://mirrors.cloud.tencent.com/centos/RPM-GPG-KEY-CentOS-Official

复制里面的[AppStream]部分更改到/etc/yum.repos.d/CentOS-AppStream.repo对应位置上

6.成功建立yum缓存,并安装samba服务

7.防火墙的设置,允许Samba服务通过防火墙,并且暂时关闭SELinux的强制执行,以便进行某些操作或测试。

  1. firewall-cmd --permanent --add-service=samba

    • firewall-cmd 是用来管理防火墙规则的命令。
    • --permanent 参数表示对防火墙规则进行永久性更改,而不是临时更改。
    • --add-service=samba 参数表示将Samba服务添加到防火墙规则中,允许Samba服务通过防火墙。
  2. firewall-cmd --reload

    • 这个命令用于重新加载防火墙规则,使之前所做的更改生效。
  3. setenforce 0

    • setenforce 是用来控制SELinux(Security-Enhanced Linux)的强制模式。
    • 0 表示将SELinux设置为宽容模式(permissive mode),在这种模式下,SELinux会记录违反策略的行为,但不会阻止它们。这通常用于测试或调试。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值