Is there a way to upgrade to Debian 7 without re-installing

tmick's picture


Would like to know if there is a anyway to just upgrade to Debian 7 and not do a fresh install.

RE: Is there a way to upgrade to Debian 7 without re-installing

IntnsRed's picture

Of course there is. If you have an existing Debian system, doing a:

apt-get update
apt-get dist-upgrade

as the root/super-user will do the trick.

The key is what you're upgrading from and if a Debian system, if your /etc/apt/sources.list file is configured properly; if it points to "stable", the above command will upgrade things to the latest stable release version. Doing a "man apt-get" command will allow you to read up on the apt-get command.

What are you upgrading from?

upgrade to 7

tmick's picture

I am upgrading from 6 stable, would like to go to 7 testing. I lost track of the code names.

Re: Release names and /etc/apt/sources.list strategies

IntnsRed's picture

Debian release code names are all based on characters from the Toy Story movies. (Way back when, the original Toy Story movie was rendered on Debian GNU/Linux machines. At the time, that was a pretty big PR coup for Linux.) Stable is currently "wheezy" and testing is currently "jessie". The code names are semi-important. Here's why.

The lines in /etc/apt/sources.list tells apt-get what repositories to download things from.

If you have sources.list point to "stable" (or even "testing"), it is possible to automatically upgrade to a different release (code name) after Debian does a new release.

For example, if your sources.list was set to "testing" when wheezy was testing, after wheezy was released it would then become "stable", and jessie was linked as the new testing. In such a scenario, it would be possible for you to change from wheezy to jessie just by having "testing" in your sources.list and not paying attention.

For that reason, I'd recommend editing your /etc/apt/sources.list to change "stable" (or "testing" or whatever codename it uses) to "jessie". Then you can happily upgrade to and run jessie (now called testing) and when jessie is released as stable you'll still be set to jessie until you decide to change to another release.

ok so where is the codenames

tmick's picture

ok so where is the codenames to be found? My sources.list shows:
deb squeeze main contrib non-free
deb-src squeeze main contrib non-free

deb squeeze/updates main contrib non-free
deb-src squeeze/updates main contrib non-free

# squeeze-updates, previously known as 'volatile'
deb squeeze-updates main
deb squeeze-proposed-updates contrib non-free main
deb-src squeeze-proposed-updates contrib non-free main
deb-src squeeze-updates main
deb stable main non-free
Thanks for the help so far.

Good news and bad news :-)

IntnsRed's picture

Interesting -- you're running Squeeze. The bad news is that's an old version -- the version behind Wheezy.

The good news is that you can still upgrade. If you want to eventually be running Jessie, I'd make it a two-step upgrade.

First, edit sources.list and replace "squeeze" with "wheezy". Then do an "apt-get update ; apt-get dist-upgrade". That will have you upgrade to Wheezy.

