Cross Column

Showing posts with label yum. Show all posts
Showing posts with label yum. Show all posts

Sunday, June 5, 2016

How to Enable Software Collections (SCL) on RHEL

Package is the basic unit used for the distribution, management and update of software customized for a Linux system.  Collections of packages stored in different software repositories (e.g., YUM Repositories) can be accessed locally or over a network connection.  Metadata are combined with packages themselves to determine (and resolve, if possible) dependencies among the packages.

In this article, we will try to learn the following entities/concepts in more details:
  • RPM 
    • May refers to the .rpm file format, files in this format, software packaged in such files, and the package manager itself
    • RPM's dependency processing is based on knowing what capabilities are provided by a package and what capabilities a package requires.
    • It does automatically determine what shared libraries a package requires
  • YUM 
    • One of the several front-ends to RPM, which ease the process of obtaining and installing RPMs from repositories and help in resolving their dependencies.
    • YUM Repository
      • YUM repository metatadata is structured as a series of XML files to organize packages and their associated package groups for installation.
      • Need to setup Apache, nginx, or some other web server and point it at the base directory of the repository to make it available
  • Red Hat Software Collections
    • Is a prescribed set of content intended for use in Red Hat Enterprise Linux production environments

RPM


The RPM Package Manager (RPM) is a package management system that
  • Facilitates the distribution, management and update of software customized for a Linux system
    • Works with standard package management tools (e.g., Yum or PackageKit) to install, reinstall, remove, upgrade and verify RPM packages
  • Provides metadata to describe packages, installation instructions, and so on
    • Each RPM package includes metadata that describes the package's components, version, release, size, project URL, installation instructions, and so on
  • Separates source and binary packages
    • In source packages, you have the pristine sources along with any patches that were used, plus complete build instructions.
  • Allows you to use the database of installed packages to query and verify packages
  • Allows you to add your package to a Yum repository
  • Allows you to Digitally sign your packages (e.g., using a GPG signing key)

Red Hat Software Collections


Red Hat Software Collections is a prescribed set of content intended for use in Red Hat Enterprise Linux production environments. Through Red Hat Software Collections, you can choose the runtime versions best suited for your projects, preserve application stability, and deploy your applications with confidence.

Software Collections Functionality


Software collections functionality (from hereafter, we will refer it simply as "Software Collections")—not to be confused with Red Hat Software Collections—has been available in earlier Red Hat Enterprise Linux distributions. Software collections provides a structural definition, independent of the operating system, for applications or tools.

With Software Collections, you can build and concurrently install multiple versions of the same software components on your system. Software Collections have no impact on the system versions of the packages installed by any of the conventional RPM package management utilities.

To summarize, Software Collections have the following characteristics:
  • Do not overwrite system files
  • Are designed to avoid conflicts with system files
    • Software Collections make use of a special file system hierarchy to avoid possible conflicts between a single Software Collection and the base system installation.
  • Require no changes to the RPM package manager
  • Need only minor changes to the spec file
    • To convert a conventional package to a single Software Collection, you only need to make minor changes to the package spec file.
  • Allow you to build a conventional package and a Software Collection package with a single spec file
  • Uniquely name all included packages
  • Do not conflict with updated packages
  • Can depend on other Software Collections 
    • Because one Software Collection can depend on another, you can define multiple levels of dependencies.


Enabling and Building Software Collections


To enable support for Software Collections on your system so that you can enable and build Software Collections, you need to have installed the following packages:

References

  1. Software Collections Guide (Redhat)
  2. 20 Linux YUM (Yellowdog Updater, Modified) Commands for Package Management
  3. PackageKit
  4. Red Hat Enterprise Linux 6 Deployment Guide 
  5. Red Hat Enterprise Linux 5 Deployment Guide.
  6. Learn Linux, 101: RPM and YUM package management
    • Yum allows automatic updates, package and dependency management, on RPM-based distributions.
  7. Creating a Local Yum Repository Using an ISO Image
    • Yum works with software repositories (collections of packages), which can be accessed locally or over a network connection.
  8. Configuring Yum and Yum Repositories (important)
  9. Converting a Conventional Spec File
  10. HOWTO: GPG sign and verify RPM packages and yum repositories
  11. The Software Collections (SCL) Repository (CentOS)
  12. Red Hat will provide PHP 5.4 for RHEL-6

