About these ads

Mirroring RHN repositories

To mirror the repository for RHEL 5, run the command below

root@rhel5:~# reposync -p /redhat –repoid=rhel-x86_64-server-5 -l

[rhel-x86_64-server-5: 12937 of 16070 ] Skipping existing getPackage/samba3x-3.6.6-0.139.el5_10.x86_64.rpm
[rhel-x86_64-server-5: 12938 of 16070 ] Downloading getPackage/samba3x-3.6.6-0.140.el5_10.x86_64.rpm
samba3x-3.6.6-0.140.el5_10.x86_64.rpm | 5.9 MB 00:25
[rhel-x86_64-server-5: 12939 of 16070 ] Skipping existing getPackage/samba3x-client-3.3.8-0.51.el5.x86_64.rpm

It will create a directory with the name of the channel

root@rhel5:~# ls -l /redhat
total 2914724
drwxr-xr-x 3 root root 4096 Jul 31 2013 rhel-x86_64-server-5

After you download all the packages, create the database for the packages

root@rhel5:~ # createrepo –database /redhat/rhel-x86_64-server-5/getPackage/
16070/16070 – gcc-objc++-4.1.2-46.el5.x86_64.rpm
Saving Primary metadata
Saving file lists metadata
Saving other metadata

And verify it to see if there is a problem

root@rhel5:~ # verifytree /redhat/rhel-x86_64-server-5/getPackage/
Loaded plugins: product-id, rhnplugin
Checking repodata:
verifying repomd.xml with yum
verifying filelists checksum
verifying primary checksum
verifying primary_db checksum
verifying other_db checksum
verifying other checksum
verifying filelists_db checksum
Checking groups (comps.xml):
verifying comps.xml with yum
comps file missing or unparseable

As of today, July 17th 2014, you need 34GB for RHEL 5

root@rhel5:/redhat/rhel-x86_64-server-5 # du -sh .
34G .

Same steps for Red Hat Enterprise Linux 6

root@rhel6:~ # reposync -p /redhat –repoid=rhel-x86_64-server-6 -l

root@rhel6:~ # createrepo –database /redhat/rhel-x86_64-server-6/getPackage/
Spawning worker 0 with 12900 pkgs
Workers Finished
Gathering worker results

Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete

root@rhel6:~ # verifytree /redhat/rhel-x86_64-server-6/getPackage/
Loaded plugins: product-id, refresh-packagekit, rhnplugin
This system is receiving updates from RHN Classic or RHN Satellite.
Checking repodata:
verifying repomd.xml with yum
verifying filelists checksum
verifying primary checksum
verifying other checksum
verifying filelists_db checksum
verifying primary_db checksum
verifying other_db checksum
Checking groups (comps.xml):
verifying comps.xml with yum
comps file missing or unparseable

As of today, July 17th 2014, you need 21GB for RHEL 6

root@rhel6:/redhat/rhel-x86_64-server-6/getPackage # du -sh .
21G .

About these ads

Received disconnect from host: 2: bind: Permission denied

I was receiving the error message Received disconnect from host: 2: bind: Permission denied when trying to connect using ssh.

Received disconnect from 172.16.36.110: 2: bind: Permission denied

root@linux:~ # rpm -q openssh
openssh-4.2p1-18.38.3

root@linux:~ # cat /etc/*release
SUSE Linux Enterprise Server 10 (x86_64)
VERSION = 10
PATCHLEVEL = 2
LSB_VERSION=”core-2.0-noarch:core-3.0-noarch:core-2.0-x86_64:core-3.0-x86_64″

I solved this problem unchecking Allow agent forwarding
Allow Agent Forwarding

fsck in Linux: Superblock last write time is in the future. FIXED

When rebooting the server and it shows this message:

Superblock last write time is in the future. FIXED

Move the file /etc/adjtime and set the hardware clock using the command below:

root@linux:~ # mv /etc/adjtime /etc/adjtime.bak

root@linux:~ # hwclock
Fri 27 Jun 2014 11:27:05 AM BRT -0.574168 seconds

root@linux:~ # hwclock —systohc —localtime

root@linux:~ # hwclock -w

root@linux:~ # hwclock
Fri 27 Jun 2014 11:30:17 AM BRT -0.616638 seconds

Source: After reboot, the Linux system time is always wrong
Using the hwclock program

