Wednesday, June 13, 2012

Chapter 7 - Package Management

Getting RPM's from da internat ...(good luck with the deps....doh!)

[root@server01 downloads]# wget ftp://ftp.pbone.net/mirror/download.fedora.redhat.com/pub/fedora/epel/6/x86_64/freetds-0.91-1.el6.x86_64.rpm
--2012-06-13 11:17:35--  ftp://ftp.pbone.net/mirror/download.fedora.redhat.com/pub/fedora/epel/6/x86_64/freetds-0.91-1.el6.x86_64.rpm
           => âfreetds-0.91-1.el6.x86_64.rpmâ
esolving ftp://ftp.pbone.net/... 85.14.85.4
Connecting to ftp://ftp.pbone.net%7c85.14.85.4%7c/... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done.    ==> PWD ... done.
==> TYPE I ... done.  ==> CWD (1) /mirror/download.fedora.redhat.com/pub/fedora/epel/6/x86_64 ... done.
==> SIZE freetds-0.91-1.el6.x86_64.rpm ... 579776
==> PASV ... done.    ==> RETR freetds-0.91-1.el6.x86_64.rpm ... done.
Length: 579776 (566K) (unauthoritative)
100%[====================================================================================================================>] 579,776      432K/s   in 1.3s
2012-06-13 11:17:44 (432 KB/s) - âfreetds-0.91-1.el6.x86_64.rpmâ
[root@server01 downloads]# ls -lrt
total 568
-rw-r--r--. 1

The Redhat Package Manager

