Jump to content

Banner.jpg.b83b14cd4142fe10848741bb2a14c66b.jpg

All Sky Camera Revisited


Gina

Recommended Posts

gina@asc:~/AstroPi3$ ls /var/lib/dpkg
alternatives  diversions      lock           statoverride  triggers
available     diversions-old  lock-frontend  status        updates
cmethopt      info            parts          status-old
gina@asc:~/AstroPi3$ sudo rm /var/lib/dpkg/lock
gina@asc:~/AstroPi3$ ls /var/lib/dpkg
alternatives  diversions      lock-frontend  status      updates
available     diversions-old  parts          status-old
cmethopt      info            statoverride   triggers
gina@asc:~/AstroPi3$ sudo ./setupAstroPi3.sh

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Welcome to the AstroPi3 Raspberry Pi 3 Ubuntu-Mate KStars/INDI Configuration Script.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ This will update, install and configure your Raspberry Pi 3 to work with INDI and KStars to be a hub for Astrophotography. Be sure to read the script first to see what it does and to customize it.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Are you ready to proceed (y/n)? y
dpkg is currently locked, meaning another program is either checking for updates or is currently updating the system.
Please wait for a few minutes or quit the other process and run this script again.  Exiting now.
gina@asc:~/AstroPi3$ ls /var/lib/dpkg
alternatives  diversions      lock           statoverride  triggers
available     diversions-old  lock-frontend  status        updates
cmethopt      info            parts          status-old
gina@asc:~/AstroPi3$ 

I get rid of it and confirm that but it comes back before or when the script is run!!

Edited by Gina
Link to comment
Share on other sites

I can try that though I have rebooted a few times.  Trouble is... with Ubuntu Mate the Terminal history is not saved over reboots (unlike Mint) so I run Firefox to copy the commands from.  Could that be the problem - hasn't been before and I've used this process several times in the past though on v16.04.02 rather than 18.04.02.

Link to comment
Share on other sites

Tried a reboot, ran Firefox to copy command lines to Terminal and tried removing the lock file without success as before.  Then closed Firefox so that couldn't interfere and tried again but no joy.  rm removed lock file and checked with ls followed by running the script and got the same lock error.

Link to comment
Share on other sites

Recent releases of Ubuntu do a check to see if there are updates pretty much as soon as you log in.  It may be possible to disable that in the settings, but I don't know.  My recollection is that there's a process running called "unattended-upgrade" or something like that, and potentially a process called "http" owned by the "_apt" user.  It's all a bit of a faff, but I found it easiest just to let it finish.  Shouldn't take long these days, surely, now you have bandwidth coming out of your ears :D

If your terminal command history isn't being saved, it's possibly because the variables controlling it are not set up.  Probably the first place to start is to run

$ set -o | grep history

If that says "history off" then you possibly need to add "set -o history" to the end of your $HOME/.bashrc file.

James

Link to comment
Share on other sites

Not sure what other processes there may be that are involved off the top of my head.  If the lock file is effectively being recreated when you remove it there must be something doing it, but what that process might be is hard to say.

If you can find the "software and updates" settings you can probably disable automatic updates there.  A reboot should then get you the system back without it running.

James

Link to comment
Share on other sites

After a quick check to see if we're ready, the script starts off with a test of dpkg and the error message is coming from the script.  Script file is HERE

This is the relevant section :-

## check if DPKG database is locked
dpkg -i /dev/zero 2>/dev/null
if [ "$?" -eq 2 ]
then
    echo "dpkg is currently locked, meaning another program is either checking for updates or is currently updating the system."
    echo "Please wait for a few minutes or quit the other process and run this script again.  Exiting now."
    exit
fi

 

Edited by Gina
Link to comment
Share on other sites

Seems to me the easiest option would be to go for the previous version of Ubuntu Mate and start over as there are several things wrong with the way the current system works.

Link to comment
Share on other sites

12 hours ago, Gina said:

After a quick check to see if we're ready, the script starts off with a test of dpkg and the error message is coming from the script.  Script file is HERE

This is the relevant section :-


## check if DPKG database is locked
dpkg -i /dev/zero 2>/dev/null
if [ "$?" -eq 2 ]
then
    echo "dpkg is currently locked, meaning another program is either checking for updates or is currently updating the system."
    echo "Please wait for a few minutes or quit the other process and run this script again.  Exiting now."
    exit
fi

 

I suspect this dpkg command will always return a status of 2

On my Ubuntu 18.10 system:

$ sudo dpkg -i /dev/zero
dpkg: error: archive '/dev/zero' is not a regular file
$ echo $?
2

Try commenting this section out and try again.

In case anyone is unaware the command echo $? returns the exit status of the last executed command. A command that executes successfully should return a zero :)

 

Edited by tekkydave
  • Thanks 1
Link to comment
Share on other sites

With dpkg running in another window (via the Synaptic Package Manager) I get:

$ sudo dpkg -i /dev/zero
dpkg: error: dpkg frontend is locked by another process
$ echo $?
2

This correctly returns a non-zero result. No idea why it doesn't when dpkg isn't running.

  • Like 1
Link to comment
Share on other sites

Hmm... the date on the script file is 2018 so it may be that I used an earlier version of the script.  Since the system is new and there should be nothing running when I try to run the script, I see no reason to check dpkg but Robert Lancaster (the author) knows much more about these things than me.

Link to comment
Share on other sites

I can email him and also he used to be available on the INDI forum where I'm a member.  Meanwhile, I've written Ubuntu Mate 16.04 to the card and will try that.

Link to comment
Share on other sites

I would suggest that the script is incorrect.  dpkg can return an error code of 2 for any fatal error, not just if the system is locked by another process managing packages.  As the dpkg command in the script is an attempt to install from a file that isn't an actual package, that's a fatal error too.  Not really a smart way to go about checking :(

I've just checked and it behaves exactly the same way on Ubuntu 16.04, so I imagine the script will probably also fail there.

If you're happy that nothing is attempting to manage packages, I'd just comment that test out of the install script, Gina.

James

  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.