Upgrading Fedora using yum/zh-cn

From FedoraProject

< Upgrading Fedora using yum(Difference between revisions)
Jump to: navigation, search
(translate headers)
(Fedora 15 -> Fedora 16: translation)
Line 166: Line 166:
 
=== Fedora 15 -> Fedora 16 ===
 
=== Fedora 15 -> Fedora 16 ===
  
First install the new fedora 16 gpg key. You may wish to verify this package against  https://fedoraproject.org/keys and the fedora ssl certificate.
+
首先安装新的 fedora 16 gpg key。您也许希望通过 https://fedoraproject.org/keys fedora ssl 证书来验证这个软件包。
  
 
<pre>
 
<pre>
Line 172: Line 172:
 
</pre>
 
</pre>
  
Upgrade all packages with
+
使用如下命令升级所有软件包
  
 
<pre>
 
<pre>
Line 180: Line 180:
 
</pre>
 
</pre>
  
{{admon/warning|Bootloader change|After the upgrade, you will have the {{package|grub2}} and {{package|grub-efi}} packages installed and the {{package|grub}} package removed. However, grub will still be installed to the MBR and booting should still work. You can follow the instructions below to switch to grub2 if you choose.}}
+
{{admon/warning|Bootloader change|升级之后您的系统会安装上 {{package|grub2}} {{package|grub-efi}} 软件包,移除 {{package|grub}} 软件包。不过 grub 还会安装在 MBR,应该可以正常启动。如果您愿意的话,您可以根据下面的指示切换到 grub2。}}
  
If your system uses a BIOS, or you installed Fedora via BIOS emulation mode on an EFI system (not native EFI mode), you can switch to Fedora 16's supported grub2 bootloader with the following instructions. If your system was installed by native EFI boot, do not switch to grub2, as its EFI support is still unreliable. Fedora 16's supported bootloader for native EFI installations is still grub-legacy, so you should simply continue to use the system without making any special changes to the bootloader configuration.
+
如果您的系统使用的是 BIOS,或者说您在 EFI 系统上通过 BIOS 模拟模式安装的 Fedora (不是原生的 EFI 模式),您可以根据以下指导切换到 Fedora 16 支持的 grub2 启动引导程序。如果您通过原生的 EFI 引导安装的系统,不要切换到 grub2,因为它的 EFI 支持还不可靠。Fedora 16 对原生的 EFI 安装支持的启动引导程序仍然是 grub-legacy,所以您应该直接继续使用系统,而不要对启动引导程序配置做特殊修改。
  
