Downloaded the latest image of Hasbian
Used Etcher to copy it to an SD card.
Plugged in an ethernet cable and the SD card and powered it up.
After a few minutes, I tried logging in as openhasbian with SSH.
When I logged in, I got the following:
ilogin as: openhabian openhabian@192.168.0.164’s password:
Linux openHABianPi 4.9.80-v7+ #1098 SMP Fri Mar 9 19:11:42 GMT 2018 armv7l
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Wi-Fi is disabled because the country is not set.
Use raspi-config to set the country before use.
Every 2.0s: cat /boot/first-boot.log openHABianPi: Tue Jan 1 17:38:21 2019
2018-03-13_22:53:38_UTC [openHABian] Starting the openHABian initial setup.
2018-03-13_22:53:38_UTC [openHABian] Storing configuration… OK
2018-03-13_22:53:38_UTC [openHABian] Changing default username and password… O
K
2018-03-13_22:53:38_UTC [openHABian] Setting up Ethernet connection… OK
2018-03-13_22:53:38_UTC [openHABian] Ensuring network connectivity… OK
2018-03-13_22:53:38_UTC [openHABian] Waiting for dpkg/apt to get ready… OK
2018-03-13_22:53:52_UTC [openHABian] Updating repositories and upgrading install
ed packages… FAILED
2019-01-01_17:26:54_UTC [openHABian] Initial setup exiting with an error!
When I CTL-C to exit that, and try to
sudo openhasbian-config
I get prompted for the password, and then get
“command not found”.
It might have been a typo when I started the topic.
But I did a copy/paste of your sudo, and still got the “command not found”
The reason I tried the apt update is to establish that I did have a good internet connection, and it was one of two commands in firstboot.sh that proceed the failure message in the firstboot.log.
Could you try typing it in, just to make sure there’s no issue with copy/paste. I know it sounds stupid but you should be able to use this command with no issue. If you would please post the link you downloaded the openhabian image from.
Earlier you were able to use sudo apt-get update, did you try sudo apt-get upgrade? I know it’s not recommended this way but at this point I think your safe to give it a try.
If you haven’t reformatted and re-flashed the SD card with a fresh image then I would start there. Make sure your using a good 5v 2.5A power supply and a solid Ethernet connection. For an RPI both of these could cause issues, during install, if not correct.
So far, each of the steps has worked when I run them with sudo manually. So it almost looks as if firstboot.sh is not running as root… so it is missing permissions.
The Pi and the power supply are good. The Pi is the one I use for testing new software, and has been very stable. And Etcher will take care of reformatting the SD.
And since I can do each step manually, I am pretty sure it isn’t the network connection (plus… I am running them via an SSH connection… and it isn’t having any issues).
I had similar experiences during first setup. In my case, using the WiFi was the critical point: WiFi needs to have the credentials PLUS some country settings AND the WiFi connection needs to be stable.
Check you Inet connection and DNS resolution. If your router isn’t properly setup to provide these, openHABian cannot reach the package repository which seems to be the step where it’s failing for you.
Thanks for the suggestion Markus. Somebody also suggested that. But the router and DNS are set up fine. I can ssh into the box, and run the exact same commands that failed in firstboot.sh. They run fine.
I manually ran all the rest of the commands from fristboot.sh, and they all ran fine also.
I had the same issue installing openhabian on a RPI last week. It turned out that the git checkout from github failed because the certificates had a timestamp in the future. Actually, the RPI does not have a real time clock and was off by a few months.
Try to use sudo date --set="3 Jan 2019". Then call the script manually or reboot using sudo reboot.
Hope it helps.