因爲需求要使用xen 4.0提供虛擬化,因此須要將線上一些debian 5系統升級爲debian 6. linux
1.修改源爲debian 6 shell
root@10.1.6.200:~# cat /etc/debian_version 5.0.2 root@10.1.6.200:~# vim /etc/apt/sources.list deb http://mirrors.163.com/debian squeeze main non-free contrib
2.更新源,這裏使用dist-upgrade,而沒有使用upgrade,稍後解釋. vim
root@10.1.6.200:~# apt-get dist-upgrade以後就是安裝升級包,基本上一路按默認提示安裝便可.
最後裝完,查看版本 less
root@10.1.6.200:~# cat /etc/debian_version 6.0.2
3.既然系統已升級爲debian6,以後就能夠裝xen4.0 ui
root@10.1.6.200:~#apt-get install linux-image-2.6.32-5-amd64 linux-headers-2.6.32-5-amd64 root@10.1.6.200:~#apt-get install linux-image-2.6.32-5-xen-amd64 xen-linux-system-2.6.32-5-xen-amd64 xen-hypervisor-4.0-amd64 xen-utils-4.0 xenstore-utils xen-tools xen-qemu-dm-4.0 xen-utils-common
更改到xen內核 因爲重啓使用ipmi抓屏 須要注意加上console=tty0 console=ttyS1,115200 root@10.1.6.200:~#vi /boot/grub/grub.cfg default=8 menuentry 'Debian GNU/Linux, with Linux 2.6.32-5-xen-amd64 and XEN 4.0-amd64' --class debian --class gnu-linux --class gnu --class os --class xen { insmod part_msdos insmod ext2 set root='(hd0,msdos1)' search --no-floppy --fs-uuid --set 3e896e08-d01a-43fa-b6b5-c265e526913c echo 'Loading Linux 2.6.32-5-xen-amd64 ...' multiboot /boot/xen-4.0-amd64.gz placeholder module /boot/vmlinuz-2.6.32-5-xen-amd64 placeholder root=UUID=3e896e08-d01a-43fa-b6b5-c265e526913c console=tty0 console=ttyS1,115200 ro echo 'Loading initial ramdisk ...' module /boot/initrd.img-2.6.32-5-xen-amd64 } menuentry 'Debian GNU/Linux, with Linux 2.6.32-5-xen-amd64 and XEN 4.0-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os --class xen { insmod part_msdos insmod ext2 set root='(hd0,msdos1)' search --no-floppy --fs-uuid --set 3e896e08-d01a-43fa-b6b5-c265e526913c echo 'Loading Linux 2.6.32-5-xen-amd64 ...' multiboot /boot/xen-4.0-amd64.gz placeholder module /boot/vmlinuz-2.6.32-5-xen-amd64 placeholder root=UUID=3e896e08-d01a-43fa-b6b5-c265e526913c console=tty0 console=ttyS1,115200 ro single echo 'Loading initial ramdisk ...' module /boot/initrd.img-2.6.32-5-xen-amd64 }
重啓機器,更改biso 打開虛擬化選項. spa
root@10.1.6.200:~# xm list Name ID Mem VCPUs State Time(s) Domain-0 0 2140 8 r----- 5453.5
下面是man upgrade與dist-upgrade code
upgrade orm
upgrade is used to install the newest versions of all packages currently installed on the system from the sources enumerated in /etc/apt/sources.list. Packages currently installed with new versions available are retrieved and upgraded; under no circumstances are currently installed packages removed, or packages not already installed retrieved and installed. New versions of currently installed packages that cannot be upgraded without changing the install status of another package will be left at their current version. An update must be performed first so that apt-get knows that new versions of packages are available. ip
簡單來講系統將現有的Package升級,若是有相依性的問題,而此相依性須要安裝其它新的Package或影響到其它Package的相依性時,此Package就不會被升級,會保留下來. ci
dist-upgrade
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. So, dist-upgrade command may remove some packages. The /etc/apt/sources.list file contains a list of locations from which to retrieve desired package files. See also apt_preferences(5) for a mechanism for overriding the general settings for individual packages.
能夠聰明的解決相依性的問題,若是有相依性問題,須要安裝/移除新的Package,就會試着去安裝/移除它. (因此一般這個會被認爲是有點風險的升級)
apt-get upgrade 和 apt-get dist-upgrade 本質上是沒有什麼不一樣的。
只不過,dist-upgrade 會識別出當依賴關係改變的情形並做出處理,而upgrade對此情形不作處理。
例如軟件包 a 原先依賴 b c d,可是在源裏面可能已經升級了,如今是 a 依賴 b c e。這種狀況下,dist-upgrade 會刪除 d 安裝 e,並把 a 軟件包升級,而 upgrade 會認爲依賴關係改變而拒絕升級 a 軟件包。