Update packages to most recent releases 
(if using debian stable there may be only a few new releases and only ones with security patches) 
sudo apt-get update && sudo apt-get upgrade

But safest way to upgrade, that will overcome any dependency problems, would be to use:
sudo aptitude upgrade --full-resolver

if your sources list is correct (on the debian release you are sticking with) you can run this for a real full upgrade (with -s option to simulate if you like)
sudo apt-get dist-upgrade


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
deb http://ftp.debian.org/debian/ wheezy-updates main contrib non-free
deb-src http://ftp.debian.org/debian/ wheezy-updates main contrib non-free

deb http://security.debian.org/ wheezy/updates main contrib non-free
deb-src http://security.debian.org/ wheezy/updates main contrib non-free

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
sudo nano /etc/apt/sources.list

Check your apt.conf file isn't pointing to your current release, for example it might say
APT::Default-Release "wheezy";
mine doesn't after using netinstall CD.  If it does remove that line or change it.. 
sudo nano /etc/apt/apt.conf

developers recommend 
sudo apt-get update
sudo apt-get dist-upgrade
and that can be simulated first with
sudo apt-get -s dist-upgrade
but it is probably much better to do this booted into recovery mode so that many daemons and drivers are not loaded.
so first you can download the packages needed with
sudo apt-get update && sudo apt-get --download-only dist-upgrade
then boot into recovery mode and run
sudo apt-get dist-upgrade

Aptitude can be used with 
sudo aptitude full-upgrade
and simulated first with
sudo aptitude --simulate full-upgrade
or
sudo aptitude --simulate full-upgrade > ~/upgrade.txt  (to put the result into a text file in home)



Using backports to update packages
You may want to stay with Wheezy (while Jessie is still in its early testing life) and give backports a go, which is a way of adding updated packages to your stable debian. 

The backports sources list entry looks like 
deb http://ftp.debian.org/debian/ wheezy-backports main

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 
sudo apt-get -t wheezy-backports install <package>



Upgrade notes - Squeeze to Wheezy
  • on login, the default session shows Xsession, not Xfce 
-in /etc/lightdm/lightdm.conf change user-session=lightdm-xsession to user-session=xfce
  • Broken apt-get after update?
If you choose to keep the original sudoers file, you won't be able to apt-get or aptitude later,
so you need to terminal: su and root p/w
enter visudo
cursor down after the line Defaults  env_reset
highlight this line here and middle mouse button in the terminal to paste it:
Defaults	secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
then CTRL-X, y and Enter
from http://note.harajuku-tech.org/...


Upgrading the kernel

This may be useful (or necessary) when you have hardware that needs latest drivers or to get hot-keys functioning.

  • First add Testing to sources (with stable set to default in apt preferences if running a stable Debian install), then apt-get update
  • apt-cache search linux-image to see what kernels are available
  • Install the linux-headers first, e.g. apt-get install linux-headers-3.10-3-686-pae
  • reinstall initramfs-tools from testing, apt-get install -t testing initramfs-tools -as without doing this a looping problem is caused with linux-image
  • install corresponding linux-image with aptitude, e.g. aptitude install linux-image-3.10-3-686-pae
  • reboot and the new kernel will load automatically

Comments