Apt-get upgrade FAILS on a brand new workspace



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:
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.


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.


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,


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

[ ! "$(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