14

I am a newbie in this operating system

I installed Ubuntu 12.10 and I found it very interesting to use.

Then once I install chromn from ubuntu software I got

I/O Error

After that I could not install any application.

sudo apt-get install unrar
W: Not using locking for read only lock file /var/lib/dpkg/lock
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.

When I type

sudo dpkg --configure -a
dpkg: error: unable to access dpkg status area: Read-only file system

I have tried many solutions like

sudo apt-get autoremove && sudo apt-get clean && sudo apt-get autoclean
W: Not using locking for read only lock file /var/lib/dpkg/lock
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.

No used, I am really need your help.

Thank

5 Answers 5

8

Try using:

sudo mount -o remount /dev/sda1

If sda1 is your hard disk.

6
  • 1
    I got this error mount: cannot remount block device /dev/sda6 read-write, is write-protected
    – sayvortana
    Mar 19, 2013 at 9:34
  • Can you post the result of: mount -l
    – smile
    Mar 19, 2013 at 9:45
  • It just show mount: cannot remount block device /dev/sda6 read-write, is write-protected
    – sayvortana
    Mar 19, 2013 at 9:50
  • Ok, can you create a file? for example doing: touch test and on the other hand, can you paste your /etc/fstab?
    – smile
    Mar 19, 2013 at 9:53
  • Thank smile, After I delete /var/lib/dpkg/lock I could install application again If there are any error I will post it
    – sayvortana
    Mar 19, 2013 at 10:02
7

Try deleting the lock file i.e

/var/lib/dpkg/lock

and then run

dpkg --reconfigure -a

This error;

E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. 

causes when software upgrade is interrupted.

You can also follow this link!

6
  • I think deleting the lock file do the trick After I delete this lock file I could install apt-get install unrar
    – sayvortana
    Mar 19, 2013 at 9:58
  • I could not vote you up since I don't have enough reputation THank
    – sayvortana
    Mar 19, 2013 at 9:59
  • I tried to install another software I got fopen: Input/output error debconf: DbDriver "config": could not write /var/cache/debconf/config.dat-new: Read-only file system dpkg: error processing man-db (--unpack): subprocess installed post-installation script returned error exit status 1 Processing triggers for hicolor-icon-theme ... dpkg: unrecoverable fatal error, aborting: unable to flush updated status of hicolor-icon-theme': Read-only file system touch: cannot touch /var/lib/update-notifier/dpkg-run-stamp': Read-only file system E: Sub-process /usr/bin/dpkg returned an error code (2)
    – sayvortana
    Mar 19, 2013 at 10:49
  • You cannot delete the lock with read-only file system, so this is certainly not a complete solution and I guess the lock will be automatically removed when I make the fs writeable.
    – inf3rno
    Jun 8, 2017 at 11:26
  • 1
    says cannot remove Read-only file system; I tried sudo rm /var/lib/dpkg/lock -f
    – CTS_AE
    May 2, 2019 at 6:18
3

try this

sudo mount / -o remount,rw 

then run:

sudo dpkg --configure -a
2

Since both the solutions are half complete I added mine based on them. I had this problem by pressing ctrl+c while running a do-release-upgrade.

I used lsblk or fdisk -l to find out which is the partition I need to remount, let's call it /dev/x and it was mounted to /.

I used dmesg to find out whether there was any problem with the partition. I used fsck /dev/x to fix errors if there was any and mount / -o remount,rw to remount the partition in read & write mode.

After that I run pkill dpkg and finally dpkg --reconfigure -a.

0
    if command -v dpkg &>/dev/null;then
      if [ ! -d /var/lib/dpkg ];then
        mkdir -p /var/lib/dpkg/updates  /var/lib/dpkg/info
        touch /var/lib/dpkg/status /var/lib/dpkg/info/format-new
      fi
       dpkg --configure -a
    fi
    

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .