注册 登录  
 加关注
查看详情
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

学习笔记

正确的方法如同学习书法,开始的时候要临摹,临摹好了然后创造自己的风格。

 
 
 

日志

 
 

[Debian/linux笔记]从Debian lenny到Debian squeeze  

2011-08-11 15:53:53|  分类: Debian/linux |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

        最近在vmware虚拟机中更新了一下自己用的Debian lenny,将其升级到了Debian squeeze。不同版本之间由于大量软件的更新,配置文件的不同,grub的变更,要想无缝升级都是骗新手的鬼话。所以先要作好“受虐”的准备。
记录一下自己的步骤:
1. 先将源改为lenny,将lenny升级到最新。
# cd /etc/apt

# cp sources.list sources.list.bak

# sed -e 's/\<\(stable\|squeeze\)\>/lenny/g' sources.list.bak >sources.list

# apt-get update
# apt-get upgrade

2. 将源改为squeeze,升级到squeeze
# cd /etc/apt

# cp sources.list sources.list.bak

# sed -e 's/\<\(stable\|lenny\)\>/squeeze/g' sources.list.bak >sources.list

# apt-get update
#apt-get install dpkg apt aptitude
# apt-get dist-upgrade
#dpkg --purge --force-remove-essential `uname -r`       <------------删除之前的内核


# aptitude purge ~ilinux-image-.*\(\!`uname -r`\)

3. 重启完成后,更新grub2
        Debian squeeze使用的是grub2,设置grub2,通过命令:
# upgrade-from-grub-legacy
        configure grub-pc:
   [*]  /dev/sda
        /dev/sda1
        选择安装在/dev/sda下,装在sda1下会出错。
# reboot
        如果系统能过正常启动
# rm -f /boot/grub/menu.lst*

清除系统中,已删除但是配置信息还在的软件
# dpkg -l |grep ^rc|awk '{print $2}' | xargs dpkg -P

 4. 在虚拟机中更新之后要重新安装的软件

       安装X窗口
# apt-get install xorg
       安装gdm登录管理器
# apt-get install gdm
       安装network-manager
# apt-get install network-manager
# apt-get install network-manager-gnome
# apt-get install gnome-nettool
       安装vmware的鼠标驱动
# apt-get install xserver-xorg-input-vmmouse
       gnome主题、图标、背景、屏保
# apt-get install gnome-themes gnome-screensave gnome-icon-theme-dlg-neu gnome-backgrounds
       安装服务、网络等系统工具
# apt-get install gnome-system-tools
       安装配置编辑器
# apt-get install gconf-editor
       hal (硬件抽象层)、pmount (gnome下自动挂载)
# apt-get install pmount hal
       在右键菜单中加入终端
# apt-get install nautilus-open-terminal

 

        下面的是Debian更新手册上的内容,权威内容,极力推荐。
http://www.debian.org/releases/stable/i386/release-notes/ch-upgrading.en.html
4.1.5. Prepare a safe environment for the upgrade
        The distribution upgrade should be done either locally from a textmode virtual console (or a directly connected serial terminal), or remotely via an ssh link.
Important
        You should not upgrade using telnet, rlogin, rsh, or from an X session managed by xdm, gdm or kdm etc on the machine you are upgrading. That is because each of those services may well be terminated during the upgrade, which can result in an inaccessible system that is only half-upgraded. Use of the GNOME application update-manager is strongly discouraged for upgrades to new releases, as this tool relies on the desktop session remaining active.

4.1.6. Remove conflicting packages
        Due to bug #512951, the splashy package needs to be purged prior to the upgrade.
# apt-get purge splashy

4.2. Checking system status
        The upgrade process described in this chapter has been designed for upgrades from “pure” lenny systems without third-party packages. For the greatest reliability of the upgrade process, you may wish to remove third-party packages from your system before you begin upgrading.
        This procedure also assumes your system has been updated to the latest point release of lenny. If you have not done this or are unsure, follow the instructions in:Section A.2, “Checking your sources list”

4.2.3. Checking packages status
        If you want to check which packages you had on hold for apt-get, you should use
# dpkg --get-selections | grep hold
        If you changed and recompiled a package locally, and didn't rename it or put an epoch in the version, you must put it on hold to prevent it from being upgraded.
        The “hold” package state for apt-get can be changed using:
# echo package_name hold | dpkg --set-selections
        If there is anything you need to fix, it is best to make sure your sources.list still refers to lenny as explained in Section A.2, “Checking your sources list”

