sudo sed -i -re 's/([a-z]{2}\.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
sudo apt-get update && sudo apt-get dist-upgrade
mkdir wily && cd wily
wget http://old-releases.ubuntu.com/ubuntu/dists/wily-updates/main/dist-upgrader-all/current/wily.tar.gz
tar -xzf wily.tar.gz
sed -i -re 's/([a-z]{2}\.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' Ubuntu.info
sed -i -re 's/([a-z]{2}\.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' Ubuntu.mirrors
sudo ./wily
Upon running this on another host I got "ImportError: No module named 'apt' just install it:
Either:
apt-get install python-apt -y
sudo apt-get install python3-apt --reinstall
<- This worked for me.
Gets a bunch of 404's and then asks if it should overwrite the sources.list
Y
Try not to kill ssh if you're connected via ssh... Wait patiently and hope everything works...
restart
Should be on 15.10
cd ~
mkdir
cp ~/sources.list ~/sources-backup.list
cp /etc/apt/sources.list ~/sources.list
sudo apt-get update && sudo apt-get upgrade
sudo do-release-upgrade
go through the upgrade, hope everything works...
Things are going to be removed, I just removed them all, I'll add back whatever I need later
restart the server again
should be on 16.04.3
sudo apt-get autoremove
@ChandanKumarSahu
First line you're backing up your package lists (in case something goes wrong and you want to go back to using them)
Second line swaps out all the instances of
archive.ubuntu.com
andsecurity.ubuntu.com
with theold-releases.ubuntu.com
inside of your package lists.Third line updates and upgrades
Then you're grabbing
wily
which is I believe the upgrade scripts' name, and then uncompressing it.Next we switch wilys' references to ubuntus update servers to the old releases server like we did on line 2.
And then we execute
wily
.If I remember correctly, it 404's because it has the archive and security package lists cached somewhere, and then it asks if it should update those lists. (Again, if I'm remembering correctly)
Finally, it's done. And I think it asks if we want to restart. Which, of course we do. If it doesn't ask you can just run
sudo shutdown -r now
We boot into 15.10.
Once again I backup my package lists ~ better safe than sorry.
We update the package list and then upgrade the installed packages. At the time of writing there was an upgrade path from 15.10->16.04 have an upgrade path to 16.04. So we can do it the proper way through the
dist-upgrade
command. However, eventually that upgrade path will be archived like from 15.04->15.10 and the automatic upgrade won't work. But hopefully this'll be helpful enough to help that person figure out what they've got to do in order to get to the next version of ubuntu.