Expertise level: Medium
tar -czvf host.etc.tar.gz /etc
Before proceeding on your own, we highly recommend you test the upgrade on a second non-critical server prior to performing the upgrade.
You should install all available updates for Debian 6 before upgrading to Debian 7 (wheezy). Here's how:
Update your package lists by entering the following command:
sudo apt-get update
Install the updates by entering the following command:
sudo apt-get upgrade
Any available updates for Debian 6 will be installed.
We recommend that you stop as many services as possible before upgrading to Debian 7. This includes web server daemons (Apache and nginx), database servers (PostgreSQL and MySQL), and any other non-critical services. To stop a service, enter the following command, replacing apache2 with the name of the service you want to stop:
sudo service apache2 stop
Starting a Screen Session
We recommend that you start a screen session to ensure updates will continue to install in the unlikely event you are disconnected during the upgrade process. Here's how to install screen and start a screen session:
Install screen by entering the following command:
sudo apt-get install screen
After installation has completed, start a screen session by entering the following command:
If you are disconnected from your server, you can reconnect to the screen session by entering the following command:
You are now ready to install Debian 7.
Upgrading to Debian 7
- Edit your /etc/apt/sources.list file and change all instances of squeeze to wheezy. Once you have finished, your /etc/apt/sources.list should resemble the following:
deb http://ftp.us.debian.org/debian/ wheezy main deb-src http://ftp.us.debian.org/debian/ wheezy main deb http://security.debian.org/ wheezy/updates main deb-src http://security.debian.org/ wheezy/updates main # wheezy-updates, previously known as 'volatile' deb http://ftp.us.debian.org/debian/ wheezy-updates main deb-src http://ftp.us.debian.org/debian/ wheezy-updates main
Update your package lists with the following command:
sudo apt-get update
Enter the following command to grab the latest versions of key system utilities:
sudo apt-get install apt dpkg aptitude
After the package updates have completed, upgrade your system by entering the following command. The upgrade will download and install numerous packages. This step may take a while to complete.
sudo apt-get dist-upgrade
NOTE: Services using Network Security Services (NSS) and Pluggable Authentication Modules (PAM) will need to be restarted. In most cases the default list of services to be restarted is fine. If you have additional services that use NSS or PAM, add them to the list.
Errors about packages that are removed and not purged may be resolved by installing the latest version of the software or purging the old package. For example, if you receive an error about MySQL, you could try to resolve the issue by entering the following command:
apt-get install mysql-server
If the above step does not work for the package you are trying to install, you may purge the package with the following command after ensuring that you have a backup of the program's data and configuration:
apt-get remove --purge mysql-server