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

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.

 [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.


[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

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 ).

[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: 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
 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

  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


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.

Thursday, January 21, 2016

SMI and EFI disk label on Solaris

SMI:     SMI – Sun Microsystem Inc Label

1.       Typically, SPARC based Solaris based file system.
   SPARC VTOC is often called as SMI VTOC.
2.       Can define 8 partitions (0-7).
3.       Provides support to < 1Tb.
4.       Occupies first sector of a disk in SPARC arch systems.
5.       Must be used for SPARC, X86/X64 based boot disks.
6.       Maintains 2 partition tables on each disk on X86/X64.
(a)    First sector : Contains fixed disk (fdisk) partition table
(b)   Second sector: Holds the partition table that defines slices in the Solaris ‘fdisk’ partition.

EFI:   EFI – Extensible Firmware interface

1.       Can define up to 10 disk partitions (0-9).
2.       Supports > 1 Tb on 64-bit Solaris kernel.
3.       Compatible with UFS and can create a UFS that is larger than 1Tb.
4.       Do not currently boot from disk that use EFI label on Solaris 10.
Solaris 11 support boot disk with EFI (GPT) label.
SPARC systems require an updated OBP to boot from an EFI (GPT) labeled disk.
X86 systems that supports GRUB 2 boots from an EFI (GPT) labeled disk.
5.       Provide usable slices 0-6, where slice 2 is just another slice.
6.       Slices cannot overlap with the primary or backup labels or with other partition.
7.       No cylinder, head or sector information is stored in the EFI label.
8.       Sizes are reported in blocks.
9.       EFI labeled information that is stored in alternate cylinder areas (last 2 disk       cylinder) is stored in slice 8.
10.   On EFI, slice 2 can be resized.
11.   EFI label size is usually 34 sectors, so partitions start at sector 34. This feature   means that no partition can start at sector 0.
12.   EFI does not support  -
At ‘format’ utility -
(a)    save’ is not supported. Because EFI labeled disks do not need a   format.dat file entry.
(b)   backup’ is not applicable. Because the disk driver finds the primary        label and write it back to the disk.