When following a testing release, you are garanteed to meet a considerable number of packages to update each time.
If following debian stable release, however, there might be only a few new releases since your last update, e.g. ones with security patches.
But the safest way to upgrade, that will handle any dependency problems, would be to use:
if your sources list is correct (on the debian release you are following) you can run this for a real full upgrade (with -s option to simulate if you like). And note that, while still working as it always did, the command `dist-upgrade` was superceded by `full-upgrade`, as perhaps the 'dist' word was ambiguous.
Debian stable security releases
If you want to keep your debian system up to date with security patches (released as updated packages) make sure you have these lines in your /etc/apt/sources.list, although you'll not be needing'wheezy' in it!
and run the first line above to update package lists and upgrade packages
Update to a new debian release
First change your sources list to point to the release you want to upgrade to, e.g. change all "wheezy" to "jessie", or "stable" to "testing"
Check your apt.conf file isn't pointing to your current release, for example it might say,
APT::Default-Release "wheezy";
If it does remove that line or change it..
developers recommend
and that can be simulated first with the -s option
but it is probably much better to do this booted into recovery mode so that many daemons and drivers are not loaded.
You could first download all the packages needed for the upgrade with
then boot into recovery mode and run dist-upgrade
Aptitude can be used with
-this command replaces "aptitude dist-upgrade" - it will present solutions to conflicts, and ask confirmation before downloading
It can be simulated first with
or
(to put the result into a text file in home)
You could try the apt dist-upgrade way first, and see if its all plain-sailing or not.... but if APT is asking you to remove like about half of your system, because of breakages, then you had better think wisely.
Next, try the aptitude way, as it will offer perhaps a better solution - removing some but not so many packages, which can be reinstalled later on (if they are needed or exist in the release - note that some packages are obsoleted and replaced with ones of different names).
I upgraded just now and there were quite a few packages to be removed by aptitude dist-upgrade, so I ran through the ones I thought were important (many lib's will have different names) at Debian packages, and I only found a few that will need re-installing.
Caution! Using the apt command "upgrade" after changing your sources file will pull in the packages from the newer release, without APT knowing you intend on a full upgrade, and will not take into account critical release changes -the result will be an irreparable mix of packages from different releases.
For example, if you are stable and you do an upgrade with packages from testing, you will get a mixed install of both stable and testing - and then trying to dist-upgrade, you will have hundreds of packages held back, unable to install because of countless dependency problems.
You could probably revert to stable in sources and do an apt update, apt upgrade, to revert to stable install, and then change sources to testing again, update lists and do a dist-upgrade.
The plain "upgrade" command will not add any new packages or remove unneeded ones -which is necessary when upgrading to another release.
The backports sources list entry looks like
(depending on the stable code name)
check to see if your packages are available in backports by doing a search at packages.debian.org
update apt cache and then install a package from backports with
Upgrading the kernel
This may be useful (or necessary) when you have hardware that needs latest drivers or to get laptop hot-keys functioning.
You have somn choices...
1. Install the latest kernel
To check what kernel version is running, do..
and search for available kernels with
Then install, reboot and select the new kernel if necessary.
if it runs well and fixes hardware issues such as video or networking, you can remove the older kernel with apt
-> find its package name with
Note that update-grub and update-initramfs will run automatically after a kernel removal.
2. Install from stable backports
add the backports to sources with the line
update APT and search for available kernels with `apt-cache search linux-image` and install the desired kernel
3. Install from Testing on Stable
note that this method may install quite a lot of packages from testing and you could end up with a mixed-release Debian.
First add Testing to sources (with stable set to default in apt preferences if running a stable Debian install), then `apt update` and `apt-cache search linux-image` to see what kernels are available.
Install the linux-headers first, e.g. apt install linux-headers-X.xx-x
reinstall initramfs-tools from testing,
-as without doing this a looping problem is caused with linux-image
install the corresponding linux-image with aptitude, e.g. aptitude install linux-image-X.xx-x, then reboot and the new kernel will load automatically.