LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   cannot check for updates using yum in centos,gives unusual error (https://www.linuxquestions.org/questions/linux-newbie-8/cannot-check-for-updates-using-yum-in-centos-gives-unusual-error-937858/)

SarahGurung 04-03-2012 05:43 AM

cannot check for updates using yum in centos,gives unusual error
 
Hi again,

2day i tried checking for updates using the yum command in one of the name servers where centos is installed and it gave the following error:

Code:

Cannot open logfile /var/log/yum.log
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
   
  File "/usr/share/yum-cli/yummain.py", line 166, in main
   
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 1150, in doLock
   
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 1203, in _lock
   
OSError: [Errno 30] Read-only file system: '/var/run/yum.pid'

Can anyone please tell me what has happened...i cant see anything in the logs either..

it says can't open var/log/yum.log but when i check it i can read it and even the permissions are correct and i cant evn edit the .bash_profile.

but ya the server is up and running..

acid_kewpie 04-03-2012 05:56 AM

sounds like something is shafted on your disk, esp as you added you can't edit .bash_profile either. Run "dmesg", and you might see a pile of filesystem errors. Probably best to reboot the system and allow the fsck to scan the filesystem for errors, but obviously that depends *MASSIVELY* on what has actually gone on... It certainly could be very serious...

SarahGurung 04-03-2012 06:18 AM

ya it gives following message wen i go to try to use service command n all
Code:

-bash: /root/.bash_profile: Input/output error
Can you please tell me how should i go about it?i don't know much abt dmesg and fsck also. I would be really grateful.

SarahGurung 04-03-2012 06:29 AM

oh ya i ran dmesg command and it showed the following error:

Code:

end_request: I/O error, dev hda, sector 30608136
And i cant even write the error messages to a file which is usually possible with dmesg.

Can you please tell me what kind of error is that n wat should i do?

acid_kewpie 04-03-2012 06:40 AM

well, i already have. Something in that filesystem is shafted. How much, I couldn't say. Personally, *I* would reboot and hold my breath.

SarahGurung 04-03-2012 07:05 AM

Oh wow..

I rebooted the server and now it worked,i even updated it.

ya i could edit my .bash_profile also,paths were missing and i added that by copying it from other user because i still don't know what kind of system path should we b giving. If you could explain me or provide me a link to study that,i would b really glad..

N do u have any idea why did that error happen before?i'm so confused..

lithos 04-03-2012 07:14 AM

2answr U in Ur language:

ur hard disk is failin.


And now seriously:
Probably your hard disk is having BAD sectors that is why you should check it if you can shutdown the server and run some diagnostics on hard drive.

good luck

chrism01 04-04-2012 12:44 AM

The key msg was
Code:

OSError: [Errno 30] Read-only file system: '/var/run/yum.pid'
so, obviously you can't write to a read-only partition.
You need to fsck that partition, either manually by taking it off-line or by setting it to check in /etc/fstab, especially if this is the root partition; it can't be done online.
http://linux.die.net/man/8/fsck


All times are GMT -5. The time now is 08:25 PM.