Friday, October 15, 2010

Upgrading from Lucid to Maverick using a local mirror

I maintain a local Ubuntu mirror in our Lab at work. This morning the first user tried to update from Lucid to Maverick. There was a couple of teething issues but with a couple of changes it went off without a hitch.

Step 1: Correctly specify your mirror to the Software Sources dialog:
  1. Open a terminal

    (Applications -> Accessories -> Terminal)
  2. Open your list of mirrors:
    trastle$ sudo gedit /usr/share/python-apt/templates/Ubuntu.mirrors
  3. Add a location for your local mirror. Mine looks like this:
    ...
    #LOC:ADL
    http://adl-mirror/ubuntu-repo/ubuntu/
    ...
  4. Save and close the file.
  5. Close the terminal.

Step 2: Select your mirror in the software sources dialog
  1. Open the software sources dialog
    (System -> Administration -> Software Sources)
  2. Open the "Ubuntu Software" tab
  3. Click the "Download From:" combo box.
  4. Select "Other..."
  5. Select the mirror you just added from the list
  6. Click "Choose Server" at the bottom right.
  7. Click "Close" at the bottom right.
  8. Click "Close" in the information out of date dialog that pops up.

Step 3: Disable all third party sources
  1. Open the software sources dialog
    (System -> Administration -> Software Sources)
  2. Open the "Other Software" tab
  3. Untick every source in the list.
  4. Click "Close" at the bottom right.
  5. Click "Close" in the information out of date dialog that pops up.

Step 4: Do the Upgrade
  1. Ensure your on a network with Internet access as well as access to your mirror.
  2. Open a terminal
    (Applications -> Accessories -> Terminal)
  3. Change to the root user:
    trastle$ sudo -i
  4. Update your available software:
    root# apt-get update 
  5. Do the upgrade
    root# do-release-upgrade 
  6. The following message will appear shortly after starting the upgrade:
    Updating repository information
    WARNING: Failed to read mirror file
    
    No valid mirror found 
    
    While scanning your repository information no mirror entry for the 
    upgrade was found. This can happen if you run a internal mirror or if 
    the mirror information is out of date. 
    
    Do you want to rewrite your 'sources.list' file anyway? If you choose 
    'Yes' here it will update all 'lucid' to 'maverick' entries. 
    If you select 'No' the upgrade will cancel.
    Your using a local mirror so choose Yes
  7. The release upgrade will take some time to complete.

Step 5: Re-enable third party sources
  1. Open the software sources dialog
    (System -> Administration -> Software Sources)
  2. Open the "Other Software" tab
  3. Tick the sources you want to use.
  4. Click "Close" at the bottom right.
  5. Click "Reload" in the information out of date dialog that pops up.
Enjoy your upgraded system.
I hope someone finds this helpful.