Showing posts with label Yum configure in Linux. Show all posts
Showing posts with label Yum configure in Linux. Show all posts

Wednesday 27 January 2016

Installing and Updating Software/Package after Configure yum in RHEL 7

RPM (Redhat Package Manager) package files  are  named using a  combination of the package name-version -release . architecture

[root@rhel7 Packages]# ls -lrt httpd*
-r--r--r--.  75 root root 1211944 Apr  1  2014 httpd-2.4.6-17.el7.x86_64.rpm

•  NAME is one or more words describing the contents (httpd). 
•  VERSION is the version number of the original software (2.4.6). 
•  RELEASE  is  the re lease number of  the package based on that version, and  is  set by the 
packager, who might not be the original software developer (17.e l7). 
•  ARCH  is the processor architecture the package was  compiled  to run on.  "noarch" indicates 
that  this package's contents are  not architecture-specific (x86_64). 

yum is a  powerful command-line tool that can be used to more  flexibly manage (install, update, remove,  and query) software packages. Official  Red Hat packages  are  normally  downloaded from Red Hat's content distribution network. Registering a  system to the subscription management service automatically configures access  to software repositories based on the attached subscriptions. 

Step 1: Create a directory to collect the packages into that directory

[root@rhel7 Packages]# mkdir /yum
[root@rhel7 Packages]# cd /run/media/root/RHEL-7.0 Server.x86_64/Packages   [go to DVD]
[root@rhel7 Packages]# cp -r * /yum            [copy all packages including sub directory to /yum ]

Step 2: Create a repository 

[root@rhel7 Packages]# createrepo /yum

Step 3: Add a .repo file into /etc/yum.repos.d directory

To make this repository known to yum you need to add a .repo file to your yum configuration. On the systems where you want to use this repo you need to make a new file in /etc/yum.repos.d/. The file can be named anything but the extension on the file has to be .repo. Let's call this one 'sirat.repo'.

[root@rhel7 yum.repos.d]# vim sirat.repo
[sbl]
name=Standard Bank Limited
baseurl=file:///yum
gpgchek=0
enabled=1

Note: there are 3 slashes (/) following the file:, not 2. That is correct.
If you access the file via an http or https server you would use something like:
baseurl = http://servername/my/repo

Step 4: Now check that yum repository configured or not ??

[root@rhel7 yum.repos.d]# yum repolist
Loaded plugins: langpacks, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
sbl                                                                                                                  | 2.9 kB  00:00:00
sbl/primary_db                                                                                              | 3.4 MB  00:00:01
repo id                                   repo name                                                                   status
sbl                                         Standard Bank Limited                                               4,305
repolist: 4,305
[root@rhel7 yum.repos.d]#

Step 5: Install new packages

[root@rhel7 yum.repos.d]# yum install httpd
Loaded plugins: langpacks, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.4.6-17.el7 will be installed
--> Processing Dependency: httpd-tools = 2.4.6-17.el7 for package: httpd-2.4.6-17.el7.x86_64
--> Running transaction check
---> Package httpd-tools.x86_64 0:2.4.6-17.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved
.
.
.
.

Now check the package installed or not??

[root@rhel7 yum.repos.d]# yum search httpd
Loaded plugins: langpacks, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
========================================================================== N/S matched: httpd ==========================================================================
httpd.x86_64 : Apache HTTP Server
httpd-devel.x86_64 : Development interfaces for the Apache HTTP server
httpd-manual.noarch : Documentation for the Apache HTTP server
httpd-tools.x86_64 : Tools for use with the Apache HTTP Server
libmicrohttpd.i686 : Lightweight library for embedding a webserver in applications
libmicrohttpd.x86_64 : Lightweight library for embedding a webserver in applications
mod_dav_svn.x86_64 : Apache httpd module for Subversion server

  Name and summary matches only, use "search all" for everything.
[root@rhel7 yum.repos.d]#

Remove Installed Package

[root@rhel7 yum.repos.d]# yum remove httpd



Displays  installed  and available packages. 

[root@rhel7 Packages]# yum list '*http*'
Loaded plugins: langpacks, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
libmicrohttpd.x86_64                            0.9.33-2.el7                                                           @anaconda/7.0
perl-HTTP-Cookies.noarch                    6.01-5.el7                                                             @anaconda/7.0
perl-HTTP-Daemon.noarch                    6.01-5.el7                                                             @anaconda/7.0
perl-HTTP-Date.noarch                         6.02-8.el7                                                             @anaconda/7.0
perl-HTTP-Message.noarch                   6.06-6.el7                                                             @anaconda/7.0
perl-HTTP-Negotiate.noarch                  6.01-5.el7                                                             @anaconda/7.0
perl-HTTP-Tiny.noarch                          0.033-3.el7                                                            @anaconda/7.0
perl-Net-HTTP.noarch                           6.06-2.el7                                                             @anaconda/7.0




