Ahoy there! This is my personal blog which I use as my memory extension and a medium to share stuff that could be useful to others.

Failure in yum update


On RHEL 6 (Santiago), a “yum update” fails with the following error:

Error: failed to retrieve repodata/filelists.xml.gz from rhel-x86_64-server-6
       error was [Errno -1] Metadata file does not match checksum
You could try using –skip-broken to work around the problem
You could try running: rpm -Va –nofiles –nodigest

And trying the suggestions above did not help.

Background & Analysis:

Yum uses a cache directory to speed up its operations. Sometimes, the cache could become corrupted.


1.  Clean the cache directory as shown below:

sudo yum clean all

2.  Rebuild the cache directory as shown below: 

sudo yum makecache

3.  Perform a yum update as shown below: 

sudo yum update

Root Cause:

Corrupted yum cache directory

(1) The solution above describes a successful problem-solving experience and may not be applicable to other problems with similar symptoms.

(2) Your rating of this post will be much appreciated as it gives me and others who read this article, an indication of whether this solution has worked for people other than me. Also, feel free to leave comments.


VN:F [1.9.22_1171]
Rating: +7 (from 7 votes)

Under normal working conditions, when SNMP Managers query SNMP agents (snmpd) on RHEL 6, several lines of information similar to the following are logged into syslog:

 May 27 17:39:14 MyLinuxHost snmpd[1521]: Connection from UDP: []:54907->[] 

As snmpd is typically queried frequently, your syslog (e.g. /var/log/messages) will be filled with several such informational lines as this can lead to “noise” and is truly not required.

SNMP Logging Levels are given below:

0 Emergencies – System is unusable
1 Alerts – Immediate action needed
2 Critical – Critical conditions
3 Errors – Error conditions
4 Warnings – Warning conditions
5 Notifications – Informational messages
6 Informational – Normal but significant conditions
7 Debugging – Debugging messages

By default, SNMP on RHEL 6 has logging levels 0-6 enabled. The redundant information in the logs is logged at level 6. Given below are steps to disable these informational messages for SNMP on RHEL 6:

STEP 1:Modify the SNMP Logging Level

Edit /etc/init.d/snmpd and modify the OPTIONS variable to reflect logging levels 0-5 as shown below:

 OPTIONS="-LS0-5d -Lf /dev/null -p /var/run/snmpd.pid" 

STEP 2:Restart the SNMP service

Restart the SNMP service for the changes to take effect:

 sudo service snmpd restart 
VN:F [1.9.22_1171]
Rating: +17 (from 23 votes)

Given below are some tips from my scratchpad on working with files and directories in PowerShell. These are just basic tips and by no means exhaustive. Check out the book “Windows PowerShell in Action” by Bruce Payette, an excellent book on PowerShell authored by the lead developer of the language.

# Directory Listing

    Directory: C:\POWERSHELL

Mode                LastWriteTime     Length Name
----                -------------     ------ ----
-a---        12/29/2010  12:01 PM       1929 PowerShellTips.ps1
-a---        12/29/2010  10:40 AM         50 test1.txt

# Number of files in a directory
PS C:\POWERSHELL> (dir).count
PS C:\POWERSHELL> (dir).length
# Number of files matching a pattern
PS C:\POWERSHELL> (dir *.ps1).count 

# Number of lines in a file
PS C:\POWERSHELL> ${C:PowerShellTips.ps1}.length
PS C:\POWERSHELL> (Get-Content .\PowerShellTips.ps1).length
PS C:\POWERSHELL> (Get-Content .\PowerShellTips.ps1).count

# Largest file in a directory
PS C:\POWERSHELL> dir | Sort-Object -property length -Descending | Select-Object -first 1 | foreach-object {$_.length}

# Files created in the last 31 days
PS C:\POWERSHELL> dir | ?{$_.lastwritetime -ge ([datetime]::Now).AddDays(-31)} | %{"I am " + $_.Name}
I am PowerShellTips.ps1
I am test1.txt

PS C:\POWERSHELL> dir | %{if ($_.lastwritetime -ge ([datetime]::Now).AddDays(-31)) {"I am " + $_.Name}}
I am PowerShellTips.ps1
I am test1.txt
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Given below are useful tips on PowerShell DateTime operations (from my 2010 scratchpad):

# Get Formatted DateTime
PS C:\> Get-Date -Format "dd/MM/yyyy"

PS C:\> $(Get-Date -Format "yyyyMMddHHmmss") + ".log"

# Time till New Year
PS C:\> $now = [datetime]::Now
PS C:\> [datetime] ([string] ($now.Year+1) + "-01-01") - $now

Days              : 3
Hours             : 17
Minutes           : 14
Seconds           : 28
Milliseconds      : 970
Ticks             : 3212689708670
TotalDays         : 3.7183908665162
TotalHours        : 89.2413807963889
TotalMinutes      : 5354.48284778333
TotalSeconds      : 321268.970867
TotalMilliseconds : 321268970.867

# Days between dates
PS C:\> [string] $([datetime] "01/26/2010" - [datetime] "01/01/2010").Days + " Days"
25 Days

# DateTime Comparison
PS C:\> [datetime]::Compare([datetime] "01/01/10", [datetime] "01/01/11")
PS C:\> [datetime]::Compare([datetime] "01/01/10", [datetime] "01/01/09")
PS C:\> [datetime]::Compare([datetime] "01/01/10", [datetime] "01/01/10")
PS C:\> [datetime]::Compare([datetime] "01/01/10 20:00", [datetime] "01/01/10 19:00")

# Add and Subtract Time
PS C:\> [datetime]::now

December-28-10 11:01:17 AM

PS C:\> ([datetime]::now).AddHours(1)

December-28-10 12:01:37 PM

PS C:\> ([datetime]::now).AddHours(-1)

December-28-10 10:01:42 AM
VN:F [1.9.22_1171]
Rating: +2 (from 2 votes)

Given below are three methods (there could be more) of determining your Hostname in PowerShell:


# Fastest method


# Slowest method
PS C:\> $(Invoke-Expression hostname)


PS C:\> [System.Net.Dns]::GetHostName()

VN:F [1.9.22_1171]
Rating: +6 (from 6 votes)
 Page 5 of 33  « First  ... « 3  4  5  6  7 » ...  Last »