因为需求要使用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 软件包。