How to upgrade Ubuntu on Digital Ocean
When canonical release a new version of Ubuntu, you are prompted to run this command to upgrade.
Running this command on a Digital Ocean droplet will give you the following warning.
“Some third party entries in your sources.list were disabled. You can re-enable them after the upgrade with the ‘software-properties’ tool or your package manager.”
You can continue the upgrade but it will fail and roll-back to the previous version. The error you are given includes the following phrase.
“the essential package ‘ubuntu-minimal’ could not be located”.
The fix is to prevent the upgrade from disabling third party package repositories. I run into this issue every time I upgrade, but upgrades are infrequent enough that I can never remember the fix.
Your upgrade should now complete without further issue.
This occurs because Digital Ocean droplets use mirrors of the official package repositories. You can confirm this by looking in
/etc/apt/sources.list. During the upgrade, Ubuntu identifies these third party repositories and disables them. This is presumably a security feature.
With the repositories disabled, the upgrade is unable to locate the
ubuntu-minimal package. As this package is required for the upgrade, the process fails and is rolled back.
Setting the environment variable above keeps third party repositories active during the upgrade. This allows the download of required packages.
Curious as to why Digital Ocean might mirror the official package repositories? I can think of two reasons; to reduce bandwidth costs, and to improve download speed. They have more than a few instances of Ubuntu to update.
I’m very happy with Digital Ocean as a hosting provider. Get $100 in credit to use over 60 days by using my referal link. Stuck for ideas on what you can use it for? Contact me.