Friday, July 14, 2017

.::: How Settting & Install Package OS Redhat Enterprise Linux(Rhel) 7 Using Repolocal, ISO File & rpm file :::.


A. Using Repolocal(DVD)
1. Make sure DVD mounting
[root@teguhlab yum.repos.d]# df -kh
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3       261G  3.0G  258G   2% /
devtmpfs        9.8G     0  9.8G   0% /dev
tmpfs           9.8G   84K  9.8G   1% /dev/shm
tmpfs           9.8G  9.0M  9.8G   1% /run
tmpfs           9.8G     0  9.8G   0% /sys/fs/cgroup
/dev/sda1       187M  146M   42M  78% /boot
tmpfs           2.0G   20K  2.0G   1% /run/user/0
/dev/sr0        3.6G  3.6G     0 100% /run/media/root/RHEL-7.3 Server.x86_64
[root@teguhlab yum.repos.d]#

2. Setting Repolocal using dvd and save
[root@teguhlab ~]# cd /etc/yum.repos.d/
[root@teguhlab yum.repos.d]# ls
redhat.repo  rhel-dvd.repo
[root@teguhlab yum.repos.d]# more redhat.repo
#
# Certificate-Based Repositories
# Managed by (rhsm) subscription-manager
#
# *** This file is auto-generated.  Changes made here will be over-written. ***
# *** Use "subscription-manager repo-override --help" if you wish to make changes. ***
#
# If this file is empty and this system is subscribed consider
# a "yum repolist" to refresh available repos
#
[root@teguhlab yum.repos.d]# more rhel-dvd.repo
[rhel-dvd]
name=RHEL-7.2 Server.x86_64
baseurl=file:///run/media/root/"RHEL-7.2 Server.x86_64"/
#baseurl=file:///mnt
enabled=1
gpgcheck=0
#gpgkey=file:///run/media/root/"RHEL-7.2 Server.x86_64"/RPM-GPG-KEY-redhat-release
[root@teguhlab yum.repos.d]#

B. Using ISO File
1. Make sure Iso file copying on Disk
[root@teguhlab yum.repos.d]# cd /data/
[root@teguhlab data]# ls
rhel-server-7.3-x86_64-dvd.iso
[root@teguhlab data]# pwd
/data
[root@teguhlab data]# ls
rhel-server-7.3-x86_64-dvd.iso
[root@teguhlab data]#

2. mounting to /mnt
mount -o loop rhel-server-7.3-x86_64-dvd.iso /mnt

3. checking mounting mnt
[root@teguhlab data]# df -kh
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3       280G  6.5G  274G   3% /
devtmpfs        9.8G     0  9.8G   0% /dev
tmpfs           9.8G   88K  9.8G   1% /dev/shm
tmpfs           9.8G  9.0M  9.8G   1% /run
tmpfs           9.8G     0  9.8G   0% /sys/fs/cgroup
/dev/sda1       197M  139M   59M  71% /boot
tmpfs           2.0G   20K  2.0G   1% /run/user/0
/dev/loop0      3.6G  3.6G     0 100% /mnt
/dev/loop1      3.6G  3.6G     0 100% /run/media/teguh
[root@teguhlab data]#

2. Setting Repolocal using iso and save
[root@teguhlab ~]# cd /etc/yum.repos.d/
[root@teguhlab yum.repos.d]# ls
redhat.repo  rhel-dvd.repo
[root@teguhlab yum.repos.d]# more redhat.repo
#
# Certificate-Based Repositories
# Managed by (rhsm) subscription-manager
#
# *** This file is auto-generated.  Changes made here will be over-written. ***
# *** Use "subscription-manager repo-override --help" if you wish to make changes. ***
#
# If this file is empty and this system is subscribed consider
# a "yum repolist" to refresh available repos
#
[root@teguhlab yum.repos.d]# more rhel-dvd.repo
[rhel-dvd]
name=RHEL-7.2 Server.x86_64
#baseurl=file:///run/media/root/"RHEL-7.2 Server.x86_64"/
baseurl=file:///mnt
enabled=1
gpgcheck=0
#gpgkey=file:///run/media/root/"RHEL-7.2 Server.x86_64"/RPM-GPG-KEY-redhat-release
[root@teguhlab yum.repos.d]#

