Sunday, November 27, 2016

Red Hat Linux: YUM Package Administration


2.       Yellowdog Updater Modified.
3.       Auto dependency resolution.
4.       Ability to specify multiple package names.
5.       Only one repostiry will be active. So kindly ensure that respositry is updated.
6.       Repositry can be available either –
a.       Locally
b.       FTP server
c.       HTTP server

  
Createrepo:
1.       Creates sub-directories (repodata) ancillary files and various DB files to serve the packages to ‘yum’ clients.
2.       Ensure that ‘createrepo’ package is installed before running/creating local repo directory; running the command ‘createrepo’.
3.       ‘createrepo’ command queries all current packages (differ to each version) and generates a SQLite DB and anciallary files beneath: ‘repodata’ directory.
4.       Ensure the creation of a valid repo file for the locally.


Output:
 [root@TestServer yum.repos.d]# createrepo /etc/yum.repos.d/packages
(Note: create local repostiry using “createrepo” command for building the local yum reposity)



 Where /etc/yum.repos.d/packages is the path of the location where the packages are stored locally to the system.

Output:

[root@TestServer yum.repos.d]# yum list repo
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
packages                                                                                           | 1.3 kB     00:00 ...
packages/primary                                                                                   | 1.7 MB     00:00 ...
packages                                                                                                        3653/3653
Error: No matching Packages to list


 /etc/yum.conf:
1.       Configuration file.
2.       Specifies the yum log file.
Default log file: /var/log/yum.log
Provides the information about recently installed packages to the server/yum client.
3.       Defines where the repo directory has to be placed/located/created.

‘repos’ file:
[abcd]   header file.
name=ABCD   à   name of the repositry
                baseurl=  base url path, where the packages and repo directory is created.


# yum info  
1.       Provides the status of the packages installed.
2.       Provides the details about the specified package description, type, release, arch of the packages.
3.       Lists package meta data.


# yum search
Search whether the package is installed, available on the repository.


# yum history          Much used as the time of auditing.
1.       Lists out the usage/transaction
2.       What has been carried out, i.e, install/remove/re-install/upgrade
3.       Who performed the action.


# yum repolist         Lists out the created/available repository created.


