skip to main | skip to sidebar

Linux Tutorial for Beginners

Pages

  • Home
 
  • RSS
  • Twitter
Showing posts with label Yum. Show all posts
Showing posts with label Yum. Show all posts
Monday, January 23, 2012

Technical Definition of RPM

Posted by Raju Gupta at 9:00 AM – 0 comments
 

Redhat Package Manager (RPM)

  • What is an RPM?
RPM is also called as the Red Hat Package Management system. This is an freely published set of specifications and tools to allow Linux and Unix vendors to package their software in a way that is amenable to automated installation upgrade, removable and administration. Although it has Red Hat's name in it —- it has been adopted by most of the major Linux distribution maintainers.
  • Basic Concepts of RPM
The RPM Package Manager (RPM) is a powerful command line driven package management system capable of installing, uninstalling, verifying, querying, and updating computer software packages. Each software package consists of an archive of files along with information about the package like its version, a description, and the like.
An RPM package will be of the form
<name>-<version>-<release>.<arch>.rpm

  • Different Modes of Usage
Installation:
In the simplest form to install a package (foo version 1.2 in this example), you can use commands like:
rpm -i foo-1.2.rpm
rpm –ivh foo-1.2.rpm
Upgrading:
Suppose you have the package foo-1.2 installed. If you have the newer version of that package (say foo-1.3), then you can upgrade the package. This is how its done.
rpm -U foo-1.3.rpm
rpm –Uvh foo-e.1.2.rpm
Removing:
Suppose you have the package foo-1.2 installed. If you have this package.
rpm -e foo-1.3.rpm
Quering:
You can query a list of files from an installed package with
rpm -ql $SOME_INSTALLED_PACKAGE
list all of the packages that you have installed on the whole system
rpm -qa
You can also find out which package a given file "belongs to" with a command like:
rpm -qf /some/file/that/was/installed/by/something
You can search the installed package
rpm -qa | grep –i installed package name
To roll back the RPM transaction, use the —rollback option followed by the rollback target. If an hour after upgrading foo, you decide you don't want it, you could type:
rpm -Uvh --rollback '2 hours ago'
rpm -Uhv –-rollback ‘9:00 am’
rpm -Uhv –-rollback ‘december 25′
[ Read More ]
Read more...
Sunday, January 22, 2012

yum install

Posted by Raju Gupta at 11:28 PM – 0 comments
 

Yellowdog updater modified (YUM)

Yum is a yellowdog updater modified . Yum is an automatic updater and package installer/remover for rpm systems. It automatically computes dependencies and figures out what things should occur to install packages. It makes it easier to maintain groups of machines without having to manually update each one using rpm. Yum has a plugin interface for adding simple features. Yum can also be used from other python programs via its module inteface. It was developed by Duke University to improve the installation of RPMs. yum searches numerous repositories for packages and their dependencies so they may be installed together in an effort to alleviate dependency issues. Red Hat Enterprise Linux 5.2 uses yum to fetch packages and install RPMs

  • Setting Up a yum Repository

Server end

  1. Install the createrepo package.
  2. Copy all the packages into one directory.
  3. Run createrepo on that directory.This will create the necessary metadata for your yum repository.
