[SOLVED] openHABian - Updating repositories and upgrading installed packages... FAILED

openhab2
Tags: #<Tag:0x00007f182f83f650>

(Joan Lorenzo) #1
  • Platform information: Rasp3
    • Hardware: ARM/Rasp3
    • OS: openHABian
    • openHAB version: 2.0 stable
  • Issue of the topic: [openHABian] Updating repositories and upgrading installed packages… FAILED

I found sometimes “mirrordirector.raspbian.org” is not working and you installation fails on the apt-get update / upgrade.

I got stuck 3 times until I found what was happening I want to share my fix (really simple) to avoid you to spend time looking for solution on Internet.

The error is: Updating repositories and upgrading installed packages… FAILED on the log file:

/boot/first-boot.log

The easy way is to connect your SD after image format to a linux computer, look for the apt-get sources (sources.list) and modify the http for a functional URL.

The other way is to wait to fail the installation, use ssh to connect to the raspberry and modify then the sources.list.

Anyway, you must do the next steps:

sudo vi /etc/apt/sources.list
  • Comment the first line:
#deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi
  • Add a new line using one of the web page working mirrors. I used as example:
deb http://ramses.wh2.tu-dresden.de/pub/mirrors/raspbian/raspbian/ jessie main contrib non-free rpi
  • Now simply reboot the raspberry:
sudo reboot

Now the installation process will continue after a OK on the updated packages.


(Hemendra Jain) #3

I am facing a similar issue:

Log snapshot

2018-08-12_04:49:18_UTC [openHABian] Storing configuration… OK
2018-08-12_04:49:18_UTC [openHABian] Changing default username and password… SKIPPED
2018-08-12_04:49:18_UTC [openHABian] Setting up Ethernet connection… OK
2018-08-12_04:49:18_UTC [openHABian] Ensuring network connectivity… OK
2018-08-12_04:49:18_UTC [openHABian] Waiting for dpkg/apt to get ready… OK
2018-08-12_04:49:26_UTC [openHABian] Updating repositories and upgrading installed packages… FAILED
2018-08-12_04:49:32_UTC [openHABian] Initial setup exiting with an error!

What I did ?

  1. sudo vi /etc/apt/sources.list

    Comment the first line:

#deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi

Add a new line using one of the web page working mirrors. I used as example:

deb http://ramses.wh2.tu-dresden.de/pub/mirrors/raspbian/raspbian/ jessie main contrib…

The above did not work

  1. From the file ‘first-boot.sh’, commented the entire section
    [openHabian] Updating repositories and upgrading install packages…


    echo “FAILED”; fail in_progress; fi

After that, again I get the same logs…


2018-08-12_04:49:18_UTC [openHABian] Storing configuration… OK
2018-08-12_04:49:18_UTC [openHABian] Changing default username and password… SKIPPED
2018-08-12_04:49:18_UTC [openHABian] Setting up Ethernet connection… OK
2018-08-12_04:49:18_UTC [openHABian] Ensuring network connectivity… OK
2018-08-12_04:49:18_UTC [openHABian] Waiting for dpkg/apt to get ready… OK
2018-08-12_04:49:26_UTC [openHABian] Updating repositories and upgrading installed packages… FAILED
2018-08-12_04:49:32_UTC [openHABian] Initial setup exiting with an error!


This indicates, my changes did not take place.

Img: openhabianpi-raspbian-201804031720-gitdba76f6-crc9e93c3eb.img
Raspberry Pi 3 B Model
32GB SD card - Sandisk

I used Ubuntu 16-04 . I had inserted the SD card (using a USB) into Ubuntu, make changes to the sources.list and first-boot.sh and booted Pi3 again.

Any help in this direction would be appreciated !!

Cheers,
H.Jain


(CM6.5 H102) #4

Never had this issue installing openhabian but here is a screen shot of my sources file. You may can copy the repo source and get it working. I do see you are using jessie and this is for stretch, it’ll either work or it won’t…:thinking:

Screenshot%20at%202018-08-12%2012-21-47

You may also be able to sudo openhabian-config and use the tools of openhabian. Look thru the options and find update or install the latest.


(Hemendra Jain) #5

OK. Will try that


(Hemendra Jain) #6

Hi All,
It turned out the issue was due to Incorrect Power Adapter.
I used a Power Adapter with Higher Current rating and everything started working properly.

Thank you All.

Cheers,
H. Jain


(Alejandro) #7

Hi, had the same issue, can you share with me the specs of the power adapter that worked for you please.

Appreciate it.


(Hemendra Jain) #8

Hi ,
Any adapter which has 2A rating would do.

Example, a Samsung usb mobile charger.

Rgds,

Hemendra Jain


(CM6.5 H102) #9

I recommend the power supply that comes with the RPI kit, 5v 2.5A. Using a 2A adapter may not be reliable, some list 2A but are really 1.7A. Just something to keep in mind.

The issue on this post can be found in several other topics with the solution being to replace the power supply.