Tuesday, December 1, 2015

Cloud: Find Out More about Your VM

If you can access a VM in a cloud and would like to find out more about it, here are what you can do on a Linux system.

lscpu


lscpu is a useful Linux command to uncover CPU architecture information.  It can print out the following VM information:
  • Hypervisor vendor[1]
  • Virtualization type 
  • Cpu virtualization extension[2]
Using two different servers (see below) as examples, we have found that:
  • Server #1
    • This is a Xen guest fully virtualized (HVM).
  • Server #2
    • This is a physical server.  However, it does have the virtualization extensions in hardware.
      • Another way to verify it is to:[3]
        • cat /proc/cpuinfo | grep vmx
Server #1

$ lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                4
On-line CPU(s) list:   0-3
Thread(s) per core:    4
Core(s) per socket:    1
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 63
Stepping:              2
CPU MHz:               2294.924
BogoMIPS:              4589.84
Hypervisor vendor:     Xen
Virtualization type:   full

L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              46080K
NUMA node0 CPU(s):     0-3

Server #2


$ lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                16
On-line CPU(s) list:   0-15
Thread(s) per core:    2
Core(s) per socket:    4
CPU socket(s):         2
NUMA node(s):          2
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 26
Stepping:              5
CPU MHz:               1600.000
BogoMIPS:              4521.27
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              8192K
NUMA node0 CPU(s):     0-3,8-11
NUMA node1 CPU(s):     4-7,12-15


virt-what


virt-what is another useful Linux command to detect if we are running in a virtual machine.  For example, Server #1 is a Xen guest fully virtualized as shown below:[4]

$ sudo virt-what
xen
xen-hvm

If virt-what is not installed in the system, you can install it using yum (an interactive, rpm based, package manager).

To find out which package "virt-what" is in, type:

$ yum whatprovides "*/virt-what"
Loaded plugins: aliases, changelog, downloadonly, kabi, presto, refresh-
              : packagekit, security, tmprepo, verify, versionlock
Loading support for kernel ABI
virt-what-1.11-1.1.el6.x86_64 : Detect if we are running in a virtual machine
Repo        : installed
Matched from:
Filename    : /usr/sbin/virt-what

To install the matched package, type (note that "-1.11-1.1.el6" in the middle of the full name has been removed):

# yum install virt-what.x86_64
Loaded plugins: aliases, changelog, downloadonly, kabi, presto, refresh-
              : packagekit, security, tmprepo, verify, versionlock
Loading support for kernel ABI
Setting up Install Process
Nothing to do


Finally, If nothing is printed and the "virt-what" exits with code 0 (or no error) as in Server #2, then it can mean either that the program is running on bare-metal or the program is running inside a type of virtual machine which we don't know about or cannot detect.

References

  1. How to check which hypervisor is used from my VM?
  2. Linux: Find Out If CPU Support Intel VT and AMD-V Virtualization Support
      • Hardware virtualization support:
        • vmx — Intel VT-x, virtualization support enabled in BIOS.
        • svm — AMD SVM,virtualization enabled in BIOS.
    1. Enabling Intel VT and AMD-V virtualization hardware extensions in BIOS
    2. Hardware-assisted virtualizion (HVM)
      • HVM support requires special CPU extensions - VT-x for Intel processors and AMD-V for AMD based machines. 
    3. Oracle Process Cloud Service 16.2.1 Release
    4. All Cloud-related articles on Xml and More


    © Travel for Life Guide. All Rights Reserved.

    Analytical Insights on Health, Culture, and Security.