Apt-get upgrade FAILS on a brand new workspace

workspace

#1

I tried to apt-get update / apt-get upgrade a brand new workspace (for django), and I’ve got an error (below).

Errors were encountered while processing:
 udev
 initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)

And I can’t see any help in any other forum, SO or google search. So, if this error come from a brand new workspace, what I do now?

P.S.: I want to install MongoDB after this update/upgrade.


#2

If I am not mistaken, you should not perform an apt-get upgrade. Instead, just update normally with apt-get update and then install whatever else you need.


#3

Hi, BigChief45,

Thanks for your quick reply. I do this in my PHP workspace on C9, and ALL works well. I even remove PHP 5.x (preinstalled) and install PHP 7, and after some tricky configurations, all works well. Why not works in this “clean” workspace?

Best regards,


#4

This shell script will get around the udev / dpkg upgrade issue:

#!/bin/sh
[ ! "$(grep -A1 '### END INIT INFO' /etc/init.d/udev | grep 'dpkg --configure -a || exit 0')" ] \
&& sudo sed -i 's/### END INIT INFO/### END INIT INFO\
dpkg --configure -a || exit 0/' /etc/init.d/udev

You can run it with this command:

curl https://gist.githubusercontent.com/ryanpcmcquen/7ef4bf8dea788f73d82397c2b9d1d796/raw/udev_dpkg_workaround.sh | bash