Configure the Yum Server in Centos7/RHEL7/Fedora22

9.) Clean the cache and check whether yum server is responding or not.

To clear the cache and list of the repository as we have done earlier in server configuration.

[root@client1 etc]#yum clean all; yum repolist all
Loaded plugins: fastestmirror
Cleaning repos: Centos7
Cleaning up everything
Loaded plugins: fastestmirror
Centos7                                                                                                                    | 3.6 kB  00:00:00     
(1/2): Centos7/group_gz                                                                                                    | 155 kB  00:00:00     
(2/2): Centos7/primary_db                                                                                                  | 5.3 MB  00:00:00     
Determining fastest mirrors
repo id                         repo name                      status
Centos7                         Centos7 repository             enabled: 9,007
repolist: 9,007
[root@client1 etc]# 

#yum list To list all the packages in repository.

[root@client1 etc]# yum list all
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Installed Packages
NetworkManager.x86_64                  1:1.0.6-27.el7              @anaconda
NetworkManager-libnm.x86_64            1:1.0.6-27.el7              @anaconda
NetworkManager-tui.x86_64              1:1.0.6-27.el7              @anaconda
NetworkManager-wifi.x86_64             1:1.0.6-27.el7              @anaconda
acl.x86_64                             2.2.51-12.el7               @anaconda
aic94xx-firmware.noarch                30-6.el7                    @anaconda

If your output is like this then you have successfully configured a yum client.!!!

Working With Yum Command ..

  • # yum help This will display usage information.
[root@client1 ~]# yum help 
Loaded plugins: fastestmirror
Usage: yum [options] COMMAND

List of Commands:
check          Check for problems in the rpmdb
check-update   Check for available package updates
clean          Remove cached data
deplist        List a package's dependencies
  • # yum search <keyword> This will lists the packages by keywords.
[root@client1 ~]# yum search net-tool
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
======================== N/S matched: net-tool =======================
net-tools.x86_64 : Basic networking tools

Name and summary matches only, use "search all" for everything.
[root@client1 ~]#
  • #yum install <package name> and yum remove <package name> This will install and remove the software.
[root@client1 ~]# ifconfig
-bash: ifconfig: command not found
[root@client1 ~]# yum install net-tools
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package net-tools.x86_64 0:2.0-0.17.20131004git.el7 will be installed
--> Finished Dependency Resolution
.....
Transaction Summary
=================================================
Install  1 Package

Total download size: 304 k
Installed size: 917 k
Is this ok [y/d/N]: y

[root@client1 ~]# ifconfig
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.2  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::a00:27ff:fe9d:5e61  prefixlen 64  scopeid 0x20<link>
        ether 08:00:27:9d:5e:61  txqueuelen 1000  (Ethernet)
        RX packets 10063  bytes 12479079 (11.9 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1436  bytes 249583 (243.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 188  bytes 14552 (14.2 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 188  bytes 14552 (14.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@client1 ~]#
  • #yum info <package name> This will gives the detailed information of the package.
[root@client1 ~]# yum info net-tools
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Installed Packages
Name        : net-tools
Arch        : x86_64
Version     : 2.0
Release     : 0.17.20131004git.el7
Size        : 917 k
Repo        : installed
From repo   : Centos7
Summary     : Basic networking tools
URL         : http://sourceforge.net/projects/net-tools/
License     : GPLv2+
Description : The net-tools package contains basic networking tools,
            : including ifconfig, netstat, route, and others.
            : Most of them are obsolete. For replacement check iproute package.
[root@client1 ~]#
  • #yum provides <pathname> This will display packages that match the pathname specified.
[root@client1 ~]# yum provides /etc/yum.conf
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
yum-3.4.3-132.el7.centos.0.1.noarch : RPM package installer/updater/manager
Repo        : Centos7
Matched from:
Filename    : /etc/yum.conf

yum-3.4.3-132.el7.centos.0.1.noarch : RPM package installer/updater/manager
Repo        : @anaconda
Matched from:
Filename    : /etc/yum.conf
[root@client1 ~]#
  • # yum group list This will show the group list.
[root@client1 ~]# yum group list
Loaded plugins: fastestmirror
There is no installed groups file.
Maybe run: yum groups mark convert (see man yum)
Loading mirror speeds from cached hostfile
Available Environment Groups:
   Minimal Install
   Compute Node
   Infrastructure Server
   File and Print Server
   Basic Web Server
   Virtualization Host
   Server with GUI
   GNOME Desktop
   KDE Plasma Workspaces
   Development and Creative Workstation
Available Groups:
   Compatibility Libraries
   Console Internet Tools
   Development Tools
   Graphical Administration Tools
   Legacy UNIX Compatibility
   Scientific Support
   Security Tools
   Smart Card Support
   System Administration Tools
   System Management
Done
[root@client1 ~]#
  • # yum group install <group name> This will install a group.
[root@client1 ~]# yum group install "Security Tools"
Loaded plugins: fastestmirror
There is no installed groups file.
Maybe run: yum groups mark convert (see man yum)
Loading mirror speeds from cached hostfile
.....
Transaction Summary
================================================
Install  1 Package (+4 Dependent packages)

Total download size: 3.9 M
Installed size: 60 M
Is this ok [y/d/N]:y
  • #yum history This will show the summary of install and remove transactions.
[root@client1 ~]# yum history
Loaded plugins: fastestmirror
ID     | Login us             | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------
     2 | root <root>          | 2016-09-17 11:18 | Install        |    1  <
     1 | System <unset>       | 2016-09-17 10:11 | Install        |  285 > 
history list
[root@client1 ~]#
  • #yum –disablerepo=”*” –enablerepo=<repository name> install <package name>
[root@client1 ~]# yum --disablerepo="*" --enablerepo=Centos7 install bind
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package bind.x86_64 32:9.9.4-29.el7 will be installed

......
Transaction Summary
================================================
Install  1 Package (+1 Dependent package)

Total download size: 2.8 M
Installed size: 6.9 M
Is this ok [y/d/N]: y

This will disable all repositories accept Centos7 repository !!!!

Read also  PART1: Redhat Package Manager (RPM)

Leave a Reply

Be the First to Comment!

Notify of
avatar
wpDiscuz