D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Ignoring Linux Mint Upgrade Advice

 

On 09/12/13 21:18, bad apple wrote:
Hopefully some of you might find this useful - it certainly won't be
news to any of the more sophisticated tinkerers or the sysadmins out
there though. I know we have a lot of Mint users though.

I always laugh when a new Mint release comes out when I skim the release
notes/update advice: the non-LDME versions aren't rolling releases and
the upgrade instructions basically do everything they can to scare
people away from doing it the "proper way", with apt. As if anyone is
going to bother completely backing up their system, wiping their
perfectly good OS and reinstalling the new version from scratch before
finally manually copying all their files back... ridiculous. Ironically,
with unskilled users this approach is far more likely to lose or break
things so here is how to do it properly.

I should note that is hardly a secret and most sysadmins/technical users
have been upgrading their Linux systems from one release to another like
this since probably about day 1. I've done countless in-place upgrades
of Ubuntu, Fedora, SuSE, Mandriva/Maegia, Mint, Debian, RedHat, CentOS
and just about every other non-rolling update distro like this for as
long as I can remember. Having said that, step number 0 is still:

0: HAVE A BACKUP

Really, really don't skip this step. So, on with the show. I'll be
presuming upgrading Mint 15 > Mint 16 for the rest of this although the
principles apply to all Debian derivations and indeed most other distros.

You need root access for this: issue everything as a sudo user or just
login as root locally. For troubleshooting, make sure SSHD is running
and you can get in from a spare machine - you never know. Some people
recommend pushing the system down to runlevel 1, or killing the GUI, but
I never bother. I've remained logged in and working or surfing the
internet many many times whilst running a full version upgrade.

1: Get Mint 15 fully upgraded, flush package cache completely

apt-get update && apt-get dist-upgrade
apt-get clean all

2: Edit apt sources

cd /etc/apt
sed -i 's/olivia/petra/g' sources.list
sed -i 's/raring/saucy/g' sources.list

3: If you have extra repos here (PPAs, etc) also edit them

ls sources.list.d/
sed -i 's/olivia/petra/g' sources.list.d/*.list
sed -i 's/raring/saucy/g' sources.list.d/*.list

4: Get the new apt database information for new release: watch for any
errors, and correct them before moving to step 5. Purge or comment out
any offending PPAs or alternative source lists.

apt-get update

5: Actual upgrade time (this will take a while)

script /var/log/dist-upgrade.log
apt-get dist-upgrade

If anything goes pear-shaped along the way, you may need to clear out a
specific package or two and run "apt-get install -f", before resuming
with apt-get dist-upgrade, but that rarely happens.

6: Clean up and reboot

apt-get clean all
apt-get autoremove
reboot

7: Post-install stuff

lsb_release -rc  #confirm you've updated
uname -r  #check new running kernel version
apt-get update && apt-get dist-upgrade #just to make sure

You might want to check you're not missing any packages here, and really
clean out the old cruft with a few runs of:

deborphan --guess-all | xargs apt-get -y remove
dpkg --get-selections | grep deinstall | cut -f1 | xargs dpkg -P
apt-get autoremove
apt-get purge linux-image-3.blah* #get rid of some older kernels
apt-get purge linux-headers-3.blah* #same for old headers

For easier management of multiple PPAs, look into getting y-ppa-manager*
or similar software.

And that's it: hardly rocket science or for advanced users only... I
find Mint's default user advice on this version upgrade business
ridiculous. I've actually done numerous updates like this on people's
machines remotely over SSH - definitely not recommended, but I've never
had a major problem.

So hopefully someone might find this useful. Don't forget that the
script command saves a complete history of the dist-upgrade itself in
/var/log/dist-upgrade.log which you can examine at any point afterwards
or even during, if something does go badly wrong.

Regards


*
http://www.webupd8.org/2013/10/y-ppa-manager-0991-released-with-ubuntu.html

Excellent post.. thanks for that! I do know a couple of people as well as me running Mint 15, one of whom is debating the update having downloaded the ISO. The only debate issue /was/ the 'total reinstall' statement, so he'll be very happy to see this, as I am!

Kind regards,

Julian

--
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq