Get the App
SLTechnology News&Howtos  ›  Servers  › 

Creation and application of yum repositories on Centos 6 and 7-week 4

Shulou Source: shulou.com Published: 2022-06-03 01:54:00 11月13日 Update

Configuration and Application of yum on Centos 6 and 7

Yum is a front-end management tool for RPM packages. Under the premise that the dependencies of rpm packages have been built into a database, it can automatically find interdependent rpm packages and download interdependent rpm packages to the local from repository.

The principle is described in the following figure:

Environment:

There are three ways to configure yum. This article describes the following two methods:

Private network yum repository: local yum repository (that is, CD-ROM image comes with its own software as yum software repository)

Public network yum warehouse (implemented through http)

Method 1: use the ISO image of the virtual machine to create the yum repository:

However, it is found that three repositories have been enabled by default on Centos 7. See the following figure:

So you have to Disable the default repo name warehouse of the system, then create the following file local-DVD.repo, and use the yum command to enable the warehouse

It is found that there is an error in the configuration file. It should be baseurl= file:///media/cdrom/, and then the new yum source can be used.

6-install tree, ftp, lftp,telnet and other packages

Use the yum info tree command to check whether the software is available in the warehouse or type the command to test whether it has been installed before

[root@Franklin13 ~] # ftp

Bash: ftp: command not found...

[root@Franklin13 ~] # lftp

Bash: lftp: command not found...

[root@Franklin13 ~] # tree

Bash: tree: command not found...

-or use the yum history command to check whether the installation of the software is successful-

[root@Franklin13 yum.repos.d] # yum history

Loaded plugins: fastestmirror, langpacks

ID | Login user | Date and time | Action (s) | Altered

2 | root | 2019-08-29 21:57 | Install | 3

1 | System | 2018-12-23 22:21 | Install | 1308

Method 1: use a common url Yum source on the network, such as https://mirrors.tuna.tsinghua.edu.cn/centos/6/os/x86_64

Note: to use the URL that repodata points to

After creating the corresponding .repo file

[root@www yum.repos.d] # mv centos-6.5.repo centos-6.5.repo.bak

[root@www yum.repos.d] # vim tsinghua-edu.repo

[root@www yum.repos.d] #

[root@www yum.repos.d] # cat tsinghua-edu.repo

[tsinghua-url]

Name=CentOS-6.5

Baseurl= https://mirrors.tuna.tsinghua.edu.cn/centos/6/os/x86_64/

Gpgcheck=0

Enabled=1

# gpgkey= file:///mnt/RPM-GPG-KEY-CentOS-6

Then after yum clean all and yum makecache, you can use this network yum source to install the software.

The skills of using find and grep are attached.

1-find all files in the / var directory that do not belong to root, Ip, gdm

[root@Franklin13 ~] # grep Ip / etc/passwd

[root@Franklin13 ~] #

[root@Franklin13 ~] # grep gdm / etc/passwd

Gdm:x:42:42::/var/lib/gdm:/sbin/nologin

[root@Franklin13 ~] # find / var-not\ (- user root-o-user gdm\)-ls | head-5

70 0 drwxr-xr-x 2 abrt abrt 6 Dec 23 2018 / var/tmp/abrt

9158721 0 drwx- 2 rpc rpc 6 Aug 4 2017 / var/lib/rpcbind

1081397 0 drwxr-xr-x 4 colord colord 67 Dec 23 2018 / var/lib/colord

9158739 0 drwxr-xr-x 2 colord colord 6 Aug 6 2017 / var/lib/colord/icc

2434893 4-rw-r--r-- 1 colord colord 4096 Dec 23 2018 / var/lib/colord/mapping.db

[root@Franklin13 ~] #

-the full text is complete-

-

Tags: Warehouse software command file method configuration following figure network mirror application success use skill CD full text premise front end principle tool skill point to Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Shulou Tech Info Shulou Information Huawei MariaDB