debian 5升级debian 6
由于需求要使用xen 4.0提供虚拟化,所以需要将线上一些debian 5系统升级为debian 6. www.zhishiwu.com
1.修改源为debian 6
1
root@10.1.6.200:~# cat /etc/debian_version
2
5.0.2
3
root@10.1.6.200:~# vim /etc/apt/sources.list
4
deb http://mirrors.163.com/debian squeeze main non-free contrib
2.更新源,这里使用dist-upgrade,而没有使用upgrade,稍后解释.
1
root@10.1.6.200:~# apt-get dist-upgrade
之后就是安装升级包,基本上一路按默认提示安装即可.
最后装完,查看版本
1
root@10.1.6.200:~# cat /etc/debian_version
2
6.0.2
3.既然系统已升级为debian6,之后就可以装xen4.0
1
root@10.1.6.200:~#apt-get install linux-image-2.6.32-5-amd64 linux-headers-2.6.32-5-amd64
2
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
01
更改到xen内核 由于重启使用ipmi抓屏 需要注意加上console=tty0 console=ttyS1,115200
02
root@10.1.6.200:~#vi /boot/grub/grub.cfg
03
default=8
04
05
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 {
06
insmod part_msdos
07
insmod ext2
08
set root='(hd0,msdos1)'
09
search --no-floppy --fs-uuid --set 3e896e08-d01a-43fa-b6b5-c265e526913c
10
echo 'Loading Linux 2.6.32-5-xen-amd64 ...'
11
multiboot /boot/xen-4.0-amd64.gz placeholder
12
module /boot/vmlinuz-2.6.32-5-xen-amd64 placeholder root=UUID=3e896e08-d01a-43fa-b6b5-c265e526913c console=tty0 console=ttyS1,115200 ro
13
echo 'Loading initial ramdisk ...'
14
module /boot/initrd.img-2.6.32-5-xen-amd64
15
}
16
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 {
17
insmod part_msdos
18
insmod ext2
19
set root='(hd0,msdos1)'
20
search --no-floppy --fs-uuid --set 3e896e08-d01a-43fa-b6b5-c265e526913c
21
echo 'Loading Linux 2.6.32-5-xen-amd64 ...'
22
multiboot /boot/xen-4.0-amd64.gz placeholder
23
module /boot/vmlinuz-2.6.32-5-xen-amd64 placeholder root=UUID=3e896e08-d01a-43fa-b6b5-c265e526913c console=tty0 console=ttyS1,115200 ro single
24
echo 'Loading initial ramdisk ...'
25
module /boot/initrd.img-2.6.32-5-xen-amd64
26
}
重启机器,更改biso 打开虚拟化选项.
1
root@10.1.6.200:~# xm list
2
Name ID Mem VCPUs State Time(s)
3
Domain-0 0 2140 8 r----- 5453.5
下面是man upgrade与dist-upgrade
upgrade
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.
简单来说系统将现有的Package升级,如果有相依性的问题,而此相依性需要安装其它新的Package或影响到其它Package的相依性时,此Package就不会被升级,会保留下来.
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 软件包。