Get the App
SLTechnology News&Howtos  ›  Network Security  › 

To be a public network yum source

Shulou Source: shulou.com Published: 2022-06-01 05:40:47 10月02日 Update

1. Network YUM source uses 163yum source

1. Go to the http://mirrors.163.com/.help/centos.html website to download the corresponding yum file (

CentOS7

CentOS6

CentOS5) CentOS-Base-163.repo, put in / etc/yum.repos.d/

two。 Run yum makecache to generate cache

3.yum search softwarename search software

4.yum list softwarename lists installed software

5.yum install softwarename installation software

6.yun remove softwarename Uninstall Software

(sohu yum source: http://mirrors.shou.com, is used in the same way)

2. Local yum sources use CD-ROM yum sources

1. Mount the CD

Mount-t iso9660-o loop / dev/cdrom / media/CentOS

two。 Remove the original repo file from the / etc/yum.repos.d directory

3. Create a new repo file

Vi / etc/yum.repos.d/CentOS-Media.repo

Add the following fields:

[c5-media]

Name=CentOS-$releasever-Media

Baseurl= file:///media/CentOS/

Gpgkey= file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

4. Refresh repos

Yum makecache

Reference / etc/yum.repos.d/CentOS-Media.repo file

# CentOS-Media.repo

#

# This repo is used to mount the default locations for a CDROM / DVD on

# CentOS-5. You can use this repo and yum to install items directly off the

# DVD ISO that we release.

#

# To use this repo, put in your DVD and use it with the other repos too:

# yum-- enablerepo=c5-media [command]

#

# or for ONLY the media repo, do this:

#

# yum-- disablerepo=\ *-- enablerepo=c5-media [command]

[c5-media]

Name=CentOS-$releasever-Media

Baseurl= file:///media/CentOS/

File:///media/cdrom/

File:///media/cdrecorder/

Gpgcheck=1

Enabled=0

=

Another way: configure yum source under redhat linux

Using the yum source that comes with the redhat linux system seems to be licensed and costs a fee. Using the CentOS source is free and easy to configure.

1.#cd / etc/yum.repos.d/ # Open source path

2.#wget http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo # download the source of CentOS

3.#yum install softwarename

Attachment: the yum source used by CentOS is configured in two files under the / etc/yum.repos.d/ directory, where:

CentOS-Base.repo is the source of configuration network yum

CentOS-Media.repo is the local yum source for configuration

Configure network yum source 7:

-wget-O / etc/yum.repos.d/centos.repo http://mirrors.aliyun.com/repo/Centos-7.repo

Two sed-I's Universe release _ always _ _ seven _ etc/yum.repos.d/centos.repo

3. Clear yum cache, yum clean all

Update the list of yum networks, "yum list"

Tags: Configuration file network software CD directory cache same two usage field method is in system website fee path reference update generate Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Shulou Information Shulou Tech Info Linux MariaDB