Create Local Repository for Linux rpm

How To Make Local Repository for Linux

We are facing problem while installing rpm to Linux server, it is keep asking there are dependent rpm may be 1 or more then that. To resolve it, we can create local repository for Linux to install with yum all dependent rpm automatically.

1-Install createrepo rpm 

[root@app1 dump]# rpm -Uvh createrepo-0.4.4-1.noarch.rpm

2- Add the path info to yum repo file as below

[root@app1 dump]# vi /etc/yum.repos.d/local.repo
[local]
name=oracle linux4u6
baseurl=file:///u01/dump/RPM4u6   # this means all rpm are in /u01/dump/RPM4u6 folder
gpgcheck=0
enabled=1

3- To check How many repo files are available
[root@app1 dump]# cd /etc/yum.repos.d/
[root@app1 yum.repos.d]# ls
local.repo ULN-Base.repo

4- Rename the deault repo file
[root@app1 yum.repos.d]# mv ULN-Base.repo ULN-Base.repo-bkp

5- Create Repository
[root@app1 dump]# createrepo /u01/dump/RPM4u6
Preparing… ########################################### [100%]
1:createrepo ########################################### [100%]

1134/1134 – evolution28-libsoup-2.2.98-5.el4.i386.rpm
Saving Primary metadata
Saving file lists metadata
Saving other metadata
[root@app1 dump]#

6- Clean all
[root@app1 yum.repos.d]# yum clean all
Cleaning up Everything
0 headers removed
0 packages removed
0 metadata files removed
0 cache files removed
0 cache files removed

7-  yum update
[root@app1 yum.repos.d]# yum update
Setting up Update Process
Setting up repositories
local 100% |=========================| 951 B 00:00
Reading repository metadata in from local files
primary.xml.gz 100% |=========================| 466 kB 00:00
local : ################################################## 1134/1134
Added 1134 new packages, deleted 0 old in 4.25 seconds
No Packages marked for Update/Obsoletion
[root@app1 yum.repos.d]#

8- Install gcc rpm 

[root@app1 yum.repos.d]# yum install gcc

Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
–> Populating transaction set with selected packages. Please wait.
—> Downloading header for gcc to pack into transaction set.
gcc-3.4.6-9.0.1.i386.rpm 100% |=========================| 44 kB 00:00
—> Package gcc.i386 0:3.4.6-9.0.1 set to be updated
–> Running transaction check
–> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc
–> Restarting Dependency Resolution with new changes.
–> Populating transaction set with selected packages. Please wait.
—> Downloading header for glibc-devel to pack into transaction set.
glibc-devel-2.3.4-2.39.i3 100% |=========================| 96 kB 00:00
—> Package glibc-devel.i386 0:2.3.4-2.39 set to be updated
–> Running transaction check
–> Processing Dependency: glibc-headers for package: glibc-devel
–> Processing Dependency: glibc-headers = 2.3.4-2.39 for package: glibc-devel
–> Restarting Dependency Resolution with new changes.
–> Populating transaction set with selected packages. Please wait.
—> Downloading header for glibc-headers to pack into transaction set.
glibc-headers-2.3.4-2.39. 100% |=========================| 129 kB 00:00
—> Package glibc-headers.i386 0:2.3.4-2.39 set to be updated
–> Running transaction check
–> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers
–> Processing Dependency: kernel-headers for package: glibc-headers
–> Restarting Dependency Resolution with new changes.
–> Populating transaction set with selected packages. Please wait.
—> Downloading header for glibc-kernheaders to pack into transaction set.
glibc-kernheaders-2.4-9.1 100% |=========================| 75 kB 00:00
—> Package glibc-kernheaders.i386 0:2.4-9.1.100.EL set to be updated
–> Running transaction check

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
gcc i386 3.4.6-9.0.1 local 4.4 M
Installing for dependencies:
glibc-devel i386 2.3.4-2.39 local 1.9 M
glibc-headers i386 2.3.4-2.39 local 587 k
glibc-kernheaders i386 2.4-9.1.100.EL local 695 k

Transaction Summary
=============================================================================
Install 4 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 7.6 M
Is this ok [y/N]: y
Downloading Packages:
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: glibc-kernheaders ######################### [1/4]
Installing: glibc-headers ######################### [2/4]
Installing: glibc-devel ######################### [3/4]
Installing: gcc ######################### [4/4]

Installed: gcc.i386 0:3.4.6-9.0.1
Dependency Installed: glibc-devel.i386 0:2.3.4-2.39 glibc-headers.i386 0:2.3.4-2.39 glibc-kernheaders.i386 0:2.4-9.1.100.EL
Complete!
[root@app1 yum.repos.d]#

So gcc- rpm is installed with all dependecy rpm from local repository.

 

Advertisements

About Sher khan

Senior Oracle DBA, Oracle 10g , Oracle 11g OCE ,Oracle 12C and Oracle 11g OPN certified Specialist, OCP Certified in Oracle 9i,10g , 11g and 12C. I am working in Oracle technology since 2004. Currently working in U.A.E Email: sher487@hotmail.com
This entry was posted in Linux commands for DBA. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s