Dist-Upgrade debian
โดย เมื่อ 12th December 2009 เวลา 09:58:02 (1823 เปิดอ่าน)
Debian 4.0 has been released. It is recommended that you upgrade the system to latest version. Upgrading remote Debian server is a piece of cake![]()
Currently many of our boxes are powered by Debian 3.1 Sarge. For example typical web server may have following packages only:
=> Apache
=> PHP
=> Postfix and other mail server software
=> Iptables and backup scripts
=> MySQL 5.x etc
Procedure
Following are essential steps to upgrade your system:
1. Verify current system
2. Update package list
3. Update distribution
4. Update /etc/apt/sources.list file
5. Reboot system
6. Test everything is working
Backup your system
Before upgrading your Debian systems make sure you have backup (I’m assuming that you make backup copies of all important data/files everyday:
- User data / files / Emails (/home, /var/www etc)
- Important system files and configuration file stored in /etc
- MySQL and other database backup
- Backup Installed package list [Get list of installed software for reinstallation / restore software]
Step # 1: Verify current system
File /etc/debian_version stores current Debian version number :
Output:Code:$ cat /etc/debian_version
3.1 Find out kernel version
Output:Code:$ uname -mrs
Linux 2.6.8-3-386 i686
Step #2: Update package list
Use apt-get command:
Step #3 : Update distributionCode:# apt-get update
Pass dist-upgrade option to apt-get command. This will upgrade Sarge to Etch. dist-upgrade' in addition to performing the function of upgrade, also intelligently handles changing dependencies with new versions of packages; apt-get has a "smart" conflict resolution system, and it will attempt to upgrade the most important packages at the expense of less important ones if necessary.
This upgrade procedure takes time. Depend upon installed softwares and other factors such as network-speed you may need to wait from 10 minutes to 1+ hour(s).Code:# apt-get dist-upgrade
Step #4 : Update /etc/apt/sources.list file
There seems to be a small bug in upgrade procedure. You need to manually update Debian security source line. You will see an error as follows:
W: Conflicting distribution: Debian -- Security Information stable/updates Release (expected stable but got sarge)
W: You may want to run apt-get update to correct these problems
Just open /etc/apt/sources.list file:
Find line that read as follows:Code:# vi /etc/apt/sources.list
Replace with :Code:deb Debian -- Security Information stable/updates main contrib
Save and close the file. Now type the following command:Code:deb Debian -- Security Information etch/updates main contrib non-free
Step #5: Reboot systemCode:# apt-get update
You are done. Just reboot the system:
Step #6: Make sure everything is working...Code:# reboot
See Debian distro version:
Output:Code:$ cat /etc/debian_version
4.0 Make sure all services are running, just go thought all log files once.
Use apt-key command to manage the list of keys used by apt to authenticate packages. Packages which have been authenticated using these keys will be considered trusted. Make sure you see package etch related keys:Code:# netstat -tulpn # tail -f /var/log/log-file-name # less /var/log/dmesg # top .... ... ....
Code:# apt-key listCode:/etc/apt/trusted.gpg -------------------- pub 1024D/2D230C5F 2006-01-03 [expired: 2007-02-07] uid Debian Archive Automatic Signing Key (2006) ftpmaster@debian.org pub 1024D/6070D3A1 2006-11-20 [expires: 2009-07-01] uid Debian Archive Automatic Signing Key (4.0/etch)pub 1024D/ADB11277 2006-09-17 uid Etch Stable Release Key If there is a problem use following command to update the local keyring with the keyring of Debian archive keys and removes from the keyring the archive keys which are no longer valid. Finally just see if any new updates/security updates are available:Code:# apt-key update # apt-key list
Further readingsCode:# apt-get update # apt-get upgrade
- Above instructions is server specific only. I’ve tested them on 3 different production web servers. The release notes for Debian GNU/Linux 4.0 ("etch"), Intel x86 has additional information about Upgrades from previous releases including special information about Debian Linux desktop system and other troubleshooting hints.




: 
Email Blog Entry