I recently had the pleasure of upgrading my ubuntu system from 18.04 to 18.10. I went via the commandline:
sudo do-release-upgrade and unfortunately I had an internet connection issue halfway through downloading packages. What made the situation worse was that I went and cancelled the upgrade via a Ctrl + c misclick! Long story short, my system was stuck pretending to be 18.10 and I went down a rabbit hole of cleaning up my package repository sources. Fortunately, I managed to get everything back to square 1 and finish the upgrade. The following are my notes from this escapade regarding debian-based systems and software repositories.
.distUpgradefile for all the repository list files.
sources.listor by emptying the contents of the external source repo
Thus, one of the first steps that I needed to do to restore my system was to move the
.distUpgrade to their original configuration:
sudo mv /etc/apt/sources.list.distUpgrade /etc/apt/sources.list
Next I went and removed older external repositories that I didn't need. Removing a repository can be done by either commenting out the repository by preceding the line with a
# character, or simply deleting the relevant
.list file, e.g.
sudo rm /etc/apt/sources.list.d/heroku.list*. Once the repostories are cleaned up, the
sudo apt update command can be run to refresh the package cache.
As it turns out, I had quite a few issues with some of the older repositories:
N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'http://dl.google.com/linux/chrome/deb stable InRelease' doesn't support architecture 'i386'
This can be fixed by specifying the architecture in the source definition:
deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main.
W: GPG error: http://repo.mongodb.org trusty/mongodb-org/3.2 Release: The following signatures were invalid: BADSIG D68FA50FEA312927 MongoDB 3.2 Release Signing Key
This means that the signing key was invalid or expired. This can be fixed by updating the signing keys:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927.
Finally, I also wanted to clean up repository signatures. This is unfortunately not quite simple at the time of writing. The commands are as follows:
sudo apt-key list. Note that the key id is the last 8 characters of the key signature. For e.g. on my system the key id for Google is
$ sudo apt-key list /etc/apt/trusted.gpg -------------------- pub dsa1024 2007-03-08 [SC] 4CCA 1EAF 950C EE4A B839 76DC A040 830F 7FAC 5991 uid [ unknown] Google, Inc. Linux Package Signing Key
sub elg2048 2007-03-08 [E] ...
sudo apt-key list | grep "expired "
sudo apt-key del [key-id]
sudo apt-key adv --keyserver keys.gnupg.net --recv-keys [key-id]. You need to know the key id which will probably be noted along with the software installation procedure of your software package.
After restoring and cleaning up my software sources list, I was able to restart the upgrade process and it went fairly smoothly. I had some other issues:
I can highly recommend the new Ubuntu but in any case, good luck with cleaning up your software sources!
Back to the article list.
Subscribe to get articles as they are published direct to your inbox!