UnixServerAdmin

Server Administration & Management

Difference between YUM & UP2DATE

The Yellow dog Updater, Modified (YUM) is a free software/open source command line package management utility for RPM-compatible Linux operating systems. It automatically computes dependencies and figures out what things should occur to install packages. It makes it easier to maintain groups of machines without having to manually update each one using rpm. Yum leaves as result of its use heads and packages RPM stored in the interior of the directory located in the route /var/cache/yum/.

UP2DATE is a tool used by Red Hat Enterprise Linux, CentOS and early versions of Fedora Core RPMPackage Manager and adds advanced  features such as automatic dependency resolution. The file /etc/sysconfig/rhn/sources specifies where up2date will search for packages. that downloads and installs new software and upgrades to the operating system.

YUM UP2DATE Function
yum update up2date -u Check for and update all RPM(S)
yum update <package> [<package>…]eg:-  yum update vnc up2date -u […]up2date httpd Check for and update specified RPM(s)/Package
yum install <package>eg:-  yum install vnc up2date -i […]up2date -i  httpd

up2date -d –src Package-Name

Install the specified RPM(s)Download source packages only but don’t install:
yum remove <package>eg:-  yum remove vnc rpm -e […] Remove the specified RPM(s) and it’s dependents
yum list “<regex>” [“<regex>”…]eg:- yum list php up2date –showall | grep “”up2date –showall | grep “php” Search for packages by name
yum list updates [“<regex>”…] up2date -l List all packages which could be updated
yum list available [“<regex>”…] up2date –show-available List all available packages
yum list installed [“<regex>”…] rpm -qa List all installed packages
yum groupupdate “” [“”]eg:- yum groupupdate “GNOME Desktop Environment” up2date -u “@”up2date -u “@ GNOME Desktop Environment” Update packages in a group
yum groupinstall “”eg:- yum groupinstall “GNOME Desktop Environment” up2date “@”up2date -i “@ X Software Development “ Install all the default packages by groupTo install group X Software Development
yum groupremove “” [“”] not possible Remove all packages in a group
yum grouplist up2date –show-groups List available package groups
yum localinstall [] up2date -k[:…] Install local packages solving and satisfying dependencies as needed
yum install <package>.<arch> [<package>.<arch>… up2date –arch= […]up2date –arch=i386 mysql Install package of specified architecture
yum list extras up2date –show-orphans Show all packages not available via subscribed channels or repositories
echo “repo list” | yum shellyum –enablerepo=reponame install packagename up2date –show-channels List all channels the system is currently subscribed toTo enable a repository which is disabled in the configuration:
yum whatprovides […] Up2date –whatprovides=<dependency>[,<dependency>…]

up2date –whatprovides “/etc/passwd”

List packages that satisfy dependency(ies)You can easily find out what RPM package provides the file
rhn_register up2date –register Register a system to RHN hosted/satellite
Advertisements

September 29, 2012 Posted by | Tips & Tricks, Unix/Linux | , | Leave a comment

yum_update.sh

#######################################################
# yum_update.sh ##
#######################################################
# Make a Directory /REPORTS ##
# Make a file msg6.txt under /REPORTS Directory ##
# Write Following in msg6.txt file ##
#######################################################
# Hi, ##
# The Operating and Patch Update process of the server has been completed. ##
# For Server update Report, Please check the attached yum_update Report. ###
# Thanks & Regards, ##
# Unixserveradmin.com Security Team ##
#######################################################
#! /bin/bash
/bin/mkdir /REPORTS 2> /dev/null
/bin/echo “####################################” >> /REPORTS/Yum_Update_$(date +%d%m%y).txt
/bin/echo “– MONTHLY SERVER UPDATE REPORT FOR $(/bin/hostname | tr ‘a-z’ ‘A-Z’) –” > /REPORTS/Yum_Update_$(date +%d%m%y).txt
/bin/echo ”                                                            ” >> /REPORTS/Yum_Update_$(date +%d%m%y).txt
/bin/echo ”                                                            ” >> /REPORTS/Yum_Update_$(date +%d%m%y).txt
/bin/echo “– DATE : $(date) –” >> /REPORTS/Yum_Update_$(date +%d%m%y).txt
/bin/echo ”                                                            ” >> /REPORTS/Yum_Update_$(date +%d%m%y).txt
/bin/echo ”                                                            ” >> /REPORTS/Yum_Update_$(date +%d%m%y).txt
/bin/echo “#################################” >> /REPORTS/Yum_Update_$(date +%d%m%y).txts
/usr/bin/yum update -y >>  /REPORTS/Yum_Update_$(date +%d%m%y).txt
/bin/echo ”                                                            ” >> /REPORTS/Yum_Update_$(date +%d%m%y).txt
/bin/echo ”                                                            ” >> /REPORTS/Yum_Update_$(date +%d%m%y).txt
/bin/echo ”                                                            ” >> /REPORTS/Yum_Update_$(date +%d%m%y).txt
/bin/echo ”                                                            ” >> /REPORTS/Yum_Update_$(date +%d%m%y).txt
/bin/echo ”                                                            ” >> /REPORTS/Yum_Update_$(date +%d%m%y).txt
/bin/echo “Thanks & Regards” >> /REPORTS/Yum_Update_$(date +%d%m%y).txt
/bin/echo “Unixserveradmin.com Security Team” >> /REPORTS/Yum_Update_$(date +%d%m%y).txt
/bin/echo ”                                                            ” >> /REPORTS/Yum_Update_$(date +%d%m%y).txt
/bin/echo ”                                                            ” >> /REPORTS/Yum_Update_$(date +%d%m%y).txt

mutt -s “SERVER UPDATE REPORT $(hostname | tr ‘a-z’ ‘A-Z’)” -a /REPORTS/Yum_Update_$(date +%d%m%y).txt unixserv@unixserveradmin.com info@unixserveradmin.com < /REPORTS/msg6.txt

September 24, 2012 Posted by | Shell Script | | Leave a comment

Remote Desktop Connection Default Session Command

When I connect from Windows 7 PC to our Windows 2003 server using Remote Desktop Connection, RDC connect me to a different session. But I need to connect to the default admin session when I log in to the server physically because if I connect to a different session I could
not access my software agents that are already running and I cannot run two agents at the same time.

To overcome this issue I used the following command

mstsc /admin
or
mstsc /v:IP /admin

where IP is Windows servers IP.

September 19, 2012 Posted by | Windows | | Leave a comment

How to Check if antivirus software is working

To test if your anti-virus is working; create a new text file using notepad for example and paste the following line:

X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*

Save the file as ‘eicar.com’; your anti-virus should alert you as virus infection if its working as it should.

The file itself is very safe and is just a standard way to test anti-virus. EICAR stands for ‘European Institute for Computer Anti-virus research’. If your anti-virus software did not alert you then it should at least prevent you from running the file.

September 14, 2012 Posted by | Security, Tips & Tricks | , , | Leave a comment

How to check duplicate IP adderss in your subnet

Create and execute a script as shown below to check for duplicate IP in example: 192.168.1.0/24 subnet.

###############################################################
# /bin/bash #######################################################
# duplicate.sh #####################################################
##############################################################
for i in $(seq 1 254);
do
echo “arping -q -D -I eth0 -c 2 172.16.1.${i}”; [ $? -ne 0 ] && echo “172.16.1.${i} duplicate”;
done
##############################################################

September 9, 2012 Posted by | Security, Shell Script, Tips & Tricks, Unix/Linux | , , , , | Leave a comment

How to Check the Product ID / Serial Number of the HP blade

To Check on the Product ID

# dmidecode |grep ‘Product ID’
String 1: Product ID: 347957-B21

To Check on the Serial Number

# dmidecode |grep ‘Serial Number’
Serial Number: XXXXXXXXXX (For the Blade Server)
Serial Number: YYYYYYYYYY (For the Blade Chasis/Enclosure)
Or

# hpasmcli -s “show server” | grep ‘Serial’
Serial No. : XXXXXXXXXX

If not listed, then have to check the blade label physically.

September 4, 2012 Posted by | Tips & Tricks, Unix/Linux | , , | Leave a comment