[Ubuntu-SG] Broken packages...database are is locked by another process

Muhammad Heidir md.heidir at gmail.com
Mon Aug 16 22:36:02 UTC 2010


On Sun, 2010-08-15 at 22:12 +0800, Wilson Jason wrote:

> I have a question for you dun mind?
> 
> I was trying to get an update and it stalled in both the repository
> and in the x terminal 
> 
> I am trying to download packages to enable multi media support
> 
> it seems that something is broken etc?
> 
> dpkg: status database area is locked by another process
> jason at jason-desktop:~$ ” rm /var/lib/dpkg/lock ”
> ”: command not found
> jason at jason-desktop:~$ rm/var/lib/dpkg/lock
> bash: rm/var/lib/dpkg/lock: No such file or directory
> jason at jason-desktop:~$ "rm/var/lib/dpkg/lock"
> bash: rm/var/lib/dpkg/lock: No such file or directory
> jason at jason-desktop:~$ rm/var/cache/apt/archives/lock
> bash: rm/var/cache/apt/archives/lock: No such file or directory
> jason at jason-desktop:~$ 
> 
> 
> --- On Sat, 14/8/10, Muhammad Heidir <md.heidir at gmail.com> wrote:
> 
>         
>         From: Muhammad Heidir <md.heidir at gmail.com>
>         Subject: Re: [Ubuntu-SG] General questions
>         To: "Wilson Jason" <wlsn_jason at yahoo.com.sg>
>         Date: Saturday, 14 August, 2010, 5:08 PM
>         
>         
>         On Sun, 2010-08-15 at 01:05 +0800, Wilson Jason wrote:
>         
>         > mash'Allah!
>         > 
>         > You are the man~!!! 
>         > 
>         > I owe you dinner after Ramadhan! 
>         > 
>         > Thanks allot~
>         > 
>         > --- On Sat, 14/8/10, Muhammad Heidir <md.heidir at gmail.com>
>         > wrote:
>         > 
>         >         
>         >         From: Muhammad Heidir <md.heidir at gmail.com>
>         >         Subject: Re: [Ubuntu-SG] General questions
>         >         To: "Wilson Jason" <wlsn_jason at yahoo.com.sg>
>         >         Date: Saturday, 14 August, 2010, 11:01 AM
>         >         
>         >         On Sat, 2010-08-14 at 20:16 +0800, Wilson Jason
>         >         wrote:
>         >         
>         >         >         > .
>         >         >         > 
>         >         >         > 1) Open Terminal
>         >         >         > 2) Copy and paste the following line: 
>         >         >         >      echo 'SUBSYSTEM=="usb",
>         >         >         > SYSFS{idProduct}=="1446",
>         >         >         > SYSFS{idVendor}=="12d1", RUN
>         >         >         > +="/lib/udev/modem-modeswitch --vendor
>         >         >         > 0x12d1 --product 0x1446 --type
>         >         >         > option-zerocd"' | sudo
>         >         >         > tee /etc/udev/rules.d/45-huawei1550.rules
>         >         >         > 
>         >         >         > Try it out and tell me if it works!
>         >         >         > 
>         >         >         > Muhammad Heidir
>         >         >         > 
>         >         >         > Launchpad: ~heidir
>         >         >         > Team Ubuntu Singapore 
>         >         >         > 
>         >         >         > 
>         >         >         > I am still having some real challenges
>         >         >         > in getting any connection it's actually
>         >         >         > quite frustrating.   zerocd"' | sudo   <
>         >         >         > On this is the command zerocd'" or
>         >         >         > zerocd" or zerocd' ? also I could not
>         >         >         > find the straight line symbol on my
>         >         >         > keyboard prior to sudo   I have tried
>         >         >         > plugging my starhub in waiting until I
>         >         >         > see the green icon and than hitting
>         >         >         > eject, I than went to the System Network
>         >         >         > connections Mobile Broadband Prepaid
>         >         >         > services     The problem with this
>         >         >         > method is that the person who suggested
>         >         >         > said after I hit the eject button my
>         >         >         > mobile broadband would just turn green
>         >         >         > or light up showing connection it has
>         >         >         > never done that.   I appreciate you guys
>         >         >         > helping me on this as I am really
>         >         >         > interested in getting online and it's
>         >         >         > quite frustrating.
>         >         > 
>         >         
>         >         
>         >         Hi Wilson,
>         >         
>         >         1. Have you tried copying the command and pasting it
>         >         onto the Terminal? If possible try not to type out
>         >         the command, just highlight the whole command and in
>         >         Terminal press the following button combination to
>         >         paste (Ctrl + Shift + V)
>         >         2.  It is zerocd"' = zerocd + double qoute + single
>         >         qoute
>         >         3. The symbol | is on the button \ remember to press
>         >         (Shift + \)
>         >         
>         >         If the above still too troublesome for you, then
>         >         copy the attachment and place it in the
>         >         folder /etc/udev/rules.d/
>         >         Make sure you have root access to copy into the
>         >         folder.
>         >         
>         >         Once you have done the above in the Terminal, plug
>         >         in the dongle. Ubuntu should be able to detect the
>         >         device and then will prompt you to enter some
>         >         information regarding the Internet connection such
>         >         as carrier (Starhub, Singtel, M1) and type of plan
>         >         (Postpaid, Prepaid).
>         >         
>         >         Please keep me posted so I know whether it works for
>         >         you. Thanks!
>         >         
>         >         Muhammad Heidir
>         >         
>         >         Launchpad: ~heidir
>         >         Team Ubuntu Singapore 
>         >         
>         >         
>         >         
>         >         
>         > 
>         
>         
>         Hi Wilson,
>         
>         Great news! No need to treat me dinner. As long as it works
>         and you are using Ubuntu brings me great joy!
>         
>         Happy Ubuntuing!
>         
>         Muhammad Heidir
>         
>         Launchpad: ~heidir
>         Team Ubuntu Singapore 
>         
>         
>         
> 


