OpenWrt Forum Archive

Topic: opkg fails to obtain administrative lock

The content of this topic has been archived on 15 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello,

I recently tried to install iptraf using opkg update && opkg install iptraf. The installation failed somehow (no logs available by now). I think it might be something regarding available free diskspace.

Now if I try to opkg update I get the following error:

root@OpenWrt:/# opkg update
Collected errors:
 * Could not obtain administrative lock
root@OpenWrt:/#

I even tried "opkg -V 3 update" but there is no additional output.

"df" says:

Filesystem           1k-blocks      Used Available Use% Mounted on
rootfs                    1472      1472         0 100% /
/dev/root                 1472      1472         0 100% /rom
tmpfs                     6848        68      6780   1% /tmp
tmpfs                      512         0       512   0% /dev
/dev/mtdblock3            1536      1460        76  95% /jffs
mini_fo:/jffs             1472      1472         0 100% /

I'm looking forward that someone might help me to make a reinstall evitable.

Merry Christmas & Greetings

Jan

there is a "lock" file somewhere
could be /usr/lib/opkg
or under /tmp/lock

Post what you finde

oxo wrote:

there is a "lock" file somewhere
could be /usr/lib/opkg
or under /tmp/lock

Post what you finde

Thanks a lot.

/usr/lib/opkg/lock was what I was looking for. I deleted that file and everything is working again.

Best regards

Jan

Hi,

I have the same problem but removing the lock file in /usr/lib/opkg did not work. And I found no other lock file which can cause the error.

ps command did not say about another opkg running...

I'm on kamikaze 8.09 on wrt54gl

any1 any ideas?

Regards

Olaf

I have been seeing the same problem.  I have one package with a 'postrm' script that calls 'opkg remove' on multiple other packages.  Opkg calling opkg...which makes sense why the lock exists.

I decided to remove the lock and see what happens.  Opkg removes the packages correctly but does not update its package list accordingly.  So, if I do an 'opkg list_installed | grep pkg' then opkg still believes the package exists, but in reality all binaries related to that package have been removed.

Tips anyone?

I used to have the same problem.
Unfortunately I don't remember what finally helped me, but you could try this:
Add the following two lines to the opkg.conf:

option force_space
option overlay_root /jffs

None of these suggestions helped to avoid the error. Opkg still quits on me with a "Could not obtain administrative lock" and everytime it generates the /usr/lib/opkg/lock file again, even if I manually remove it. I'm using the daily snapshot for etrax (foxboard).

Hi,I'm having the same problem with my etrax (foxboard) built from yesterday svn trunk... ^^

Hi
I am running kamikaze 8.09 on rb433ah and when i do :

#opkg install helloworld _1_mips.ipk
I get :
Collected errors:
* Could not obtain administrative lock

I tried deleting lock file in /tmp/ and there is no lock in /usr/lib/opkg but still i get same error

i do df -h and get
FileSystem     Size        Used      available   use%   Mounted on
rootfs             1.3M       1.3M        0           100%     /
/dev/root        1.3M       1.3M       0            100%    /
tmpfs             62.2M      40.0K     62.2M       0%    /tmp
tmpfs             512.0K    0            512.0K      0%    /dev

I think RB433ah has 64MB flash so Iam confused where is the rest of it...?
I haven't got much idea about all this.
someone help me out in finding whats going on?

thanx
savitri negi

Oh, I forgot to mention my fix.  The problem for me was during the removal process.  Since the packages were on the mini_fo overlay, the packages that were causing this problem were referencing /var/, but the overlay doesnt know about /var/, and thus I modified the info.list file to not reference those (since its just a memory location).  It seemed to work for me...so I ran this script before removal.

# Remove any references to /var/ otherwise opkg
# passes in NULLs to the FS overlay system
for I in /usr/lib/opkg/info/*; do
        sed '/var/d' $I > /usr/lib/opkg/info/bak.txt
        mv /usr/lib/opkg/info/bak.txt $I
done

hi
do you think the result that
#df -h
FileSystem     Size        Used      available   use%   Mounted on
rootfs             1.3M       1.3M        0           100%     /
/dev/root        1.3M       1.3M       0            100%    /
tmpfs             62.2M      40.0K     62.2M       0%    /tmp
tmpfs             512.0K    0            512.0K      0%    /dev

shows is correct?
because Iam confused if it is really a space issue as some members have suggested ..
Because Iam not able to see the 64MB space of my flash all i see is 1.3 MB ,,,
any idea whats gone wrong?
savitri negi

hi siris
when i tried as suggested by you
i get /bin/ash: cannot create /usr/lib/opkg/info/bak.txt :permission denied
dont jnow whats wrong?

Oh, I was using a Bash shell, not ash, I am also running as root.  It looks as though you don't have permission to write to the directory for the backup file.  You need to run as root, or you could place the backup file in /tmp/ then copy it as a root user.

(Last edited by siris on 25 Jan 2011, 21:00)

Just reading up, it looks like you are trying to install your package to / which is full.  What does "cat /etc/opkg.conf" provide.  You probably have to modify that to inform opkg to install your packate to your /tmp/ tmpfs mount.

hi
thanx siris .I guess the problem  was in writing to / and it was full .df -h also was showing 100% usage so you are right,
I tried writting to NAND using wget2nand script and now it all works fine ..  and it shows whole of 64MB NAND flash space too.. I think the problem was with the filesystem itself..
thanx to you again for pointing me to the right direction because its all new to me..
Now Iam trying to use wireless card on mini PCI R52 ,my board detects it and Iam even able to set its IP address but not able to ping outside same is with eth1 and eth2 ,,any idea whats wrong?
eth0 is working fine.
thanx
savitri

Hi,

It's my first post, to resolve the problem from update package list with error 1024, I simply delete every part of this package manualy.
It was easy to delete aircrack-ng, If you know the last package caused this eror, follow the solutions above in this thread, and you can try with the find command to search any references.
Simply delete with rm and rm -R command.

I hope ttjat's help you to solve it.

thanks to everyone to work around on this issue.

(Last edited by forum73 on 1 Nov 2011, 06:29)

The discussion might have continued from here.