what to do if network connection breaks between an upgrade

Amedee Van Gasse (ub) amedee-ubuntu at amedee.be
Mon Oct 4 14:12:26 UTC 2010


On Mon, October 4, 2010 14:49, Alan Pope wrote:
> On 4 October 2010 13:43, Tapas Mishra <mightydreams at gmail.com> wrote:
>> I edited the sources.lst changed lucid to maverick  and did apt
>> dist-upgrade
>
> That's not the way we recommend doing upgrades. We recommend using
> update-manager or do-release-upgrade.

Since the OP is into editing files, I'd recommend do-release-upgrade:

http://www.ubuntu.com/desktop/get-ubuntu/upgrade

do-release-upgrade is the command that is used for server upgrades, but
there is no functional difference for the desktop or netbook edition. Only
the user interface is different (text vs gui).


Alan is right: do NOT edit sources.lst!!! There is more to upgrading
Ubuntu than just switching repositories.


>> it connected and started doing every thing . I have plans of doing this
>> on other systems also in case if some thing goes wrong such as a power
>> cut or network connection errupts in between or say I had to shutdown
>> the machine or machine did reboot for some God knows reason then what
>> step should I take to resume the upgrade from where it stopped or can I
>> undo this entire thing.
>>
>
> You can't easily undo it once it starts. If it's still doing downloads
> when the power/network goes then just restart it,

>From my personal experience: I upgraded a netbook while I had a flakey
wifi connection. It dropped every few minutes. This was my scenario:

Download Phase:
1. do-release-upgrade
2. The upgrade prepares sources.lst and makes backup copies.
3. The upgrade calculates dependencies. I agree to continue.
4. Packages are downloaded.
5. CONNECTION BREAKS
6. Upgrade rolls back sources.lst to its original state. It keeps the
files that were already downloaded.
7. Repeat from 1. until everything is downloaded
(I had to do this 4 or 5 times)

Install Phase:
8. Upgrade starts installing packages. NETWORK CONNECTION IS NO LONGER
NEEDED.
9. Upgrade finished, reboot because of the new kernel.
10. Done!!!


A _network_ failure in the Download Phase is annoying, but Ubuntu is smart
enough to recover. A network failure in the Install Phase does not matter
at all.


> but if the power goes whilst packages are actually installing then the
> result depends on which packages it's doing at the time. It's hard to
> give a blanket answer to that question because upgrades can break in a
> bazillion different ways depending on when it failed.
>
> However in general if an upgrade breaks due to power loss, I'd boot up
> and if you can get to a gui or console then use the package management
> tools to continue what they were doing.

If you fear a _power_ failure: make a backup of /etc/apt/sources.list and
/etc/apt/sources.list.d/*.list before you start.

If you have a power failure in the download phase: just restore the
/etc/apt files, run aptitude update followed by do-release-upgrade. It'll
be just like a network failure but you really need to restore your apt
files manually.

If you have a power failure in the install phase: I'd do aptitude update +
do-release-upgrade + aptitude full-upgrade to see what errors it reports.
Best case scenario is that it continues the upgrade, worst case scenario
is that you get a very detailed report that you can copy/paste to this
list for further assistance.


> That said if you're asking this question then you're exactly the kind of
> person who should _not_ be running Maverick (which isn't released yet) as
> I specified in my previous mail.

Agreed, Maverick Beta is not for people who don't know how to troubleshoot
but nonetheless network/power failures may also occur when it is release.

-- 
Amedee





More information about the ubuntu-users mailing list