C. Testing install package using DVD or Iso file
[root@teguhlab data]# rpm -q nmap
package nmap is not installed
[root@teguhlab data]# yum -y install nmap
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
file://mnt/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /repodata/repomd.xml"
Trying other mirror.
Resolving Dependencies
--> Running transaction check
---> Package nmap.x86_64 2:6.40-7.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===========================================================================================================================
 Package                  Arch                       Version                            Repository                    Size
===========================================================================================================================
Installing:
 nmap                     x86_64                     2:6.40-7.el7                       rhel-dvd                     3.9 M

Transaction Summary
===========================================================================================================================
Install  1 Package

Total download size: 3.9 M
Installed size: 16 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 2:nmap-6.40-7.el7.x86_64                                                                                1/1
  Verifying  : 2:nmap-6.40-7.el7.x86_64                                                                                1/1

Installed:
  nmap.x86_64 2:6.40-7.el7                                                                                                

Complete!
[root@teguhlab data]# rpm -q nmap
nmap-6.40-7.el7.x86_64
[root@teguhlab data]#

[root@teguhlab data]# rpm -q tigervnc-server
package tigervnc-server is not installed
[root@teguhlab data]# yum install tigervnc-server
Loaded plugins: langpacks, product-id, search-disabled-repos, 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 tigervnc-server.x86_64 0:1.3.1-9.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================================================================================================================
 Package                                                 Arch                                           Version                                              Repository                                        Size
====================================================================================================================================================================================================================
Installing:
 tigervnc-server                                         x86_64                                         1.3.1-9.el7                                          rhel-dvd                                         203 k

Transaction Summary
====================================================================================================================================================================================================================
Install  1 Package

Total download size: 203 k
Installed size: 493 k
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : tigervnc-server-1.3.1-9.el7.x86_64                                                                                                                                                               1/1
  Verifying  : tigervnc-server-1.3.1-9.el7.x86_64                                                                                                                                                               1/1

Installed:
  tigervnc-server.x86_64 0:1.3.1-9.el7                                                                                                                                                                             

Complete!
[root@teguhlab data]# rpm -q tigervnc-server
tigervnc-server-1.3.1-9.el7.x86_64
[root@teguhlab data]#

D. Using RPM File
1. example download file and copy to disk
ftp://rpmfind.net/linux/centos/7.3.1611/os/x86_64/Packages/compat-libstdc++-33-3.2.3-72.el7.i686.rpm
ftp://rpmfind.net/linux/centos/7.3.1611/os/x86_64/Packages/compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm

2. check status package
rpm -q compat-libstdc++-33.i686 compat-libstdc++-33.x86_64
[root@teguhlab data]# ls
compat-libstdc++-33-3.2.3-72.el7.i686.rpm  compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm  rhel-server-7.3-x86_64-dvd.iso
[root@teguhlab data]# rpm -q compat-libstdc++-33.i686 compat-libstdc++-33.x86_64
package compat-libstdc++-33.i686 is not installed
package compat-libstdc++-33.x86_64 is not installed

3. Install package using rpm -ivh
[root@teguhlab data]# rpm -ivh compat-libstdc++-33-3.2.3-72.el7.i686.rpm compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm
warning: compat-libstdc++-33-3.2.3-72.el7.i686.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:compat-libstdc++-33-3.2.3-72.el7 ################################# [ 50%]
   2:compat-libstdc++-33-3.2.3-72.el7 ################################# [100%]
[root@teguhlab data]# rpm -q compat-libstdc++-33.i686 compat-libstdc++-33.x86_64
compat-libstdc++-33-3.2.3-72.el7.i686
compat-libstdc++-33-3.2.3-72.el7.x86_64
[root@teguhlab data]#

No comments:

Post a Comment

Popular Posts