Update packages to most recent releases
(if following debian stable there may be only a few new releases and only 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)
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
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,
If it does remove that line or change it..
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
(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! If you (by mistake) use the apt command "upgrade" after changing your sources file, and actually you are intending to upgrade to another release, apt will not actually upgrade to the new release but will only update your installed packages from the new release -and you will get 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.
If you did that, you can 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.
Upgrading to Jessie without installing systemd
su to root then make this apt conf file with
You may also need to deny "upstart" (ubuntu's startup daemon) from installing as well
then run a dist upgrade with the simulate option to check what will install - and aptitude should be used
note that policykit-1 will not install because it depends on libpam-systemd! This means there may be some errors on startup, hotplugging media will not work (mounting) and there will be no shutdown/reboot option on the logout menu! (this is so with LXDE, as the update removes lxsession, lxpolkit)
To get around these problems, I use a power-off script with a yad dialogue, udevil disk management (see my plain OB
page), and to prevent the dbus error messages on media insert, turn off the auto-mounting in pcmanfm preferences.
But we might not have the pleasure of choosing sysvinit over systemd for much longer, with Debian, and who knows? If we can't carry on without switching to systemd, then our other choices are... Devuan, or Slackware, which continues to be systemd-free (that's not a package name there!)
See my Devuan page
Using backports to update packages
If you follow the current Stable but want some better updates you can give backports a go, which is a way of adding updated packages to your stable debian.
The backports sources list entry looks like
(depending on the Debian stable code name)
check to see if your packages are available in wheezy-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, run
search for available kernels with
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
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
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 distro Debian.
First add Testing to sources (with stable set to default in apt preferences if running a stable Debian install), then apt update, apt-cache search linux-image to see what kernels are available
Install the linux-headers first, e.g. apt install linux-headers-3.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-3.xx-x
reboot and the new kernel will load automatically
4. Install newer kernel after upgrade to Jessie
installing linux-headers-3.16-amd64 hit dependency problems, gcc-4.8 needed, but gcc-4.7 installed
install in this order: gcc-4.8-base, gcc-4.8
Upgrade notes (very old)
Wheezy to Jessie
Packages needing re-install after upgrade:
with APT... audacious audacious-plugins icedtea-7-plugin lxpanel blueman
manual .... googleearth multisystem
(ge needs ia32-libs which are obsoleted in Jessie - install a dummy package from /viewtopic.php?f=10&t=111898
mplayer fails to play files - mplayer error while loading shared libraries: libdvdnavmini.so.4: cannot open shared object file
Squeeze to Wheezy
on login, the default session shows Xsession, not Xfce
Broken apt after update?
If you choose to keep the original sudoers file, you won't be able to apt or aptitude later,
so you need to terminal: su, root p/w, EDITOR=nano visudo
cursor down after the line Defaults env_reset
highlight this line here and middle mouse button in the terminal to paste it:
then CTRL-X, y and Enter
Go Devuan - moving to the Devuan branch of Debian