Ubuntu下samba安装(yum更改源(没有仓库))

安装samba服务器时出现问题

yum install -y samba
There are no enabled repos.
 Run "yum repolist all" to see the repos you have.
 You can enable repos with yum-config-manager --enable <repo>

报错,说没有仓库,查看一下

发现是没有软件源,我们要想使用yum的功能时,必须要先找到适合的yum服务器才行而每个yum服务器可能会提供许多不同的软件功能。在这里以阿里源为例。
网上好多配置发现都存在问题,发现yum的路径出现问题,因此以下为网络版安装步骤
进去目录查看是否有源
本人为空文件夹

cd   /etc/yum/repos.d

如果有请备份

mv /etc/yum/repos.d/CentOS-Base.repo /etc/yum/repos.d/CentOS-Base.repo_bak 

阿里提供了几个yum的源,都安装也行

# CentOS 5
wget -O /etc/yum/repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
# CentOS 6
wget -O /etc/yum/repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
# CentOS 7
wget -O /etc/yum/repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

设置
我是使用了7版本,使用6之后,安装samba服务器出现问题,因此使用7

 sed -i 's/$releasever/7/g' /etc/yum/repos.d/CentOS-Base.repo

更新cache

yum clean all 
 yum makecache 
root@iZpzjq03umoc0aZ:/etc/yum/repos.d # yum makecache
base                                                        | 3.7 kB  00:00
base/group_gz                                               | 242 kB  00:00
base/filelists_db                                           | 6.4 MB  00:00
base/primary_db                                             | 4.7 MB  00:00
base/other_db                                               | 2.8 MB  00:00
extras                                                      | 3.4 kB  00:00
extras/filelists_db                                         |  24 kB  00:00
extras/prestodelta                                          | 2.2 kB  00:00
extras/primary_db                                           |  29 kB  00:00
extras/other_db                                             |  14 kB  00:00
file:///media/cdrom/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /media/cdrom/repodata/repomd.xml"
Trying other mirror.

如果出现以下错误,可以删除/etc/yum/repos.d下除了CentOS-Base.repo的文件重新运行命令,解决问题

4.查看

yum -y update
然后开始安装samba。

  • 1
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

风赤

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值