Translation(s): English - Français - Italiano - 简体中文(Chinese)

(!) ?Discussion


从一个发布版本切换到另一个版本

需要认识到,Debian 的工作目标是得到稳定版。过去如此,现在也如此,从未改变。其它存在的版本都是为这个最终结果所服务的。您也许可以在使用其它类型的版本的同时找到其合适的用途。这很不错。很多人都有类似的看法,从长期的 Debian 用户到广大普通用户,甚至(也是理所当然地)包括某些 Debian 开发者都会时不时地使用这些非稳定版的 Debian。

然而您仍需明白,Experimental的试制版本就是实验性的;其中的软件本来就被假定为时不时地发生故障。Testing测试版本的性质也与字面意思类似,这是为了测试而提供的一个版本,用它开展工作的可靠性得不到保证。您可能会发现测试版不稳定版对您来说已经足够可靠了,实际上某些人认为 Debian 的不稳定版甚至比某些其它发行版的稳定版还要可靠。

Corollaries to this in the commercial world are Development, Testing, and Production. In theory, businesses don't let anyone anywhere near their Production servers until they've proven their latest release isn't going to break anything which currently works, and whose new features or functionality have been documented to the business's satisfaction. This is what Debian's Stable name means: that, once released, the operating system remains relatively unchanging over time.

YMMV. Caveat emptor. You get what you pay for. As the saying goes, "If it breaks, you get to keep both pieces." ;-)

Moving Forward (eg., Stable --> Testing)

On the machine in question, execute the following command:

 dpkg --get-selections > packages.dpkg

Save the output file (packages.dpkg) to a USB stick (or remote location) for future use. This file is a list of your installed packages, which should make your task simpler if you find you need to go the reinstall route. Once you've got the new base install and apt sources set up, don't run any other package installation programs yet. You then pull up the packages.dpkg file and run the command:

 dpkg --set-selections < packages.dpkg

This will tell the packaging system which packages to install/uninstall, en mass. Once that's done, run:

 aptitude dist-upgrade

That will install your selections automagically, asking you the necessary config questions. You should then have a clone of your previous packages, but from whichever branch you preferred to move toward.

Moving Backward (eg., Testing --> Stable)

My condolences, but everything I've seen over the years is it's unsupported and re-install is the correct option. You may find your system is still usable after doing the above in reverse, however it's more likely you'll simply confuse the living daylights out of the packaging system.

It was never intended for Debian to be able to do this.

Obviously, the same is true for attempts to go from (eg.) Knoppix --> stable, Ubuntu --> testing, & etc. They're using different repositories after all; little to no effort has been taken to reconcile one with the other.

The moral of the story: backups! Wipe the system and re-install with whichever release you now choose to go with, then pull out your backup {disk,tape,yadayada} and slap your old data into place.

"But, but, but, ..."

No Buts! You may find some kind hearted soul in debian-user who will sympathise with your plight. It's equally likely you'll be roasted alive for having avoided ensuring your valuable data was backed up prior to hosing your system. If that happens, consider it an expensive education and move on.

ToDo : Content about downgrading system should be moved to SystemDowngrade


See also: DebianStable - DebianTesting - DebianUnstable - DebianExperimental