HPOM: Flood Gate has Detected a Storm for Application

Contact Support Team or Technical Lead. Flood Gate has Detected a Storm for Application (CLONED_LINUX.SETAOFFICE.COM^:^ntpmon^:^) Logfile: None Annotations: No

Node : cloned_linux.setaoffice.com
Node Type : Intel/AMD x86(HTTPS)
Severity : major
OM Server Time: 2014-03-21 10:02:21
Message : Contact Support Team or Technical Lead. Flood Gate has Detected a Storm for Application (CLONED_LINUX.SETAOFFICE.COM^:^ntpmon^:^) Logfile: None Annotations: No
Msg Group : OS
Application : esf
Object : Event Storm
Event Type :
not_found

Instance Name :
not_found

Instruction : No

This error was appearing in my case because this server was cloned and probably it has the same certificate as the cloned machine.

I reinstalled HPOM.

yum: No module named gzip or another library

You are troubleshooting your yum installation, getting the missing libraries

root@linux:~ # yum whatprovides
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

No module named gzip

Please install a package which provides this module, or
verify that the module is installed correctly.

It’s possible that the above module doesn’t match the
current version of Python, which is:
2.4.3 (#1, Aug 29 2011, 10:55:55)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-51)]

If you cannot solve this problem yourself, please go to
the yum faq at:

http://wiki.linux.duke.edu/YumFaq

If you see a different module, try to install all python libraries

root@linux:~ # yum repolist
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

No module named zlib

Please install a package which provides this module, or
verify that the module is installed correctly.

It’s possible that the above module doesn’t match the
current version of Python, which is:
2.4.3 (#1, Aug 29 2011, 10:55:55)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-51)]

If you cannot solve this problem yourself, please go to
the yum faq at:

http://wiki.linux.duke.edu/YumFaq

List the packages starting with python

root@linux:~ # rpm -qa –qf “%{n}-%{arch}\n” | grep ^python
python-ldap-x86_64
python-urlgrabber-noarch
python-x86_64
python-libs-x86_64
python-devel-x86_64
python-sqlite-x86_64
python-numeric-x86_64
python-iniparse-noarch
python-elementtree-x86_64
python-dmidecode-x86_64
python-devel-i386

And query each one of them to see if there is a missing file. Reinstall the packages that report missing files.

root@linux:~ # rpm -V python-devel-2.4.3-44.el5_7.1
missing /usr/lib64/python2.4/test/decimaltestdata/normalize.decTest
missing /usr/lib64/python2.4/test/decimaltestdata/quantize.decTest
missing /usr/lib64/python2.4/test/output/test_tokenize
missing /usr/lib64/python2.4/test/test_normalization.pyc
missing /usr/lib64/python2.4/test/test_normalization.pyo
missing /usr/lib64/python2.4/test/test_zipfile.py
missing /usr/lib64/python2.4/test/test_zipfile.pyc
missing /usr/lib64/python2.4/test/test_zipfile.pyo
missing /usr/lib64/python2.4/test/test_zipimport.py
missing /usr/lib64/python2.4/test/test_zipimport.pyc
missing /usr/lib64/python2.4/test/test_zipimport.pyo
missing /usr/lib/python2.4/test/decimaltestdata/normalize.decTest
missing /usr/lib/python2.4/test/decimaltestdata/quantize.decTest
missing /usr/lib/python2.4/test/output/test_tokenize
missing /usr/lib/python2.4/test/test_normalization.pyc
missing /usr/lib/python2.4/test/test_normalization.pyo
missing /usr/lib/python2.4/test/test_zipfile.py
missing /usr/lib/python2.4/test/test_zipfile.pyc
missing /usr/lib/python2.4/test/test_zipfile.pyo
missing /usr/lib/python2.4/test/test_zipimport.py
missing /usr/lib/python2.4/test/test_zipimport.pyc
missing /usr/lib/python2.4/test/test_zipimport.pyo

root@linux:~ # rpm -V python-ldap-2.2.0-2.1

root@linux:~ # rpm -V python-urlgrabber-3.1.0-6.el5

root@linux:~ # rpm -V python-devel-2.4.3-44.el5_7.1
missing /usr/lib64/python2.4/test/decimaltestdata/normalize.decTest
missing /usr/lib64/python2.4/test/decimaltestdata/quantize.decTest
missing /usr/lib64/python2.4/test/output/test_tokenize
missing /usr/lib64/python2.4/test/test_normalization.pyc
missing /usr/lib64/python2.4/test/test_normalization.pyo
missing /usr/lib64/python2.4/test/test_zipfile.py
missing /usr/lib64/python2.4/test/test_zipfile.pyc
missing /usr/lib64/python2.4/test/test_zipfile.pyo
missing /usr/lib64/python2.4/test/test_zipimport.py
missing /usr/lib64/python2.4/test/test_zipimport.pyc
missing /usr/lib64/python2.4/test/test_zipimport.pyo
missing /usr/lib/python2.4/test/decimaltestdata/normalize.decTest
missing /usr/lib/python2.4/test/decimaltestdata/quantize.decTest
missing /usr/lib/python2.4/test/output/test_tokenize
missing /usr/lib/python2.4/test/test_normalization.pyc
missing /usr/lib/python2.4/test/test_normalization.pyo
missing /usr/lib/python2.4/test/test_zipfile.py
missing /usr/lib/python2.4/test/test_zipfile.pyc
missing /usr/lib/python2.4/test/test_zipfile.pyo
missing /usr/lib/python2.4/test/test_zipimport.py
missing /usr/lib/python2.4/test/test_zipimport.pyc
missing /usr/lib/python2.4/test/test_zipimport.pyo

root@linux:~ # rpm -V python-sqlite-1.1.7-1.2.1

root@linux:~ # rpm -V python-numeric-23.7-2.2.2.el5_6.1

root@linux:~ # rpm -V python-iniparse-0.2.3-4.el5

root@linux:~ # rpm -V python-elementtree-1.2.6-5

root@linux:~ # rpm -V python-libs-2.4.3-44.el5_7.1
missing /usr/lib64/python2.4/_MozillaCookieJar.py
missing /usr/lib64/python2.4/_MozillaCookieJar.pyc
missing /usr/lib64/python2.4/_MozillaCookieJar.pyo
missing /usr/lib64/python2.4/tokenize.py
missing /usr/lib64/python2.4/tokenize.pyc
missing /usr/lib64/python2.4/tokenize.pyo
missing /usr/lib64/python2.4/tzparse.py
missing /usr/lib64/python2.4/tzparse.pyc
missing /usr/lib64/python2.4/tzparse.pyo
missing /usr/lib64/python2.4/zipfile.py
missing /usr/lib64/python2.4/zipfile.pyc
missing /usr/lib64/python2.4/zipfile.pyo

root@linux:~ # rpm -V python-dmidecode-3.10.13-1.el5_5.1

There was a problem importing one of the Python modules required to run yum

I had a problem with the server and then yum was not running

root@linux:~ # yum whatprovides libbz2.so.1
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

libbz2.so.1: cannot open shared object file: No such file or directory

Please install a package which provides this module, or
verify that the module is installed correctly.

It’s possible that the above module doesn’t match the
current version of Python, which is:
2.4.3 (#1, Aug 29 2011, 10:55:55)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-51)]

If you cannot solve this problem yourself, please go to
the yum faq at:

http://wiki.linux.duke.edu/YumFaq

I ran python manually and tried to import the module

root@linux:~ # python
Python 2.4.3 (#1, Aug 29 2011, 10:55:55)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-51)] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
>>> import yum
Traceback (most recent call last):
File “”, line 1, in ?
File “/usr/lib/python2.4/site-packages/yum/__init__.py”, line 23, in ?
import rpm
File “/usr/lib64/python2.4/site-packages/rpm/__init__.py”, line 7, in ?
from _rpm import *
ImportError: libbz2.so.1: cannot open shared object file: No such file or directory

Seeing other server, I needed this two files

root@other_linux:~ # find / -name libbz2.so.1
/usr/lib/libbz2.so.1
/usr/lib64/libbz2.so.1

Which are a link

root@linux:~ # ls -l /usr/lib/libbz2.so.1
lrwxrwxrwx 1 root root 15 Mar 14 11:09 /usr/lib/libbz2.so.1 -> libbz2.so.1.0.3
root@linux:~ # ls -l /usr/lib64/libbz2.so.1
lrwxrwxrwx 1 root root 15 Mar 14 11:10 /usr/lib64/libbz2.so.1 -> libbz2.so.1.0.3

They didn’t exist in the server

root@other_linux:~ # ls -l /usr/lib/libbz2.so.1.0.3
-rwxr-xr-x 1 root root 71852 Sep 20 2010 /usr/lib/libbz2.so.1.0.3
root@other_linux:~ # ls -l /usr/lib64/libbz2.so.1.0.3
-rwxr-xr-x 1 root root 67792 Sep 20 2010 /usr/lib64/libbz2.so.1.0.3

root@linux:~ # ls -l /usr/lib/libbz2.so.1.0.3
ls: /usr/lib/libbz2.so.1.0.3: No such file or directory
root@linux:~ # ls -l /usr/lib64/libbz2.so.1.0.3
ls: /usr/lib64/libbz2.so.1.0.3: No such file or directory

The package bzip2-libs provide the files. Download it and install the package with rpm and try to run yum again

root@other_linux:~ # yum whatprovides /usr/lib/libbz2.so.1.0.3
Loaded plugins: downloadonly, rhnplugin, security
Importing additional filelist information
repository/filelists_db | 40 MB 00:04
bzip2-libs-1.0.3-3.i386 : Libraries for applications using bzip2
Repo : repository
Matched from:
Filename : /usr/lib/libbz2.so.1.0.3

bzip2-libs-1.0.3-6.el5_5.i386 : Libraries for applications using bzip2
Repo : repository
Matched from:
Filename : /usr/lib/libbz2.so.1.0.3

bzip2-libs-1.0.3-4.el5_2.i386 : Libraries for applications using bzip2
Repo : repostory
Matched from:
Filename : /usr/lib/libbz2.so.1.0.3

bzip2-libs-1.0.3-6.el5_5.i386 : Libraries for applications using bzip2
Repo : repository
Matched from:
Other : Provides-match: /usr/lib/libbz2.so.1.0.3

Symantec Enterprise Security Manager install error: 32bit libpam not detected, aborting installation

Trying to install Symantec ESM on Red Hat Enterprise Linux

root@linux:/tmp/esm100 # ./Linux18.sh esmmanager.setaoffice.com linux.setaoffice.com
Logging ESM install to /tmp/esm_install.log.30608
32bit libpam not detected, aborting installation

When installing PAM 32 bits it shows the following libraries are needed

root@linux:/tmp/esm100 # rpm -ivh pam-1.1.1-13.el6.i686.rpm
error: Failed dependencies:
libaudit.so.1 is needed by pam-1.1.1-13.el6.i686
libcrack.so.2 is needed by pam-1.1.1-13.el6.i686
libdb-4.7.so is needed by pam-1.1.1-13.el6.i686
libselinux.so.1 is needed by pam-1.1.1-13.el6.i686

Install audit-libs, cracklib, db4 and finally pam

root@linux:/tmp/esm100 # rpm -ivh audit-libs-2.2-2.el6.i686.rpm
Preparing… ########################################### [100%]
1:audit-libs ########################################### [100%]

root@linux:/tmp/esm100 # rpm -ivh cracklib-2.8.16-4.el6.i686.rpm
Preparing… ########################################### [100%]
1:cracklib ########################################### [100%]

root@linux:/tmp/esm100 # rpm -ivh db4-4.7.25-18.el6_4.i686.rpm
Preparing… ########################################### [100%]
1:db4 ########################################### [100%]

root@linux:/tmp/esm100 # rpm -ivh libselinux-2.0.94-5.3.el6_4.1.i686.rpm
Preparing… ########################################### [100%]
1:libselinux ########################################### [100%]

root@linux:/tmp/esm100 # rpm -ivh pam-1.1.1-13.el6.i686.rpm
Preparing… ########################################### [100%]
1:pam ########################################### [100%]

/sbin/ldconfig: File /usr/lib/libnoexec.so is empty, not checked.

In my case, this is not a real library, it is an empty file so I just moved the file when encountered the error.

root@linux:~ # rpm -ivh pam-1.1.1-13.el6.i686.rpm
Preparing… ########################################### [100%]
1:pam ########################################### [100%]
/sbin/ldconfig: File /usr/lib/libnoexec.so is empty, not checked.

Just type the following command to move the file

root@linux:~ # mv /usr/lib/libnoexec.so /tmp

hpiod and hpssd daemons

The daemons hpssd and hpiod belong to the HP Linux Imaging and Printing service

root@linux:~ # cat /etc/init.d/hplip
# chkconfig: 2345 50 10
# description: Start/stop script for HP Linux Imaging and Printing (HPLIP).

echo -n $”Starting hpiod: “
cd $HPIODDIR
daemon ./hpiod
RETVAL=$?
echo
[ $RETVAL = 0 ] && [ -d /var/lock/subsys ] && touch /var/lock/subsys/hpiod
echo -n $”Starting hpssd: “
cd $HPSSDDIR
daemon ./hpssd.py
RETVAL=$?

netcat on Suse Linux and Red Hat Enterprise Linux

There are two netcat application around.

Suse Linux uses netcat

root@suselinux10sp4:~ # cat /etc/*release
SUSE Linux Enterprise Server 10 (x86_64)
VERSION = 10
PATCHLEVEL = 4
LSB_VERSION=”core-2.0-noarch:core-3.0-noarch:core-2.0-x86_64:core-3.0-x86_64″

This is the package

root@suselinux10sp4:~ # rpm -qa | grep netcat
netcat-1.10-883.2

Test port this way

root@suselinux10sp4:~ # netcat -vz 172.16.4.198 21
solaris10 [172.16.4.198] 21 (ftp) open

This is the package information

root@suselinux10sp4:~ # rpm -qi netcat
Name : netcat Relocations: (not relocatable)
Version : 1.10 Vendor: SUSE LINUX Products GmbH, Nuernberg, Germany
Release : 883.2 Build Date: Fri Jun 16 11:04:19 2006
Install Date: Mon Jun 2 11:38:15 2008 Build Host: bassani.suse.de
Group : Productivity/Networking/Other Source RPM: netcat-1.10-883.2.src.rpm
Size : 130566 License: Other License(s), see package, distributable
Signature : DSA/SHA1, Fri Jun 16 11:07:49 2006, Key ID a84edae89c800aca
Packager : http://bugs.opensuse.org
Summary : A Simple But Powerful Network Tool
Description :
Netcat is a simple Unix utility that reads and writes data across
network connections using TCP or UDP protocols. It is designed to be a
reliable back-end tool that can be used directly or easily driven by
other programs and scripts. At the same time, it is a feature-rich
network debugging and exploration tool, because it can create almost
any kind of connection you may need and has several interesting
built-in capabilities.

Find the documentation in /usr/share/doc/packages/netcat/README.

Authors:
——–
hobbit@avian.org
Distribution: SUSE Linux Enterprise 10 (X86-64)

For Red Hat Linux

root@redhatenterpriselinux58:~ # cat /etc/*release
Red Hat Enterprise Linux Server release 5.8 (Tikanga)

This is the package

root@redhatenterpriselinux58:~ # rpm -qf /usr/bin/nc
nc-1.84-10.fc6

This is the package information

root@redhatenterpriselinux58:~ # rpm -qi nc
Name : nc Relocations: (not relocatable)
Version : 1.84 Vendor: Red Hat, Inc.
Release : 10.fc6 Build Date: Sun 01 Oct 2006 06:51:17 PM BRT
Install Date: Sat 16 Jul 2011 06:57:04 AM BRT Build Host: hs20-bc1-7.build.redhat.com
Group : Applications/Internet Source RPM: nc-1.84-10.fc6.src.rpm
Size : 111823 License: GPL
Signature : DSA/SHA1, Thu 18 Jan 2007 02:10:50 PM BRST, Key ID 5326810137017186
Packager : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla&gt;
URL : http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/nc/
Summary : Reads and writes data across network connections using TCP or UDP.
Description :
The nc package contains Netcat (the program is actually nc), a simple
utility for reading and writing data across network connections, using
the TCP or UDP protocols. Netcat is intended to be a reliable back-end
tool which can be used directly or easily driven by other programs and
scripts. Netcat is also a feature-rich network debugging and
exploration tool, since it can create many different connections and
has many built-in capabilities.

You may want to install the netcat package if you are administering a
network and you’d like to use its debugging and network exploration
capabilities.

This is how to test a port

root@redhatenterpriselinux58:~ # nc -vz 172.16.4.198 21
Connection to 172.16.4.198 21 port [tcp/ftp] succeeded!

Follow

Get every new post delivered to your Inbox.

Join 304 other followers

%d bloggers like this: