I'm running lubuntu 10.10, and would like to upgrade to 11.04. I have a very temperamental internet connection, so I would like to download all the packages before running the install.
According to this, there is no easy way to do this. The bug report mentioned in that thread is still open.
My question: Is there a way to hack do-release-upgrade to only download the packages, kind of like adding a "-d" to apt-get dist-upgrade?
Or is doing it manually the only way to get the result I desire?
If I have to do it manually, are these the steps needed to do it, or am I missing something?
- Disable 3rd party repositories in
/etc/apt/sources.list
and/etc/apt/sources.list.d
- Change repositories in
/etc/apt/sources.list
frommaverick
tonatty
- run
sudo apt-get update
- run
sudo apt-get -d dist-upgrade
to only download the packages. Do this as many times as necessary until all the packages are downloaded. - run
sudo apt-get dist-upgrade
to complete the upgrade process
Your first four steps are correct, but step 5 should be
sudo do-release-upgrade
(instead ofsudo apt-get dist-upgrade
). It should notice that all (or most) of the packages it was going to download are already present in/var/cache/apt/archives
.In some earlier versions of do-release-upgrade there was a bug where it would clean
/var/cache/apt/archives
before downloading the packages anew, but IIRC that bug's been fixed.I wrote a script to do this, for my own upgrade of multiple machines to Ubuntu 14.04 "trusty". It is called 'apt-get-other-release'. Simple use:
The script is at:
ftp://www.lubkin.com/pub/user/filbo/apt-get-other-release
and version 1.0 has sha1sum: 87a466b2bb2d1ac5b0a08509246a450b8d1c7617
Behind the scenes it's basically running
apt-get update; apt-get -d dist-upgrade
with its own private set of sources.list files. Results are stored in /var/cache/apt-$to_rel/archives, and the '-U' flag copies those into system-wide /var/cache/apt/archives so that they will be present during your upgrade.You could also copy the upgrade archive from one local host to another, saving bandwidth. I did this for an amd64 and an i386 upgrade, copying only those *.deb which didn't have "amd64" in their names; then ran another
apt-get-other-release -t trusty
on the i386 machine, which downloaded another large pile of packages since the two machines had different stuff installed on them.Feedback appreciated; email cc appreciated, as I don't know when I will next look at askubuntu. Search engines are well aware of me.
NOTE: I have not actually done an upgrade of a system so-treated! Some time in the next week. Getting this script out while it might be of some use to people.
>Bela<
There is a way to get the update manager to do steps 1-3 for you.
Run
sudo update-manager
from a terminal window in the GUI (this is important)sudo apt-get update
for you.run
sudo apt-get -d dist-upgrade
from the command line as many times as necessary, until all the packages are downloaded and ready to installrun
sudo do-release-upgrade
and let it complete the upgrade with the already downloaded packages.Re-enable 3rd party repositories, and run
sudo apt-get update && sudo apt-get upgrade
again to update 3rd party repositories to the latest version (make sure the repositories are updated to the latest release of ubuntu)I also wrote a script for this, which you can find at
https://github.com/neldredge/fetch-release-upgrade
Usage: in a scratch directory, run
or whatever new release you want to upgrade to. The necessary packages will be downloaded to a subdirectory called
debs
. You can then move them to/var/cache/apt/archives
before runningdo-release-upgrade
.I have not yet looked at user270294's script but it sounds like it works along similar lines and may have a few more features.
The following slightly shorter version of Menachem's answer worked for me:
Run
sudo do-release-upgrade
in one terminal window, wait until the prompt:Do not confirm, leave it open
In a second terminal window, run
sudo apt-get dist-upgrade --download-only
When done, continue or abort at your leisure in the first terminal window
Pro tip: install a terminal multiplexer like
screen
and run thedo-release-upgrade
inside it. Then, you can reconnect withscreen -D -RR
should anything happen to the terminal that shows the upgrade process. (Luckily, my upgrade today was almost complete...)Ubuntu 21.04 Upgrade To 21.10
I recently did an upgrade from 21.04 to 21.10 and it took 3 or 4 downloads over a period of 2 days. Simply use the GUI interface and make sure you hit the Cancel button when bandwidth is not good or fails. The cancel button "should" do all the cleanup for you. I did not follow the steps above and only used one interface and no terminal. I resumed after 3 or 4 fails the following morning. I was still able to upgrade the current version before the full dist upgrade. Disclaimer: I was successful, you might not be.
Disclaimer: I've never done this before. It might be a horrible idea. It might break everything, empty your bank accounts and flee to the south of Spain. As with anything potentially dangerous, make a backup before you do anything.
I'm not sure how much stuff you have installed, so this might be a flawed solution but you can upgrade from CD. Download the Alternate iso, mount it, and run the upgrade script.
Before I go any further, you don't have to use wget to get the image. Bittorrent will work well as with a standard download manager. The important thing is you want something that will resume, so you can stop downloading and pick it up at another time. This is what
wget
's-c
flag will do.Once you have the ISO, the next step is fairly simple:
The flaw that I talked about is this will only upgrade things integral to Ubuntu that are included on the CD. It won't upgrade your other packages.
In theory this should be fine. You might find that some applications break, some might be forcibly removed by the updater, but the core OS should remain stable.
If my theory is right, this will then let you upgrade your other packages using as and when you want to through Synaptic or (if you install it)
aptitude
.