linux怎样配置yum源_linux修改yum源地址

2022-09-21 11:06:20 浏览数 (1)

大家好,又见面了,我是你们的朋友全栈君。

1-1:安装yum

apt-get install yum1

2-1配置yum源

因为ubuntu系统本身是没有yum源的、所以要想使用yum源、必须自己手动配置:

cd /etc/yum/repos.d/ #用cd命令进入这个目录1

新建两个配置文件

touch fedora-163.repo

touch fedora-updates-163.repo1

2

打开两个配置文件

gedit fedora-updates-163.repo

gedit fedora-163.repo1

2

2-2开始配置

在fedora-163.repo文件里面添加:

[fedora]

name=Fedora 17 – $basearch – 163.com

failovermethod=priority

baseurl=http://mirrors.163.com/fedora/releases/17/Everything/$basearch/os/

mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-17&arch=$basearch

enabled=1

metadata_expire=7d

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch [fedora-debuginfo]

name=Fedora 17 – $basearch – Debug – 163.com

failovermethod=priority

baseurl=http://mirrors.163.com/fedora/releases/17/Everything/$basearch/debug/

mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-debug-17&arch=$basearch

enabled=0

metadata_expire=7d

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch [fedora-source]

name=Fedora 17 – Source – 163.com

failovermethod=priority

baseurl=http://mirrors.163.com/fedora/releases/17/Everything/source/SRPMS/

mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-source-17&arch=$basearch

enabled=0

metadata_expire=7d

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

在 fedora-updates-163.repo文件里面添加:

[updates]

name=Fedora 17 – $basearch – Updates – 163.com

failovermethod=priority

baseurl=http://mirrors.163.com/fedora/updates/17/$basearch/

mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-f17&arch=$basearch

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch [updates-debuginfo]

name=Fedora 17 – $basearch – Updates – Debug – 163.com

failovermethod=priority

baseurl=http://mirrors.163.com/fedora/updates/17/$basearch/debug/

mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-debug-f17&arch=$basearch

enabled=0

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch [updates-source]

name=Fedora 17 – Updates Source – 163.com

failovermethod=priority

baseurl=http://mirrors.163.com/fedora/updates/17/SRPMS/

mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-source-f17&arch=$basearch

enabled=0

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch1

执行刚才配置

yum makecache #在终端输入命令1

更新软件包数据

yum update#在终端输入命令1

当然也是可以使用本地的DVD安装镜像作为自己的软件源的、方法类似、先把镜像挂载、再进行配置就好了

文章来源: blog.csdn.net,作者:明人不放暗屁@cheng,版权归原作者所有,如需转载,请联系作者。

原文链接:blog.csdn.net/weixin_45846977/article/details/112521746

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/170107.html原文链接:https://javaforall.cn

0 人点赞