# yum install
1.       To install packages once.
2.       Can also install multiple packages at a time (# yum install ).

Output:
[root@TestServer yum.repos.d]# yum install http*
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
Setting up Install Process
Package httpd-2.2.15-15.el6_2.1.x86_64 already installed and latest version
Package httpd-tools-2.2.15-15.el6_2.1.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package httpd-devel.x86_64 0:2.2.15-15.el6_2.1 will be installed
--> Processing Dependency: apr-util-devel for package: httpd-devel-2.2.15-15.el6_2.1.x86_64
--> Processing Dependency: apr-devel for package: httpd-devel-2.2.15-15.el6_2.1.x86_64
---> Package httpd-manual.noarch 0:2.2.15-15.el6_2.1 will be installed
--> Running transaction check
---> Package apr-devel.x86_64 0:1.3.9-3.el6_1.2 will be installed
---> Package apr-util-devel.x86_64 0:1.3.9-3.el6_0.1 will be installed
--> Processing Dependency: openldap-devel for package: apr-util-devel-1.3.9-3.el6_0.1.x86_64
--> Processing Dependency: expat-devel for package: apr-util-devel-1.3.9-3.el6_0.1.x86_64
--> Processing Dependency: db4-devel for package: apr-util-devel-1.3.9-3.el6_0.1.x86_64
--> Running transaction check
---> Package db4-devel.x86_64 0:4.7.25-17.el6 will be installed
--> Processing Dependency: db4-cxx = 4.7.25-17.el6 for package: db4-devel-4.7.25-17.el6.x86_64
--> Processing Dependency: libdb_cxx-4.7.so()(64bit) for package: db4-devel-4.7.25-17.el6.x86_64
---> Package expat-devel.x86_64 0:2.0.1-11.el6_2 will be installed
---> Package openldap-devel.x86_64 0:2.4.23-26.el6 will be installed
--> Processing Dependency: cyrus-sasl-devel >= 2.1 for package: openldap-devel-2.4.23-26.el6.x86_64
--> Running transaction check
---> Package cyrus-sasl-devel.x86_64 0:2.1.23-13.el6 will be installed
---> Package db4-cxx.x86_64 0:4.7.25-17.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===========================================================================Package                          Arch                   Version                           Repository                Size
===========================================================================Installing:
 httpd-devel                      x86_64                 2.2.15-15.el6_2.1                 packages                 147 k
 httpd-manual                     noarch                 2.2.15-15.el6_2.1                 packages                 781 k
Installing for dependencies:
 apr-devel                        x86_64                 1.3.9-3.el6_1.2                   packages                 176 k
 apr-util-devel                   x86_64                 1.3.9-3.el6_0.1                   packages                  69 k
 cyrus-sasl-devel                 x86_64                 2.1.23-13.el6                     packages                 302 k
 db4-cxx                          x86_64                 4.7.25-17.el6                     packages                 588 k
 db4-devel                        x86_64                 4.7.25-17.el6                     packages                 6.6 M
 expat-devel                      x86_64                 2.0.1-11.el6_2                    packages                 120 k
 openldap-devel                   x86_64                 2.4.23-26.el6                     packages                 1.1 M

Transaction Summary
===========================================================================
Install       9 Package(s)

Total download size: 9.8 M
Installed size: 37 M
Is this ok [y/N]:


Downloading Packages:
---------------------------------------------------------------------------
Total                                                                                      64 MB/s | 9.8 MB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : apr-devel-1.3.9-3.el6_1.2.x86_64                                                                       1/9
  Installing : expat-devel-2.0.1-11.el6_2.x86_64                                                                      2/9
  Installing : db4-cxx-4.7.25-17.el6.x86_64                                                                           3/9
  Installing : db4-devel-4.7.25-17.el6.x86_64                                                                         4/9
  Installing : cyrus-sasl-devel-2.1.23-13.el6.x86_64                                                                  5/9
  Installing : openldap-devel-2.4.23-26.el6.x86_64                                                                    6/9
  Installing : apr-util-devel-1.3.9-3.el6_0.1.x86_64                                                                  7/9
  Installing : httpd-devel-2.2.15-15.el6_2.1.x86_64                                                                   8/9
  Installing : httpd-manual-2.2.15-15.el6_2.1.noarch                                                                  9/9
Installed products updated.
  Verifying  : openldap-devel-2.4.23-26.el6.x86_64                                                                    1/9
  Verifying  : cyrus-sasl-devel-2.1.23-13.el6.x86_64                                                                  2/9
  Verifying  : apr-util-devel-1.3.9-3.el6_0.1.x86_64                                                                  3/9
  Verifying  : db4-cxx-4.7.25-17.el6.x86_64                                                                           4/9
  Verifying  : expat-devel-2.0.1-11.el6_2.x86_64                                                                      5/9
  Verifying  : db4-devel-4.7.25-17.el6.x86_64                                                                         6/9
  Verifying  : apr-devel-1.3.9-3.el6_1.2.x86_64                                                                       7/9
  Verifying  : httpd-manual-2.2.15-15.el6_2.1.noarch                                                                  8/9
  Verifying  : httpd-devel-2.2.15-15.el6_2.1.x86_64                                                                   9/9

Installed:
  httpd-devel.x86_64 0:2.2.15-15.el6_2.1                      httpd-manual.noarch 0:2.2.15-15.el6_2.1

Dependency Installed:
  apr-devel.x86_64 0:1.3.9-3.el6_1.2     apr-util-devel.x86_64 0:1.3.9-3.el6_0.1  cyrus-sasl-devel.x86_64 0:2.1.23-13.el6
  db4-cxx.x86_64 0:4.7.25-17.el6         db4-devel.x86_64 0:4.7.25-17.el6         expat-devel.x86_64 0:2.0.1-11.el6_2
  openldap-devel.x86_64 0:2.4.23-26.el6
Complete!




NOTE:

If the package is already installed/present/available version, and the installing version is same, then no action will be taken.




# yum reinstall
1.       To reinstall the package, when the package is already installed.
2.       The above command functions similar to # rpm –replace option.
3.       Imagine if the package is NOT installed it will NOT work. Means,  it will NOT install the package.


# yum –u reinstall
Where –
-y = yes  à to predefine yes, so that the package will be installed.


# yum erase  à  to erase/remove/delete the installed packages.


# yum –y erase
Where –
-y = yes à to predefine yes.
Will NOT check with the yum server/repository while removing/deleting the package.
It checks the local system, if the package is installed, it removes/deletes it.

# yum deplist
Displays the dependencies and their providers.

# yum localinstall
1.       To install packages from the local file system.
2.       While locally installing the package, complete name of the package along with the version has to be specified.


2 comments: