unable to do on yum

Latest response

Im trying to do yum update and yum repolist but no out put showing below error.

please look into below and suggest me soultion.

]# yum repolist
Loaded plugins: rhnplugin, security
Traceback (most recent call last):
File "/usr/bin/yum", line 29, in ?
yummain.user_main(sys.argv[1:], exit_code=True)
File "/usr/share/yum-cli/yummain.py", line 309, in user_main
errcode = main(args)
File "/usr/share/yum-cli/yummain.py", line 166, in main
base.doLock()
File "/usr/lib/python2.4/site-packages/yum/init.py", line 1135, in doLock
while not self._lock(lockfile, mypid, 0644):
File "/usr/lib/python2.4/site-packages/yum/init.py", line 1188, in _lock
if not msg.errno == errno.EEXIST: raise msg
OSError: [Errno 28] No space left on device: '/var/run/yum.pid'

Responses

Hello "Purchase Team",

The hint is in the last line:
No space left on device

Run the command df -Ph
and check if /var is full
If you cannot find /var, post the output of /df -Ph

Kind regards,

Jan Gerrit Kootstra

hi,

/var is at 100%

Dear "TCS Linux Team"

Try this

du -sk /var/*  | sort -nr  | head -15

Make note of the things at the top of that output. That command above will examine the directory named "/var" and will sort by the things that are "contributing" the most in terms of storage consumption under "/var".

Now whatever is at the top of the list is the "life of the party" and could be quite a number of directories that are under /var.

So you will then have to enter the subdirectory you found from the previous command above and run it against that directory. Let's say for the sake of discussion, the largest directory is either /var/log or /var/tmp (we really won't know until you run the command above). However for the sake of example if /var/log was the largest thing at the top of the du -sk /var/* | sort -nr command I cited above, then you could run this command:

du -sk /var/log | sort -nr | head -15
echo "NOTE: your largest directory under /var/ may not necessarily be /var/log, use the subdirectory you discovered from the previous command I cited above"

The top 15 largest "things" under /var/log would then be displayed. You'd want to focus on the items at the top.

You'd keep doing this for the top directories.

Now the top directory could be something other than the two examples I gave above, it could be /var/lib because that is a popular place for web servers to host tomcat files. However, this may or may not be your case.

Please post the ouput that ir. Jan Gerrit Kootstra above mention, and also post the output from the following:

du -sk /var/ | sort -nr

TAKE THE TOP directory FROM ABOVE AND ADD IT TO THE NEXT COMMAND

du -sk /var/DIRECTORYYOUFOUNDABOVE_NOT_IN_CAPITAL_LETTTERS


Now the actions you take to remedy this will depend, depending on whatever is filling your /var partition.

We are going to need more information to assist you. See what ir. Jan Gerrit Kootstra posted before me, and also return with the output I mentioned above. Someone ought to reply to you.

Please also provide the output from:

df -PhT /var

Regards

RJ

Also just in case, run

lsof | grep -i deleted

===

this was borrowed from James Radtke
  • it's worth mentioning that var can frequently have orphaned files (due to user/operator error). Typically the sysadmin gets a call about a full filesystem, which they identify as an application log (say catalina.out, for example) which then is handed off to the application team to clean up. The app-owner then runs rm /var/log/tomcat6/catalina.out - not realizing that the application had the file open...
# lsof | grep deleted

It is normal to see (deleted) a few times, but if you see some in /var that are sizeable, I would chase them down. Usually the "fix" is to simply restart the application that had the old file locked. Also - depending on your usage and/or standards you could consider disabling updatedb (/var/lib/mlocate/mlocate.db)

###end of text borrowed from James Radtke
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.