Originally Posted by
MikeJParry
Hello, I would like to know what are the pros and cons of upgrading my Ubuntu by changing the sources.list file, like changing from precise to quantal and then update and upgrade.
In short, yes you can.
This is the way it is meant to be done; the Debian way.
"dist-upgrade" means distribution-upgrade and this is exactly what it's intended to do.
I usually upgrade by this method, but it does have it's complications.
pros:
-Not having to arbitrarily remove over half of your software and ditch all your configuration files with no explanation.
-PPAs (that are still active) can be upgraded along with official packages.
-Keep your current software configurations (mostly) intact.
-No need to reconfigure partitions, no formating, no need to reinstall a bootloader, etc and all those other things that brick my machine every single time I use Canonical's installer.
cons:
-Version conflicts abound (PPA packages and backport versions may be higher than the next distro's official packages; some packages will be obsoleted and replaced by packages with different names; some configuration files very likely need updates; etc)
-Convoluted dependency chains (Not everything will upgrade smoothly. Apt will find the safest route and hold back things that don't work--then you need to fix them by hand)
-On occasion, the Ubuntu sofware suite gets updated or reverted (shotwell or f-spot?; rhythmbox or banshee?; etc) and you'll probably end up with both installed.
-No one seems to believe me that this really is the best way. (Maybe I'm just a noob, maybe Canonical's installer doesn't destroy everything it touches...)
I have a proof-of-concept script, which you should absolutely not copy-> paste -> run.
Read through it, understand it, and then do these things one step at a time, by hand.
This process takes care of most of the version conflicts and dependency problems.
Code:
#!/bin/bash
# Ubuntu Upgrade, The Debian Way.
#PHASE ONE
#Downloads the upgradeable packages from the main repository.
# Ignore PPAs for phase one
for f in /etc/apt/sources.list.d/*.list;
do
mv "$f" "${f%list}list.ignore";
done
# Set all main sources from Precise to Quantal
sed -i 's/precise/quantal/g' /etc/apt/sources.list
# Clean apt's cache and update package lists
apt-get clean
apt-get update
# Add pin to ensure Quantal packages (even downgrades)
echo -e "\nPackage: *\nPin: release v=12.10\nPin-Priority: 1001" >> /etc/apt/preferences
# Download packages from main sources
apt-get -d dist-upgrade
#PHASE TWO
#Downloads the upgradeable packages from user-added sources.
# Re-enable PPAs
for f in /etc/apt/sources.list.d/*.list.ignore;
do
mv "$f" "${f%.list.ignore}.list";
done
# Set all PPAs from Precise to Quantal
for f in /etc/apt/sources.list.d/*.list;
do
sed -i 's/precise/quantal/g' "$f";
done
# Clean apt's cache and update again
apt-get clean
apt-get update
# Download packages from PPAs
apt-get -d dist-upgrade
#PHASE THREE
#Until this point, all changes can be reversed.
# Install the downloaded packages & upgrade the distribution
apt-get dist-upgrade
# Resolving dependency chains manually (not the only way):
# Force install new packages, overwriting old ones, with:
# dpkg -i --force overwrite /var/cache/apt/archives/NEW PACKAGE NAME
# Then remove old packages with:
# apt-get remove OLD PACKAGE NAME
# Then reinstall the new package
# dpkg -i /var/cache/apt/archives/NEW PACKAGE NAME
# Make sure everything is done
# apt-get dist-upgrade
# dpkg --config -a
# update-initramfs -u -k all
# Restore Quantal packages pin from /etc/apt/preferences
# Check thoroughly for leftover Precise packages.
# Leftover Precise packages can be found in Synaptic
# Sort the package list by "Origin" and look under "Local"
# These packages are not available in a repository.
# They could be hand-made, obsolete, temporarily unavailable, or discontinued.
# Some are probably obsolete Precise packages.
Bookmarks