Tuesday 26 May 2015

Step by Step : How to configure YUM Server in RHEL6


Make directories yum/rhel6/repodata in the folder which you have chosen for repository.

For FTP server it would be /var/ftp/pub folder

[root@dpdcdb repodata]# mkdir -p /var/ftp/pub/yum/rhel6/repodata/

Copy all RPM from RHEL 6 DVD located in Packages folder to [root@dpdcdb repodata]#

[root@dpdcdb repodata]# cp -arf /media/RHEL_6.2\ x86_64\ Disc\ 1/Packages/*.rpm /var/ftp/pub/yum/rhel6/repodata/


root@dpdcdb repodata]# cp /media/RHEL_6.2\ x86_64\ Disc\ 1/repodata/*comps*.xml /var/ftp/pub/yum/rhel6/repodata/comps.xml
[root@dpdcdb repodata]#

[root@dpdcdb RHEL_6.2 x86_64 Disc 1]# cd Server/
[root@dpdcdb Server]# rpm -qa deltarpm
[root@dpdcdb Server]# rpm -qa python-deltarpm
[root@dpdcdb Server]# rpm -qa createrepo
[root@dpdcdb Server]# pwd
/media/RHEL_6.2 x86_64 Disc 1/Server
[root@dpdcdb Server]#
[root@dpdcdb Server]# cd /var/ftp/pub/yum/rhel6/repodata/
[root@dpdcdb repodata]# rpm -ivh deltarpm*
warning: deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...                ########################################### [100%]
   1:deltarpm               ########################################### [100%]
[root@dpdcdb repodata]#
[root@dpdcdb repodata]# rpm -ivh python-deltarpm*
warning: python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...                ########################################### [100%]
   1:python-deltarpm        ########################################### [100%]
[root@dpdcdb repodata]#
[root@dpdcdb repodata]# rpm -ivh createrepo*
warning: createrepo-0.9.8-4.el6.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...                ########################################### [100%]
   1:createrepo             ########################################### [100%]
[root@dpdcdb repodata]#

[root@dpdcdb repodata]# rpm -qa createrepo
createrepo-0.9.8-4.el6.noarch
[root@dpdcdb repodata]# rpm -qa python-deltarpm
python-deltarpm-3.5-0.5.20090913git.el6.x86_64
[root@dpdcdb repodata]# rpm -qa deltarpm
deltarpm-3.5-0.5.20090913git.el6.x86_64
[root@dpdcdb repodata]#

Change directory to /var/ftp/pub/yum/rhel6

[root@dpdcdb repodata]# cd ../
[root@dpdcdb rhel6]# ll
total 248
drwxr-xr-x. 2 root root 253952 May 26 15:50 repodata
[root@dpdcdb rhel6]#

Generate local repository files from repodata folder [ repodata folder :- which contain all RPM copied from RHEL6 DVD] to current folder [rhel6]

[root@dpdcdb rhel6]# createrepo -g repodata/comps
comps-extras-17.8-1.el6.noarch.rpm  comps.xml

[root@dpdcdb rhel6]# createrepo -g repodata/comps.xml .
 979/3596 - repodata/oxygen-icon-theme-4.3.4-2.el6.noarch.rpm
iso-8859-1 encoding on Ville Skyttä - 2.8.2-2

3596/3596 - repodata/qpid-cpp-client-0.12-6.el6.i686.rpm
Saving Primary metadata
Saving file lists metadata
Saving other metadata
[root@dpdcdb rhel6]#


[root@dpdcdb rhel6]# vim /etc/yum.repos.d/server.repo

[server]
name=rhel6
baseurl=file:///var/ftp/pub/yum/rhel6
enabled=1
gpgcheck=0


[root@dpdcdb rhel6]# vim /etc/yum.repos.d/server.repo
[root@dpdcdb rhel6]# yum clean all
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
Cleaning repos: InstallMedia server
Cleaning up Everything
[root@dpdcdb rhel6]#


[root@dpdcdb rhel6]# yum makechace
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
No such command: makechace. Please use /usr/bin/yum --help
[root@dpdcdb rhel6]#

Monday 4 August 2014

Configure Yum repository in Linux

Create a folder in the server.

mkdir -p /var/ftp/pub/Server

Copy all RPMs from Linux DVD to Here.

Create the base repository headers:

cd /var/ftp/pub/Server/
rpm –ivh createrepo*

Paste database file to /tmp location

cd repodata/
cp comps* /tmp/comps.xml

Create repository

createrepo –g /tmp/comps.xml /var/ftp/pub/Server

Add your local repo to the list

cd /etc/yum.repos.d/
rm *
touch server.repo

Edit the File server.repo:

[server]
name= My Local Repo
baseurl=file:///var/ftp/pub/Server
enabled=1
gpgcheck=0