Client end
Open the yum repository file in client end.
#vim /etc/yum.repos.d/rhel-debuginfo.repo
Edit this file & set the baseurl. Baseurl is yum server repodata patha & gpgcheck=0.
Yum Commands
yum commands are typically run as yum <command> <package name/s>. By default, yum will automatically attempt to check all configured repositories to resolve all package dependencies during an installation/upgrade.
The following is a list of the most commonly-used yum commands. For a complete list of available yum commands, refer to man yum.
yum install <package name/s>
Used to install the latest version of a package or group of packages. If no package matches the specified package name(s), they are assumed to be a shell glob, and any matches are then installed.
yum update <package name/s>
Used to update the specified packages to the latest available version. If no package name/s are specified, then yum will attempt to update all installed packages.
If the --obsoletes option is used (i.e. yum --obsoletes <package name/s>, yum will process obsolete packages. As such, packages that are obsoleted accross updates will be removed and replaced accordingly.
yum check-update
This command allows you to determine whether any updates are available for your installed packages. yum returns a list of all package updates from all repositories if any are available.
yum remove <package name/s>
Used to remove specified packages, along with any other packages dependent on the packages being removed.
Yum provides <file name>
Used to determine which packages provide a specific file or feature.
yum search <keyword>
This command is used to find any packages containing the specified keyword in the description, summary, packager and package name fields of RPMs in all repositories.
yum localinstall <absolute path to package name/s>
Used when using yum to install a package located locally in the machine.
  • yum Options
yum options are typically stated before specific yum commands; i.e. yum <options> <command> <package name/s>. Most of these options can be set as default using the configuration file.
The following is a list of the most commonly-used yum options. For a complete list of available yum options, refer to man yum.
-y Answer "yes" to every question in the transaction.
-t Sets yum to be "tolerant" of errors with regard to packages specified in the transaction. For example, if you run yum update package1 package2 and package2 is already installed, yum will continue to install package1.
  • Configuring yum
By default, yum is configured through /etc/yum.conf. The following is an example of a typical /etc/yum.conf file:
[main]
cachedir=/var/cache/yum
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
distroverpkg=redhat-release
tolerant=1
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
metadata_expire=1800
[myrepo]
name=RHEL 5 $releasever - $basearch
baseurl=http://local/path/to/yum/repository/
enabled=1
A typical /etc/yum.conf file is made up of two types of sections: a [main] section, and a repository section. There can only be one [main] section, but you can specify multiple repositories in a single /etc/yum.conf.
[main] Options
The [main] section is mandatory, and there must only be one. For a complete list of options you can use in the [main] section, refer to man yum.conf.
The following is a list of the most commonly-used options in the [main] section.
Cachedir
This option specifies the directory where yum should store its cache and database files. By default, the cache directory of yum is /var/cache/yum.
keepcache=<1 or 0>
Setting keepcache=1 instructs yum to keep the cache of headers and packages after a successful installation. keepcache=1 is the default.
reposdir=<absolute path to directory of .repo files>
This option allows you to specify a directory where .repo files are located. .repo files contain repository information.
If reposdir is not set, yum uses the default directory /etc/yum.repos.d.
gpgcheck=<1 or 0>
This disables/enables GPG signature checking on packages on all repositories, including local package installation. The default is gpgcheck=0, which disables GPG checking.
If this option is set in the [main] section of the /etc/yum.conf file, it sets the GPG checking rule for all repositories. However, you can also set this on individual repositories instead; i.e., you can enable GPG checking on one repository while disabling it on another.
assumeyes=<1 or 0>
This determines whether or not yum should prompt for confirmation of critical actions. The default if assumeyes=0, which means yum will prompt you for confirmation.
If assumeyes=1 is set, yum behaves in the same way that the command line option -y does.
tolerant=<1 or 0>
When enabled (tolerant=1), yum will be tolerant of errors on the command line with regard to packages. This is similar to the yum command line option -t.

The default value for this is tolerant=0 (not tolerant).

  • Repository Options

The [repository] section of the /etc/yum.conf file contains information about a repository yum can use to find packages during package installation, updating and dependency resolution. A repository entry takes the following form:
You can also specify repository information in a separate .repo files (for example, rhel5.repo). The format of repository information placed in .repo files is identical with the [repository] of /etc/yum.conf.
.repo files are typically placed in /etc/yum.repos.d, unless you specify a different repository path in the [main] section of /etc/yum.conf with reposdir=. .repo files and the /etc/yum.conf file can contain multiple repository entries.
Each repository entry consists of the following mandatory parts:
[repository ID]
The repository ID is a unique, one-word string that serves as a repository identifier.
name=repository name
This is a human-readable string describing the repository.
[ Read More ]
Read more...
Older Posts
Subscribe to: Posts (Atom)

Our Blogs

  • Java Programs with Output
  • C Programming Tutorial
  • Language Tutorial
  • Android Development Tutorial
  • Web Development Tutorial
  • Popular
  • Recent
  • Archives

Popular Posts

  • Apache Configuration File Security Option
    you’ll examine the security options available in the main Apache configuration file, httpd.conf. That file can be modified to secure the e...
  • AWS VPC Overview
    What is VPC ? A virtual private cloud (VPC) is a virtual network dedicated to your AWS account. It is logically isolated from other vir...
  • Advantages & Disadvantages of Kerberos
    Advantages of Kerberos Most conventional network services use password-based authentication schemes. Such schemes require a user to au...
  • SSH login without password
    The following steps can be used to ssh from one system to another without specifying a password: 1. On the client run the following com...
  • Apache Installation and Configuration through source code
    In this example we extract the source code to a directory under /usr/local/src/ cp httpd-2.0.46.tar.gz /usr/local/src cd /usr/local/src...
  • How to automatically chroot jail selected ssh user logins
    1. Creating basic chroot environment First we need to create a simple chroot environment. Our chroot environment will consist of a bash she...
  • How to Create the Kerberos database
    Create the database with the following command.  [root@coma ~] kdb5_util create -s This will prompt you for a password. You will ...
  • Kerberos and PAM
    Kerberos-aware services do not currently make use of Pluggable Authentication Modules (PAM) — these services bypass PAM completely. However...
  • Apache and SELinux File Labels
    Take a look at the SELinux settings associated with Apache. To review, SELinux settings, as they relate to a service, mostly fall into tw...
  • History of MINIX 3
    MINIX has a long history. It goes back to 1987 when the first edition of the book Operating Systems: Design and Implementation by Andrew S...
Powered by Blogger.

Archives

  • ▼  2014 (1)
    • ▼  May (1)
      • AWS VPC Overview
  • ►  2013 (4)
    • ►  February (4)
  • ►  2012 (89)
    • ►  November (1)
    • ►  March (4)
    • ►  February (36)
    • ►  January (48)
 

Followers

Labels

  • Apache (8)
  • aws (1)
  • Bridge (1)
  • cloud computing (1)
  • Configuration (1)
  • dhcp server (7)
  • DNS (8)
  • File system (11)
  • Fping (1)
  • Iptable basic (3)
  • KDC slave server (1)
  • Kerberos (14)
  • kerberos configuration (5)
  • kerberos database (1)
  • LaTeX (1)
  • Ldap basic (2)
  • Linux aliases (1)
  • Linux Commands (4)
  • Linux History (2)
  • Linux Installation (3)
  • Linux kernel (3)
  • Linux shell (2)
  • Linux software (2)
  • Lvm (1)
  • Mail Server (3)
  • Network Script (1)
  • PHP (1)
  • Raid (6)
  • SELinux (1)
  • Sendmail (3)
  • ssh (2)
  • Tcpdump example (1)
  • Virtualization (5)
  • Webmin (1)
  • Yum (2)
 
 
© 2011 Linux Tutorial for Beginners | Designs by Web2feel & Fab Themes

Bloggerized by DheTemplate.com - Main Blogger