Hi Wilson,

I'm CC'ing this to the mailing list for reference purposes.

This problem usually arises when:

1. Running 2 apt-get install commands at the same time
For apt-get to work, only 1 process should be running. In case you want
to install multiple software at the same time, just append it in the
command:
       $ sudo apt-get install firefox chromium gnome-do

2. When apt-get update process is terminated before it was able to
complete update progress
When an update is in progress, apt-get will download files from the
source and checks with current configuration. When this process is
terminated, it was not completed cleanly and residues are left which
causes the error

Resolving the issue:
Since we know that there are residues left, the only logical way is to
delete the contents at the stored location. In this
case, /var/lib/dpkg/lock

This location is protected by root user. So in order to remove the file
'lock' you need to use sudo to remove it.
    $ sudo rm /var/lib/dpkg/lock

    sudo = run the command as root/superuser
    rm = the command to remove the file/directory
    /var/lib/dpkg/lock = the directory and the file to delete, directory
= /var/lob/dpkg, file = lock

    $ sudo rm /var/cache/apt/archives/lock
    
    similar to the latter command, in this case directory
= /var/cache/apt/archives, file = lock

    The first deletion will remove files that was being used when
performing update
    The second deletion remove files to install which was not completely
downloaded

I would suggest you learn a bit of Linux bash/command line syntax so
that you are able to grasp and understand a bit to work your way around
Linux environment.

Linux Command Syntax:
 $ = user shell
 # = root shell (administrative power that is dangerous if not used
correctly

$ command [OPTION] [FILE]
This refers to simple commands such as rm (remove/delete), cp (copy),
mv(move/rename)

You can access the manual to learn how to use the commands in Terminal,
just type:
 $ man rm

man = manual
rm = the command you want to learn more about

Hope these help!

Muhammad Heidir

Launchpad: ~heidir
Team Ubuntu Singapore 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-sg/attachments/20100817/32d27f28/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/ubuntu-sg/attachments/20100817/32d27f28/attachment.sig>


More information about the Ubuntu-SG mailing list