4.3. Preparing sources for APT
        Before starting the upgrade you must set up apt's configuration file for package lists, /etc/apt/sources.list.
        A release can often be referred to both by its codename (e.g. lenny, squeeze) and by its status name (i.e. oldstable, stable, testing, unstable). Referring to a release by its codename has the advantage that you will never be surprised by a new release and for this reason is the approach taken here. It does of course mean that you will have to watch out for release announcements yourself. If you use the status name instead, you will just see loads of updates for packages available as soon as a release has happened.
        For example, suppose your closest Debian mirror is http://mirrors.kernel.org. When inspecting that mirror with a web browser or FTP program, you will notice that the main directories are organized like this:
http://mirrors.kernel.org/debian/dists/squeeze/main/binary-i386/...
http://mirrors.kernel.org/debian/dists/squeeze/contrib/binary-i386/...
        To use this mirror with apt, you add this line to your sources.list file:
deb http://mirrors.kernel.org/debian squeeze main contrib
        Note that the `dists' is added implicitly, and the arguments after the release name are used to expand the path into multiple directories.

4.4. Upgrading packages
        Next you should double-check that the APT source entries (in /etc/apt/sources.list) refer either to “squeeze” or to “stable”. There should not be any sources entries pointing to lenny.

4.4.1. Recording the session
        It is strongly recommended that you use the /usr/bin/script program to record a transcript of the upgrade session. Then if a problem occurs, you will have a log of what happened, and if needed, can provide exact information in a bug report. To start the recording, type:
# script -t 2>~/upgrade-squeezestep.time -a ~/upgrade-squeezestep.script
        After you have completed the upgrade, you can stop script by typing exit at the prompt.

4.4.2. Updating the package list
        First the list of available packages for the new release needs to be fetched. This is done by executing:
# apt-get update

4.4.3. Make sure you have sufficient space for the upgrade
        apt-get can show you detailed information of the disk space needed for the installation. Before executing the upgrade, you can see this estimate by running:
# apt-get -o APT::Get::Trivial-Only=true dist-upgrade
        If you do not have enough space for the upgrade, apt-get will warn you with a message like this:
E: You don't have enough free space in /var/cache/apt/archives/.

4.4.6. Upgrading the system
        Once you have taken the previous steps, you are now ready to continue with the main part of the upgrade. Execute:
# apt-get dist-upgrade
Note
        The upgrade process for other releases recommended the use of aptitude for the upgrade. This tool is not recommended for upgrades from lenny to squeeze.

4.7.1. Upgrade to GRUB 2
During the upgrade, you will normally have been offered the option to "chainload" GRUB 2: that is, to keep GRUB Legacy as the primary boot loader but to add an option to it to load GRUB 2 and then start your Debian GNU/Linux system from that. This allows you to verify that GRUB 2 works on your system before committing to use it permanently.

Once you have confirmed that GRUB 2 works, you should switch to using it properly: the chainloading setup is only intended to be used temporarily. You can do this by running upgrade-from-grub-legacy.

Installing GRUB using grub-install

        For information on where GRUB should be installed on PC BIOS platforms, see BIOS installation.

In order to install GRUB under a UNIX-like OS (such as gnu), invoke the program grub-install (see Invoking grub-install) as the superuser (root).

        The usage is basically very simple. You only need to specify one argument to the program, namely, where to install the boot loader. The argument has to be either a device file (like ‘/dev/hda’). For example, under Linux the following will install GRUB into the MBR of the first IDE disk:

# grub-install /dev/hda

        Likewise, under GNU/Hurd, this has the same effect:

# grub-install /dev/hd0


A.1. Upgrading your lenny system
        Basically this is no different than any other upgrade of lenny you've been doing. The only difference is that you first need to make sure your package list still contains references to lenny as explained in Section A.2, “Checking your sources list”.
        If you upgrade your system using a Debian mirror, it will automatically be upgraded to the latest lenny point release.

Section A.2, “Checking your sources list”
        Open the file /etc/apt/sources.list with your favorite editor (as root) and check all lines beginning with deb http: or deb ftp: for a reference to “stable”. If you find any, change stable to lenny.
# apt-get update
to refresh the package list.

A.3. Upgrade legacy locales to UTF-8
        If your system is localised and is using a locale that is not based on UTF-8 you should strongly consider switching your system over to using UTF-8 locales. In the past, there have been bugs identified that manifest itself only when using a non-UTF-8 locale. On the desktop, such legacy locales are supported through ugly hacks in the libraries internals, and we cannot decently provide support for users who still use them.
        To configure your system's locale you can run dpkg-reconfigure locales. Ensure you select an UTF-8 locale when you are presented with the question asking which locale to use as a default in the system. In addition, you should review the locale settings of your users and ensure that they do not have legacy locales definitions in their configuration environment.

参考:

http://www.ducea.com/2011/02/05/howto-upgrade-from-debian-lenny-to-squeeze/

  评论这张
 
阅读(1477)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018