As I recall (it's been a while), there was a change in the squeeze-updates or squeeze-proposed-updates line. So it's quite possible you'll get an error there. If so, you can add a # sign to comment out the line giving you the error.

Once you've upgraded to Wheezy, just do another edit and replace "wheezy" with "jessie" and then repeat the process to upgrade to Jessie.

apt-get results

tmick's picture

apt-get update
Hit wheezy/updates Release.gpg
Hit wheezy/updates/contrib Translation-en
Ign wheezy/updates/contrib Translation-en_US
Hit wheezy/updates/main Translation-en
Ign wheezy/updates/main Translation-en_US
Hit wheezy/updates/non-free Translation-en
Ign wheezy/updates/non-free Translation-en_US
Hit wheezy/updates Release
Hit wheezy Release.gpg
Hit wheezy/contrib Translation-en
Ign wheezy/contrib Translation-en_US
Hit wheezy/updates/main i386 Packages
Hit wheezy/main Translation-en
Ign wheezy/main Translation-en_US
Hit wheezy/non-free Translation-en
Ign wheezy/non-free Translation-en_US
Hit wheezy-updates Release.gpg
Hit wheezy-updates/main Translation-en
Ign wheezy-updates/main Translation-en_US
Hit testing Release.gpg
Ign testing/main Translation-en
Ign testing/main Translation-en_US
Ign testing/non-free Translation-en
Ign testing/non-free Translation-en_US
Hit wheezy/updates/contrib i386 Packages
Hit wheezy/updates/non-free i386 Packages
Hit wheezy-proposed-updates Release.gpg
Hit wheezy-proposed-updates/contrib Translation-en
Ign wheezy-proposed-updates/contrib Translation-en_US
Hit wheezy-proposed-updates/main Translation-en
Ign wheezy-proposed-updates/main Translation-en_US
Hit wheezy-proposed-updates/non-free Translation-en
Ign wheezy-proposed-updates/non-free Translation-en_US
Hit wheezy Release
Hit wheezy-updates Release
Hit testing Release
Hit wheezy-proposed-updates Release
Hit wheezy/main Sources
Hit wheezy/contrib Sources
Hit wheezy/non-free Sources
Hit wheezy-updates/main i386 Packages/DiffIndex
Hit testing/main i386 Packages
Hit wheezy-proposed-updates/contrib Sources/DiffIndex
Hit wheezy-proposed-updates/non-free Sources/DiffIndex
Hit wheezy-proposed-updates/main Sources/DiffIndex
Hit wheezy-proposed-updates/contrib i386 Packages/DiffIndex
Hit wheezy-proposed-updates/non-free i386 Packages/DiffIndex
Hit wheezy-proposed-updates/main i386 Packages/DiffIndex
Hit testing/non-free i386 Packages
W: Failed to fetch Unable to find expected entry -updates/source/Sources in Meta-index file (malformed Release file?)

E: Some index files failed to download, they have been ignored, or old ones used instead.

# apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Failed
The following packages have unmet dependencies:
base-files : Breaks: initscripts (= 2.17.2) but it is not going to be installed
PreDepends: libuuid1 (>= 2.16) but it is not going to be installed
python-minimal : Depends: python2.6-minimal (>= 2.6.6-1~) but it is not going to be installed
python2.6 : Depends: python2.6-minimal (= 2.6.6-8+b1) but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

umm?not sure how to edit that one

deb wheezy main contrib non-free
deb-src wheezy main contrib non-free

deb wheezy/updates main contrib non-free
#deb-src wheezy/updates main contrib non-free

# squeeze-updates, previously known as 'volatile'
deb wheezy-updates main
deb wheezy-proposed-updates contrib non-free main
deb-src wheezy-proposed-updates contrib non-free main
deb-src wheezy -updates main
deb testing main non-free

Update Squeeze?

IntnsRed's picture

Just curious, was the Squeeze version that's on the machine updated to the latest before you changed sources.list and tried the upgrade to Wheezy?

Another tactic...

IntnsRed's picture

Strange. I've upgraded several systems and don't recall that problem. It makes me wonder if something has changed with the new Wheezy minor releases.

One thing to try is to make the upgrade a two-step process.

First upgrade the minimal/base system with an:

apt-get update
apt-get upgrade

and then do the full distribution upgrade with an:

apt-get update
apt-get dist-upgrade

If that still gives problems let me know. I'm curious about this because the box this site runs on is going to be upgraded from Squeeze to Wheezy in the next week or two.

Another tactic

tmick's picture

Well the commands ran, and now I can't load GNOME Sad it just brings up the desktop background and stops. there were 64 packages held back and not installed. Not sure if I should just move to Jessie or try loading the 64 that were held back or attempt to undo the changes. let me know your thoughts


IntnsRed's picture

Well, the core system seems to be upgraded, so that's progress; the problem likely is in what is being held back. I'd fix the remaining problem before I'd go on to Jessie.

While Gnome not being run seems dramatic, it really isn't a big deal. In the worst-case scenario, if you had to, you could just purge all of Gnome and then reinstall it. While you shouldn't have to use such crude, Windows-like tactics, it would work. And since your actual desktop configuration is safely in your home directory, it's not that big of a deal. But that's worst-case, last-resort; the upgrade/update should fix that.

First, rerun the previous upgrade commands, and probably an "apt-get dselect-update" too (as long as it doesn't want to delete/purge/remove things). While Debian should resolve all the dependencies and things the first time, if it doesn't that may do the trick.

Do you have a package manager on the machine (aptitude, dselect, synaptic, etc)? Also, are you getting a message about why things are being held back?

If so, I'd fire a package manager up and see if it can resolve the issues. The package manager will also let you remove (partially delete, leaving a package's configuration files) or purge (totally delete) the various obsolete packages. Purging those obsolete packages that are no longer in Debian is just good general housekeeping and if they're not anything you're using, you might as well do that.

good news/ bad news

tmick's picture

Good news: Found why they were being held back, they are unavaiable packages. I launched aptitude and viewed them they showed as unavaialbe in the status of the package. I think I figured out why Gnome had issues also. The new Debian defaults to Gnome 3 and uses Libre instead of Open Office, so I believe it had issues switching over to everything there. So I could of went to Jessie from where I was at. Now for the bad news.... I wound up doing a fresh install anyway due to me trying to fix the Gnome problem. So I guess I will move on to Jessie and see if everything works from there.