To switch to grub2, run the command {{command|su -c '/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg'}}, then proceed as described [[#bootloader|above]] with reinstalling the bootloader.
+
要切换到 grub2,执行命令 {{command|su -c '/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg'}},然后 proceed as described [[#bootloader|above]] with reinstalling the bootloader.
  
Known issue:
+
已知问题:
 
* Bug [https://bugzilla.redhat.com/show_bug.cgi?id=743022 743022] - F15->F16 yum update fails with IMSM (BIOS) raid
 
* Bug [https://bugzilla.redhat.com/show_bug.cgi?id=743022 743022] - F15->F16 yum update fails with IMSM (BIOS) raid
  

Revision as of 13:11, 2 November 2011

本页面解释了如何使用 yum 来升级 Fedora 的版本。

Contents

直接使用 yum 升级 Fedora

Warning (medium size).png
Version updates without using anaconda - such as the yum method described here - is unsupported and not recommended!
The recommended installation method is with a boot media with the Anaconda installer as detailed in the Installation Guide or use PreUpgrade. PreUpgrade is a slightly different upgrade method where all the packages are downloaded before the system is rebooted into the Anaconda installer. Although upgrades with yum do work, they are not explicitly tested as part of the release process by the Fedora QA and are not documented in the Fedora installation guide. If you are not prepared to resolve issues on your own if things break, you should probably use the recommended installation methods instead.

When upgrading with yum you don't get any help from Anaconda, but with a typical system it might be able to upgrade systems remotely over ssh and with limited downtime. (You will still need to reboot to get the new kernel and system libraries/services running).

A live upgrade with yum usually works well with a typical installation and when following the advice below.

Participate

If you are upgrading using Yum and it shows any general dependency issues, please file them in http://bugzilla.redhat.com. But please read this page, all references pages and search the mailing list archives before filing bugs. And of course, please help keep this page updated.

If you want to help make live upgrades work smoothly, join the Live Upgrade Special Interest Group.

使用 yum 升级的指南

1. 备份您的系统

Back up any personal data to an external hard drive or to another machine. If there is some unrecoverable error that requires a fresh install, you don't want to lose any data.

2. 阅读有关常见问题的内容

Further down in this page there is a list of common problems for specific versions. Some of them require attention before the upgrade.

General advice on upgrading Fedora can be found on the Upgrading page. You should also read the Installation Guide and Release Notes for the version you plan to upgrade to - they contain important information regarding upgrading issues. Finally, check the list of Common bugs.

3. 清理

Review and remove all .rpmsave and .rpmnew files before and after upgrading. (And if you have selinux enabled then remember to check security context if you move config files around.)

Idea.png
Find unused config files
Merge and resolve the changes found by the following script: yum install rpmconf; rpmconf -a Now find and remove old config which nobody owns: find /etc /var -name '*.rpm?*'

Now is a good time to remove packages you don't use - especially non-standard packages.

Idea.png
Find and review "unused" packages
You can find packages not required by other packages with the tool package-cleanup from the yum-utils package: yum install yum-utils; package-cleanup --leaves. These packages could be candidates for removal, but check to see whether you use them directly or if they are used by applications not backed by rpm packages. Remove them with yum remove package-name-and-version.
Another useful tool for cleaning up unused packages is rpmreaper. It's an ncurses application that lets you view rpm dependency graph and mark packages for deletion. Marking one package can make other packages leaf, which you can see immediately, so you don't have to run the tool several times to get rid of whole sub-tree of unused packages. Install with: yum install rpmreaper.
Idea.png
Find and review "lost" packages
You can find orphaned packages (ie packages not in the repositories anymore) with: package-cleanup --orphans. This will also show packages which have been partially uninstalled but where the "%postun" script failed.

4. 正式升级

If you have 3rd party repositories configured, you may need to adjust them for the new Fedora version. If you switch from one Fedora release to another there is often nothing that needs to be done. If you switch to Rawhide from a standard Fedora release (or vice versa) then most of the time you will need to install the Rawhide release RPMs from the 3rd party repository as well (or the standard ones, if switching back).

Note that the upgrade is likely to fail if there are outdated dependencies from packages not backed by a yum repository or backed by a repository which isn't ready for the new version.

It is a good idea to do the upgrade outside the graphical environment. Log out of your graphical desktop and then

切换到文本控制台

ctrl + alt + F2

(or)

log in as root, and go into runlevel 3

init 3

Update yum to latest version available in your Fedora version

yum update yum

Install the new fedora gpg key for the version you are updating to

Keys you may find and verify at

https://fedoraproject.org/keys

or see a version specific update instructions at the bottom.

Clean the cache

Then remove all traces of the version you are leaving from the yum cache in /var/cache/yum.

yum clean all

Upgrade all packages

Warning (medium size).png
Once a live upgrade is started, do not stop the upgrade by rebooting, killing the process, or by any other method until it is complete. Interrupting an upgrade will cause the affected system to be in a mixed state -- partially the old release and partially the new release. In this state, the system will not be reliable and will not operate as expected. You can try running yum distro-sync and package-cleanup --problems to try and fix the problems.
yum --releasever=<release_number_you_want_to_sync_to> distro-sync
Warning (medium size).png
If you experience any dependency problems, you are at your own and you have to solve them manually. If you are not able to, use preupgrade! Most often it is enough to remove several problematic package(s). Be sure to not remove half of your installation.

Note: While it is recommended to upgrade to intermediate releases if upgrading from an older release (for example upgrading from Fedora 12 to 13, then 13 to 14), depending on what version you are upgrading from, this step may fail with an error about GPG keys being in the wrong format. To overcome this, you can add the "--nogpgcheck" switch to the above yum distro-sync command.

5. 确认 Fedora 已经升级

Distro-sync will usually take care of upgrades for the third party repositories you have enabled as well. Confirm with
 yum repolist 
after the upgrade process is over. yum might complain about conflicts or requirements. That is probably because you have used non-standard repositories or installed non-standard packages manually. Try to guess which packages cause the problem (or at least is a part of the dependency chain) - uninstall them and try again. Remember to install the packages again if they are essential.

Ensure that all (new) essential packages from the new version are installed with

yum groupupdate Base

You might want to update other groups too, see

yum grouplist

For example

yum groupupdate "GNOME Desktop Environment" \
"Development Tools" "Server Configuration Tools" \
"Hardware Support" "Sound and Video" \
"Graphical Internet" "Fonts" \
"Games and Entertainment" "Printing Software" \
"Administration Tools" "Office/Productivity" "System Tools"

6. 准备重启

Before booting you should usually install the bootloader from your new grub by running

/sbin/grub-install BOOTDEVICE

- where BOOTDEVICE is usually /dev/sda (If you get an error '/dev/sda does not have any corresponding BIOS drive' from that, then try /sbin/grub-install --recheck /dev/sda). For Fedora 16 and later, use /sbin/grub2-install instead of /sbin/grub-install. See below first for important information about upgrading to Fedora 16 from prior releases.

Also, the order of init scripts could have changed from the previous version. A command to reset the order is:

cd /etc/rc.d/init.d; for f in *; do /sbin/chkconfig $f resetpriorities; done

Again, run package-cleanup --orphans to find packages that haven't been upgraded.

版本相关的注意事项

From pre-release

If you are upgrading to a final release from an alpha, beta, preview, or other Rawhide release, please see Upgrading from pre-release to final.

To development version

yum update yum
yum --releasever=rawhide distro-sync --skip-broken --nogpgcheck

Fedora 15 -> Fedora 16

首先安装新的 fedora 16 gpg key。您也许希望通过 https://fedoraproject.org/keys 和 fedora ssl 证书来验证这个软件包。

rpm --import https://fedoraproject.org/static/A82BA4B7.txt

使用如下命令升级所有软件包

yum update yum
yum clean all
yum --releasever=16 --disableplugin=presto distro-sync
Warning (medium size).png
Bootloader change
升级之后您的系统会安装上 Package-x-generic-16.pnggrub2Package-x-generic-16.pnggrub-efi 软件包,移除 Package-x-generic-16.pnggrub 软件包。不过 grub 还会安装在 MBR,应该可以正常启动。如果您愿意的话,您可以根据下面的指示切换到 grub2。

如果您的系统使用的是 BIOS,或者说您在 EFI 系统上通过 BIOS 模拟模式安装的 Fedora (不是原生的 EFI 模式),您可以根据以下指导切换到 Fedora 16 支持的 grub2 启动引导程序。如果您通过原生的 EFI 引导安装的系统,不要切换到 grub2,因为它的 EFI 支持还不可靠。Fedora 16 对原生的 EFI 安装支持的启动引导程序仍然是 grub-legacy,所以您应该直接继续使用系统,而不要对启动引导程序配置做特殊修改。

要切换到 grub2,执行命令 su -c '/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg',然后 proceed as described above with reinstalling the bootloader.

已知问题:

  • Bug 743022 - F15->F16 yum update fails with IMSM (BIOS) raid

Fedora 14 -> Fedora 15

First install the new fedora 15 gpg key. You may wish to verify this package against https://fedoraproject.org/keys and the fedora ssl certificate.

rpm --import https://fedoraproject.org/static/069C8460.txt

Upgrade all packages with

yum update yum
yum clean all
yum --releasever=15 --disableplugin=presto distro-sync
  • Do not run this from within an X terminal. Testing shows that X might hang while updating bitmap font packages.
  • There exist .drpms, but they don't match, due to a format change, so better disable the presto plugin by adding the option "--disableplugin=presto" (without quotes) when running yum.
  • The F15 screen client is not capable of attaching to F14 screen sessions. Thus, if you want to run the upgrade under screen, you should either upgrade screen itself in a separate operation or make a separate copy of screen to use throughout the process.

VirtualBox guest upgrades

The steps above work perfectly for upgrading a Fedora 14 guest to Fedora 15, but you also need to remove the Guest Additions. If you forget, F14 -> F15 upgrades will seem to fail after the first reboot. If that happens, log in to the console with CTRL+ALT+F2 and reinstall the guest additions manually:

mount /dev/cdrom /media
# if /dev/cdrom does not exist, try:
# mount /dev/sr0 /media
/bin/sh /media/VBoxLinuxAdditions.run
reboot

Fedora 13 -> Fedora 14

First install the new fedora 14 gpg key. You may wish to verify this package against https://fedoraproject.org/keys and the fedora ssl certificate.

rpm --import https://fedoraproject.org/static/97A1071F.txt

Upgrade all packages with

yum update yum
yum clean all
yum --releasever=14 distro-sync
  • If using VirtualBox from the Oracle repository, you must remove the VirtualBox-3.1 package before upgrading. After the upgrade is finished, install VirtualBox-3.2.

If you are running SELinux you may be locked out of your machine and required to boot to single user mode to fix up your machine. Redhat bug 702865 describes a fix as:

  1. setenforce 0
  2. yum remove selinux-policy selinux-policy-targeted
  3. rm -rf /etc/selinux/targeted

If, after upgrading you want selinux back:

  1. yum install selinux-policy selinux-policy-targeted
  2. fixfiles restore
  3. reboot

Upgrading from legacy end of life (EOL) Fedoras

Note.png
Yum upgrading from older versions
Upgrading from older versions of Fedora is archived here: Upgrading from EOL Fedora using yum
Catogory:Zh