Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure local yum source and public network yum source under Linux

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how to configure local yum source and extranet yum source under Linux. It is very detailed and has a certain reference value. Interested friends must read it!

YUM is a Cramp S architecture software, which can manage software packages based on RPM format. It provides functions such as automatic dependency resolution, package grouping, package upgrade and so on.

One: local source configuration method: take rpm in CD as an example (here use a virtual machine to demonstrate)

1. Mount an image of iso

Mount the CD to a directory / mnt, then go to the / etc/yum.reps.d/ directory to create a file that ends with .repo, with the following contents: * (this file is the shortest) *

YUM: a front-end program for Yellowdog Update Modifier,rpm that solves package-related dependencies and locates software packages among multiple libraries as an alternative to up2date

Yum repository: yum repo, which stores a number of rpm packages and related metadata files (placed in a specific directory repodata) file server:

Http:// https:// ftp:// file://

The content format of the configuration file for yum repository is as follows:  yum client configuration file: (you can follow the simplest configuration above)

/ etc/yum.conf # this directory file provides a common configuration for all repositories / etc/yum.repos.d/*.repo # provides a definition of the configuration repository pointing to the yum repository:

[repositoryID] name=Some name for this repositorybaseurl=url://path/to/repository/enabled= {1 | 0} gpgcheck= {1 | 0} gpgkey=URLenablegroups= {1 | 0} failovermethod= {roundrobin | priority} roundrobin: it means random selection. Default value: priority: access the cost= sequentially, default is 1000, and then use the command immediately after configuration.

Yum clean all clears the local yum source cache yum repolist to regenerate metadata. 2. Configuration method of public network source:

NetEase yum source is one of the best yum sources in China, no matter the speed or software version, are very good, set the yum source to 163yum, you can improve the speed of package installation and update, while avoiding some common software versions can not be found. The specific setting method is as follows:

1. First enter the configuration directory of the Yum source

Cd / etc/yum.repos.d/ this directory will have the official yum source by default, because these addresses are foreign sources, the download speed will be much slower, let's replace it with 163source

2. Back up the yum source that comes with the system first

Mv * .repo repo_backup/

3. Execute the command in the current directory and download the yum source of NetEase directly:

Wget http://mirrors.163.com/.help/CentOS7-Base-163.repo

After that, there will be a 163yum source configuration file ending in repo, which can be used directly.

To avoid being affected by the cache of the previous source, it is best to clear the cache of yum.

Yum clean all # clear yum cache yum repolist # View the list of Yum sources and generate the corresponding metadata cache locally

4. After configuration, you can use the yum install + software name.

Second, configure public network yum sources in addition to NetEase, there are other good domestic yum sources, epel, sources of Tsinghua University, you can paste and use them according to your own needs.

Ali Yun (you can also download ready-made files directly)

Wget http://mirrors.aliyun.com/repo/Centos-7.repoyum install-y epel-release # download repo file configuration of epel source yum source: you can also configure multiple yum sources in one file with different names

[aliyun] name=aliyun_yumbaseurl= https://mirrors.aliyun.com/centos/$releasever/os/x86_64/gpgcheck=0enabled=1[epel]name=net epelbaseurl= https://mirrors.aliyun.com/epel/$releasever/x86_64/gpgcheck=0enabled=1 yum source configuration of Tsinghua University: create a new xxx.repo file in the / etc/yum.repos.d/ directory and paste the following:

[base] name=CentOS-$releasever-Basebaseurl= http://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/os/$basearch/gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7#released updates [updates] name=CentOS-$releasever-Updatesbaseurl= http://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/updates/$basearch/gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7#additional packages that may be usefull [extras] name=CentOS-$releasever-Extrasbaseurl=http : / / mirrors.tuna.tsinghua.edu.cn/centos/$releasever/extras/$basearch/gpgcheck=1gpgkey= file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7#additional packages that extend functionality of existing packages [centosplus] name=CentOS-$releasever-Plusbaseurl= http://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/centosplus/$basearch/gpgcheck=1enabled=0gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 above is "how to configure local yum source and public network under Linux" All the contents of this article "yum Source" Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report