Installing : rpm -ihv (or just rpm -i )
Upgrading : rpm -U (install if not existing)
Upgrading : rpm -F (only upgrade, do not install if doesn't exist)
Erase a Package : rpm -e

Installing remotely with rpm :

[root@server01 downloads]# rpm -ihv ftp://ftp.pbone.net/mirror/download.fedora.redhat.com/pub/fedora/epel/6/x86_64/freetds-0.91-1.el6.x86_64.rpm
Retrieving ftp://ftp.pbone.net/mirror/download.fedora.redhat.com/pub/fedora/epel/6/x86_64/freetds-0.91-1.el6.x86_64.rpm
warning: /var/tmp/rpm-tmp.Luh69z: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
error: Failed dependencies:
        libodbc.so.2()(64bit) is needed by freetds-0.91-1.el6.x86_64
        libodbcinst.so.2()(64bit) is needed by freetds-0.91-1.el6.x86_64


[root@server01 downloads]# ls -lrt /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
-rw-r--r--. 1 root root 3211 Apr 27  2011 /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[root@server01 downloads]#


[root@server01 downloads]# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[root@server01 downloads]# rpm -qa gpg-pubkey
gpg-pubkey-2fa658e0-45700c69
gpg-pubkey-fd431d51-4ae0493b


[root@server01 downloads]# ls /boot/
config-2.6.32-131.0.15.el6.x86_64         lost+found
efi                                       symvers-2.6.32-131.0.15.el6.x86_64.gz
grub                                      System.map-2.6.32-131.0.15.el6.x86_64
initramfs-2.6.32-131.0.15.el6.x86_64.img  vmlinuz-2.6.32-131.0.15.el6.x86_64
[root@server01 downloads]#


Installing a new kernel : (always !):

rpm -ihv

OR

yum install kernel

/boot/grub/grub.conf is automatically updated, and the new kernel is the new default to boot .

More RPM Commands

[root@server01 downloads]# rpm -q upstart
upstart-0.6.5-10.el6.x86_64


[root@server01 downloads]# rpm --checksig freetds-0.91-1.el6.x86_64.rpm
freetds-0.91-1.el6.x86_64.rpm: RSA sha1 ((MD5) PGP) md5 NOT OK (MISSING KEYS: (MD5) PGP#0608b895)

[root@server01 downloads]# rpm --checksig unicap-0.9.5-4.el6.x86_64.rpm
unicap-0.9.5-4.el6.x86_64.rpm: rsa sha1 (md5) pgp md5 OK


[root@server01 downloads]# rpm -K unicap-0.9.5-4.el6.x86_64.rpm
unicap-0.9.5-4.el6.x86_64.rpm: rsa sha1 (md5) pgp md5 OK
[root@server01 downloads]# cp -p /var/www/html/inst/RHEL_6.1_x86_64_Disc_1/Packages/unicap-0.9.5-4.el6.x86_64.rpm
Verify :

[root@server01 downloads]# rpm --verify vsftpd-2.2.2-6.el6_0.1.x86_64

[root@server01 downloads]# rpm --verify --file /bin/ls
[root@server01 downloads]# rpm --verify -p unicap-0.9.5-4.el6.x86_64.rpm
missing     /usr/lib64/libucil.so.2
missing     /usr/lib64/libucil.so.2.1.8
missing     /usr/lib64/libunicap.so.2
missing     /usr/lib64/libunicap.so.2.1.8
missing     /usr/lib64/libunicapgtk.so.2
missing     /usr/lib64/libunicapgtk.so.2.1.8
missing     /usr/lib64/unicap2
missing     /usr/lib64/unicap2/cpi
missing     /usr/lib64/unicap2/cpi/libdcam.so
missing     /usr/lib64/unicap2/cpi/libdcam.so.0
missing     /usr/lib64/unicap2/cpi/libdcam.so.0.0.0
missing     /usr/lib64/unicap2/cpi/libv4l.so
missing     /usr/lib64/unicap2/cpi/libv4l.so.0
missing     /usr/lib64/unicap2/cpi/libv4l.so.0.0.0
missing     /usr/lib64/unicap2/cpi/libv4l2cpi.so
missing     /usr/lib64/unicap2/cpi/libv4l2cpi.so.0
missing     /usr/lib64/unicap2/cpi/libv4l2cpi.so.0.0.0
missing     /usr/lib64/unicap2/cpi/libvid21394.so
missing     /usr/lib64/unicap2/cpi/libvid21394.so.0
missing     /usr/lib64/unicap2/cpi/libvid21394.so.0.0.0
missing     /usr/share/doc/unicap-0.9.5
missing   d /usr/share/doc/unicap-0.9.5/AUTHORS
missing   d /usr/share/doc/unicap-0.9.5/COPYING
missing   d /usr/share/doc/unicap-0.9.5/ChangeLog
missing   d /usr/share/doc/unicap-0.9.5/README
missing     /usr/share/locale/de/LC_MESSAGES/unicap.mo
missing     /usr/share/locale/fr/LC_MESSAGES/unicap.mo
missing     /usr/share/locale/ru/LC_MESSAGES/unicap.mo


Show all installed packages :

rpm -qa

[root@server01 downloads]# ls /root/install.log
/root/install.log
[root@server01 downloads]# tail /root/install.log
Installing ql2100-firmware-1.19.38-3.1.el6.noarch
Installing ql2500-firmware-5.03.16-1.el6.noarch
Installing zd1211-firmware-1.4-4.el6.noarch
Installing ipw2100-firmware-1.3-11.el6.noarch
Installing ql23xx-firmware-3.03.27-3.1.el6.noarch
Installing ipw2200-firmware-3.1-4.el6.noarch
Installing ivtv-firmware-20080701-20.2.noarch
Installing man-pages-3.22-17.el6.noarch
Installing words-3.0-17.el6.noarch
*** FINISHED INSTALLING PACKAGES ***[root@server01 downloads]#

[root@server01 yum]# rpm -qi httpd
Name        : httpd                        Relocations: (not relocatable)
Version     : 2.2.15                            Vendor: Red Hat, Inc.
Release     : 9.el6                         Build Date: Sat 09 Apr 2011 08:00:13 AM CDT
Install Date: Wed 06 Jun 2012 06:54:27 AM CDT      Build Host: x86-010.build.bos.redhat.com
Group       : System Environment/Daemons    Source RPM: httpd-2.2.15-9.el6.src.rpm
Size        : 3056498                          License: ASL 2.0
Signature   : RSA/8, Thu 21 Apr 2011 02:47:47 PM CDT, Key ID 199e2f91fd431d51
Packager    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
URL         : http://httpd.apache.org/
Summary     : Apache HTTP Server
Description :
The Apache HTTP Server is a powerful, efficient, and extensible
web server.

[root@server01 downloads]# rpm -qpi freetds-0.91-1.el6.x86_64.rpm
warning: freetds-0.91-1.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Name        : freetds                      Relocations: (not relocatable)
Version     : 0.91                              Vendor: Fedora Project
Release     : 1.el6                         Build Date: Thu 27 Oct 2011 08:47:52 AM CDT
Install Date: (not installed)               Build Host: x86-11.phx2.fedoraproject.org
Group       : System Environment/Libraries   Source RPM: freetds-0.91-1.el6.src.rpm
Size        : 2699105                          License: LGPLv2+ and GPLv2+
Signature   : RSA/8, Thu 27 Oct 2011 04:27:40 AM CDT, Key ID 3b49df2a0608b895
Packager    : Fedora Project
URL         : http://www.freetds.org/
Summary     : Implementation of the TDS (Tabular DataStream) protocol
Description :
FreeTDS is a project to document and implement the TDS (Tabular
DataStream) protocol. TDS is used by Sybase(TM) and Microsoft(TM) for
client to database server communications. FreeTDS includes call
level interfaces for DB-Lib, CT-Lib, and ODBC.

Dependancies and the yum command

[root@server01 downloads]# yum install yum-plugin-downloadonly.noarch -y

[root@server01 downloads]# cat /etc/yum.conf
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1




#  This is the default, if you make this bigger yum won't see if the metadata
# is newer on the remote and so you'll "gain" the bandwidth of not having to
# download the new metadata and "pay" for it by yum not having correct
# information.
#  It is esp. important, to have correct metadata, for distributions like
# Fedora which don't keep old packages around. If you don't like this checking
# interupting your command line usage, it's much better to have something
# manually check the metadata once an hour (yum-updatesd will do this).
# metadata_expire=90m

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
[root@server01 downloads]#


[root@server01 downloads]# cd /etc/yum
[root@server01 yum]# ls -l
total 16
drwxr-xr-x. 2 root root 4096 Jun 13 11:19 pluginconf.d
drwxr-xr-x. 2 root root 4096 Apr 28  2011 protected.d
drwxr-xr-x. 2 root root 4096 Apr 28  2011 vars
-rw-r--r--. 1 root root  444 Apr 28  2011 version-groups.conf


[root@server01 yum]# pwd
/etc/yum

[root@server01 yum]# find ./ -name rhnplugin.conf
./pluginconf.d/rhnplugin.conf
[root@server01 yum]# cat ./pluginconf.d/rhnplugin.conf
[main]
enabled = 0
gpgcheck = 1

# You can specify options per channel, e.g.:
#
#[rhel-i386-server-5]
#enabled = 1
#
#[some-unsigned-custom-channel]
#gpgcheck = 0


[root@server01 yum]# ls -lrt /etc/yum.repos.d/
total 16
-r--r--r--. 1 root root 114 May 10  2011 packagekit-media.repo
-rw-r--r--. 1 root root 106 Jun  6 12:38 iso.repo
-rw-r--r--. 1 root root 621 Jun  7 06:25 rhel-source.repo
-rw-r--r--. 1 root root  67 Jun 13 11:44 redhat.repo
[root@server01 yum]# cat /etc/yum.repos.d/iso.repo
[localRepo]
name=localRepo
baseurl=file:///var/www/html/inst/RHEL_6.1_x86_64_Disc_1/
enabled=1
gpgcheck=0


More yum commands : 
  • yum install samba
  • yum update samba
  • yum erase samba
  • yum whatprovides */*.repo
  • yum update   (update ALL existing packages on this system)
  • yum grouplist
  • yum groupinfo
  • yum groupinstall
[root@server01 var]# yumdownloader unicap
Loaded plugins: product-id, refresh-packagekit
unicap-0.9.5-4.el6.x86_64.rpm                            | 154 kB     00:00
[root@server01 var]# ls unicap-0.9.5-4.el6.x86_64.rpm
unicap-0.9.5-4.el6.x86_64.rpm


# createrepo

[root@server01 downloads]# createrepo /root/downloads/
2/2 - unicap-0.9.5-4.el6.x86_64.rpm
Saving Primary metadata
Saving file lists metadata
Saving other metadata
[root@server01 downloads]


[root@server01 downloads]# yum install gnome-packagekit
Loaded plugins: downloadonly, product-id, refresh-packagekit, subscription-manager
Updating Red Hat repositories.
Setting up Install Process
Package gnome-packagekit-2.28.3-3.el6.x86_64 already installed and latest version
Nothing to do

More Package Mgt Tools


# gpk-update-viewer 

# gpk-prefs

# gpk-application


NOTE : More with GUI pkg tools later !!



No comments:

Post a Comment