From Fedora Project Wiki
mNo edit summary
 
(24 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{autolang}}
{{autolang}}


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


== 直接使用 yum 升级 Fedora ==
{{admon/warning| 这篇文章已经过时啦,请阅读 [[Upgrading]] 了解有关升级 Fedora 的最佳实践。 }}


{{admon/warning| Version updates without using anaconda - such as the yum method described here - is unsupported and not recommended! |
本页面讲述了如何使用 {{command|yum}} 来升级您的 Fedora 版本。


The recommended installation method is with a boot media with the Anaconda installer as detailed in the [http://docs.fedoraproject.org/install-guide/ 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.
== 直接通过 yum 升级 ==


Although upgrades with yum do work, they are not explicitly tested as part of the release process by the [[QA|Fedora QA]] and are not documented in the [http://docs.fedoraproject.org/en-US/Fedora/{{FedoraVersion}}/html/Installation_Guide/index.html 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.}}
{{admon/warning| 新的 Fedora 已经使用 DNF 作为包管理器,推荐的升级做法已经变为使用 DNF 的系统升级插件。


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).
此页描述的使用 yum 升级的方法不推荐新用户使用。


A live upgrade with yum usually works well with a typical installation and when following the advice below.
在升级到 Fedora 18 或更新版本时,推荐的使用 [[FedUp]] 工具。使用 FedUp 升级说明见 [[FedUp#How_Can_I_Upgrade_My_System_with_FedUp?|This section]]。


== Participate ==
在升级到 Fedora 17 或早期版本时,推荐使用包含 Anaconda 安装器的可引导媒体,详见 [http://docs.fedoraproject.org/install-guide/ Installation Guide],或者通过 [[PreUpgrade]]。[[PreUpgrade]] 是一个稍有不同的更新方法,需要在重启系统进入 Anaconda 安装器前下载全部软件包。


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.
尽管使用 yum 升级有效,但它不确定作为发布过程的一个环节而被测试,见 [[QA|Fedora QA]];在 [http://docs.fedoraproject.org/en-US/Fedora/{{FedoraVersion}}/html/Installation_Guide/index.html Fedora installation guide] 页也没有相应的文档说明。如果你没有做好在出问题后自己解决的准备,你应当使用推荐的安装方法。}}


If you want to help make live upgrades work smoothly, join the [[SIGs/LiveUpgrade | Live Upgrade Special Interest Group]].
当你使用 yum 更新时将无法从 FedUp 或 Anaconda 得到帮助,但是在一个典型系统中,你可以在有限的停机时间内通过 ssh 远程更新系统。(你仍需要重启系统使得新内核和系统库或服务运行)。


== 使用 yum 升级的指南 ==
当遵循下面的建议时,在一个典型安装的系统中使用 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.
如果你在使用 yum 升级的过程中遇到一般性依赖问题,请将它们归档至 http://bugzilla.redhat.com。但在提交 bug 前请阅读此页、所有相关页,搜索邮件列表归档。当然,确保此页最新。


=== 2. 阅读有关常见问题的内容 ===
如果你想参与使得实时更新平滑进行,加入 [[SIGs/LiveUpgrade | Live Upgrade Special Interest Group]]。


Further down in this page there is a list of common problems for specific versions. Some of them require attention before the upgrade.
== 使用 yum 升级详解 ==


General advice on upgrading Fedora can be found on the [[Upgrading]] page. You should also read the [http://docs.fedoraproject.org/install-guide/ Installation Guide] and [http://docs.fedoraproject.org/release-notes/ Release Notes] for the version you plan to upgrade to - they contain important information regarding upgrading issues. Finally, check the list of [[Common bugs]].
=== 1. 备份你的系统 ===
 
备份所有个人数据到移动硬盘或其他机器。如果发生不可恢复的错误需要重新安装,你将不会丢失任何数据。
 
=== 2. 阅读常见问题 ===
 
向下拉这个页面会有具体版本通过 yum 升级常见问题的清单。其中一些问题需要在升级前关注。
 
升级 Fedora 的一般性建议可以查看 [[Upgrading]] 页面。你也可以阅读 [http://docs.fedoraproject.org/install-guide/ Installation Guide] [http://docs.fedoraproject.org/release-notes/ Release Notes] 页面查找你计划升级到的版本——它们包含了关于升级问题的重要信息。最后,检查 [[Common bugs]] 列表。


=== 3. 清理 ===
=== 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.)
在升级前后检索并删除所有的 .rpmsave .rpmnew 文件。(如果开启了 selinux 并移动了配置文件的话,记得检查安全配置。)


{{admon/tip|Find unused config files|Merge and resolve the changes found by the following script: <code>yum install rpmconf; rpmconf -a</code>
{{admon/tip|查找未使用配置文件|分解和合并通过以下脚本查找出的改动: <code>yum install rpmconf; rpmconf -a</code>
Now find and remove old config which nobody owns: <code>find /etc /var -name '*.rpm?*'</code>}}
找出并删除不再被使用的配置文件: <code>find /etc /var -name '*.rpm?*'</code>}}


Now is a good time to remove packages you don't use - especially non-standard packages.
现在最好移除不再使用的软件包——尤其是那些不标准的软件包。


{{admon/tip|Find and review "unused" packages| You can find packages not required by other packages with the tool <code>package-cleanup</code> from the <code>yum-utils</code> package: <code>yum install yum-utils; package-cleanup --leaves</code>. 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 <code>yum remove package-name-and-version</code>.<br/>
{{admon/tip|检索和查找未使用的软件包| 你可以通过 <code>yum-utils</code> 软件包中的 <code>package-cleanup</code> 工具找出不再被依赖的软件包: <code>yum install yum-utils; package-cleanup --leaves</code>。 这些软件包将在下一步被删除,但在这之前得检查是否被直接使用或被不依赖 rpm 软件包的应用使用。 删除: <code>yum remove package-name-and-version</code><br/>
Another useful tool for cleaning up unused packages is <code>rpmreaper</code>.  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: <code>yum install rpmreaper</code>.
另外一个用来清除未使用软件包的实用工具是 <code>rpmreaper</code>。它是一个用于图形化查看 rpm 依赖和将被删除软件包的值守应用。通过一个软件包可以即时查看到其他相关的节点,所以无须再多次检索来查找未使用软件包的子树。安装: <code>yum install rpmreaper</code>
}}
}}


{{admon/tip|Find and review "lost" packages| You can find orphaned packages (ie packages not in the repositories anymore) with: <code>package-cleanup --orphans</code>. This will also show packages which have been partially uninstalled but where the "%postun" script failed.}}
{{admon/tip|查找和检索丢失的软件包| 检查被遗弃的软件包 (例如不再被软件库包含) <code>package-cleanup --orphans</code>。 这也将列出卸载不完全但是又无法被 "%postun" 清除的软件包。}}


=== 4. 正式升级 ===
=== 4. Do the upgrade ===


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).
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).
Line 56: Line 63:
It is a good idea to do the upgrade outside the graphical environment. Log out of your graphical desktop and then  
It is a good idea to do the upgrade outside the graphical environment. Log out of your graphical desktop and then  


==== 切换到文本控制台 ====
==== Go to a text console ====


<pre>
<pre>
Line 105: Line 112:
'''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.
'''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 已经升级 ===
=== 5. Make sure Fedora is upgraded ===


Distro-sync will usually take care of upgrades for the third party repositories you have enabled as well.  Confirm with <pre> yum repolist </pre>  after the upgrade process is over.  <code>yum</code> 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.   
Distro-sync will usually take care of upgrades for the third party repositories you have enabled as well.  Confirm with <pre> yum repolist </pre>  after the upgrade process is over.  <code>yum</code> 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.   
Line 132: Line 139:
</pre>
</pre>


=== 6. 准备重启 ===
=== 6. Preparing for reboot ===


{{Anchor|bootloader}}
{{Anchor|bootloader}}
Line 149: Line 156:
Again, run <code>package-cleanup --orphans</code> to find packages that haven't been upgraded.
Again, run <code>package-cleanup --orphans</code> to find packages that haven't been upgraded.


== 版本相关的注意事项 ==
== Version specific notes ==


=== From pre-release ===
=== From pre-release ===
Line 161: Line 168:
yum --releasever=rawhide distro-sync --skip-broken --nogpgcheck
yum --releasever=rawhide distro-sync --skip-broken --nogpgcheck
</pre>
</pre>
{{Anchor|16-17}}
=== Fedora 16 -> Fedora 17 ===
{{admon/warning||This references an unreleased version of Fedora.  The steps here may change before release.}}
First install the new Fedora 17 gpg key
rpm --import https://fedoraproject.org/static/1ACA3465.txt
Fedora 17 will locate the entire base operating system in /usr. The directories
/bin, /sbin, /lib, /lib64 will only be symlinks:
/bin → /usr/bin
/sbin → /usr/sbin
/lib → /usr/lib
/lib64 → /usr/lib64
Some reasoning behind this change is outlined here:
http://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge
Currently installed systems need some manual steps to convert the current system
to match the layout of Fedora 17. After that, the system can continue to
be updated with YUM as usual.
Some RPM packages in Fedora 17 are carrying an RPM dependency guard, which
will make sure, they can only be installed when /bin, /sbin, /lib, /lib64 are
symlinks and not directories like in Fedora 16 and older.
The installed system’s base filesystem layout can not be safely altered, while
the system itself is running on top of it. Dracut, the initramfs used to find
and mount the root filesystem, can be instructed to convert the filesystem to
match Fedora 17’s expectations.
If your system has a split-off /usr, a separate mount point, the dracut /usr
mount conversion logic might not work. If /usr resides on the net, then ou should add "rd.neednet=1" and the network settings like "ip=dhcp" on the kernel command line.
/usr on iSCSI, FCoE, NBD also is supported, as long as “netroot=...” is
specified on the kernel command line for these disks (see man dracut.kernel(7)).
If you have /usr on LVM, MD raid or DM raid, make sure the kernel command line has either all settings like "rd.lvm.lv=..." to ensure the /usr device is accessible in dracut or just remove all restrictions like "rd.lvm...", "rd.md...", "rd.dm...". Either way, you should probably use anaconda to update, if you are experiencing problems with a separate /usr.
Here are the steps to prepare your system, to convert it, and to be able to
continue updating your installed system with yum:
Download and install the most recent dracut packages:
# yum update dracut
You should at least have [https://admin.fedoraproject.org/updates/dracut-009-14.fc15 dracut-009-14.fc15] for Fedora 15 or [https://admin.fedoraproject.org/updates/dracut-013-22.fc16 dracut-013-22.fc16] for Fedora 16.
Turn off any "hostonly" settings in /etc/dracut.conf*, if you turned on "hostonly".
Update the installed initramfs image for your current kernel, and instruct
dracut to include the dracut module to convert your current filesystem:
# dracut --force --add convertfs
If your system has a split-off /usr, a separate mount point, and you don't know the kernel command line parameter to add, you can also try (dracut tries to generate them internally):
# dracut -H --force --add convertfs
If dracut detects ‘rd.convertfs’ on the kernel command line at bootup, it starts
the filesystem conversion of the root filesystem. If it is already converted, it will just do nothing.
{{admon/warning||<code>dracut</code> will by default update the initramfs for the currently running kernel. Make sure that no new kernel has been installed since last boot and that you really will boot into the updated initramfs.}}
Change the following kernel commandline parameter directly in the bootloader
menu, which is shown during bootup, or edit the line in <code>/etc/grub*.cfg</code>  to remove ro and rhgb and append <code>rw rd.info rd.convertfs enforcing=0</code>
Explanation of the options:
- remove “ro” (read only)
- append “rw” (read write) to let dracut mount your root filesystem writeable
- remove “rhgb” (Red Hat graphical boot) to disable the graphical bootsplash
- append “rd.info” to get a more verbose output from dracut
- append “rd.convertfs” to enable the /usr-move conversion script in dracut
- append “enforcing=0” to disable SELinux enforcement
During bootup, dracut will now convert your filesystem, and /lib, /lib64, /bin
and /sbin should then all be symbolic links to the corresponding directories in
/usr.
After the conversion, the system needs to be immediately updated to Fedora 17. No
packages from Fedora 16 or Fedora 15, or older rawhide packages must be installed anymore.
Make sure to disable any Fedora 15 and Fedora 16 repositories in yum!
Any files with conflicting names, which the conversion could not resolve, will
be backed up to files named *.usrmove~ residing in /usr/lib, /usr/lib64,
/usr/bin and /usr/sbin.
Verify that dracut really completed the conversion. The log messages, which dracut has generated during bootup, can be retrieved with:
# dmesg | grep dracut
After a successful conversion, revert the changes made to the kernel command
line in the bootloader config file /etc/grub*.cfg.
Then run,
# yum --releasever=17 update rpm
# rm -f /var/lib/rpm/__*
# rpm --rebuilddb
# yum --releasever=17 --disableplugin=presto --skip-broken distro-sync
# fixfiles onboot 
After upgrading, all should be set and done.
Have fun with your system and say “Good bye” to /bin, /sbin, /lib, /lib64 and
meet them in /usr.


{{Anchor|15-16}}
{{Anchor|15-16}}
Line 166: Line 278:
=== Fedora 15 -> Fedora 16 ===
=== Fedora 15 -> Fedora 16 ===


首先安装新的 fedora 16 gpg key。您也许希望通过 https://fedoraproject.org/keys fedora ssl 证书来验证这个软件包。
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.


<pre>
<pre>
Line 172: Line 284:
</pre>
</pre>


使用如下命令升级所有软件包
Next run {{command|chkconfig --list}} and note the enabled services; you will need to re-enable these with {{command|systemctl enable ''xxxxx''.service}} after you reboot, as the {{package|sysvinit}} settings aren't propagated into {{package|systemd}}. See [[Common_F16_bugs#Upgrade_from_previous_releases_resets_the_enablement_status_of_services|release notes]] for more details.
 
Upgrade all packages with


<pre>
<pre>
Line 180: Line 294:
</pre>
</pre>


{{admon/warning|启动引导程序的改变|升级之后您的系统会安装上 {{package|grub2}} {{package|grub-efi}} 软件包,移除 {{package|grub}} 软件包。不过 grub 还会安装在 MBR,应该可以正常启动。如果您愿意的话,您可以根据下面的指示切换到 grub2。}}
{{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. If installed, the {{package|firstaidkit-plugin-grub}} package may prevent the upgrade; do simply remove that package if that is the case.}}


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


要切换到 grub2,执行命令 {{command|su -c '/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg'}},然后依照 [[#bootloader|上面的]] 描述继续,重新安装启动引导程序。
To switch to grub2, run the command {{command|su -c '/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg'}}, then proceed as described [[#6._Preparing_for_reboot|above]] with reinstalling the bootloader.


已知问题:
Known you upgrade -specific issues (for common problems, see references above):
* 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


{{Anchor|14-15}}
{{Anchor|14-15}}
Line 210: Line 325:
* 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.
* 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 <code>screen</code> client is not capable of attaching to F14 <code>screen</code> sessions.  Thus, if you want to run the upgrade under <code>screen</code>, you should either upgrade <code>screen</code> itself in a separate operation or make a separate copy of <code>screen</code> to use throughout the process.
* The F15 <code>screen</code> client is not capable of attaching to F14 <code>screen</code> sessions.  Thus, if you want to run the upgrade under <code>screen</code>, you should either upgrade <code>screen</code> itself in a separate operation or make a separate copy of <code>screen</code> to use throughout the process.
* mysql 5.5.20 shipped with F15 uses InnoDB as default storage engine. After upgrading, mysqld could refuse to start-up with error ''Unknown/unsupported storage engine: InnoDB'' if argument ''skip-innodb'' is given on command line or configuration file ''/etc/my.cnf''. Workarounds are removing the line (InnoDB will be run as default engine), or adding ''default-storage-engine'' command options specifying some other storage engine.


==== VirtualBox guest upgrades ====
==== VirtualBox guest upgrades ====
Line 257: Line 373:


=== Upgrading from legacy end of life (EOL) Fedoras ===
=== Upgrading from legacy end of life (EOL) Fedoras ===
{{admon/note|Yum upgrading from older versions|Upgrading from older versions of Fedora is archived here: [[Upgrading from EOL Fedora using yum]]}}
{{admon/note|Yum upgrading from older versions|Upgrading from older versions of Fedora is archived here: [[Upgrading from EOL Fedora using package manager]]}}


[[Category:FAQ]][[Category:How to]][[Category:Documentation]][[Catogory:Zh]]
[[Category:FAQ]]
[[Category:How to]]
[[Category:Documentation]]

Latest revision as of 14:58, 6 April 2021


这篇文章已经过时啦,请阅读 Upgrading 了解有关升级 Fedora 的最佳实践。

本页面讲述了如何使用 yum 来升级您的 Fedora 版本。

直接通过 yum 升级

新的 Fedora 已经使用 DNF 作为包管理器,推荐的升级做法已经变为使用 DNF 的系统升级插件。

此页描述的使用 yum 升级的方法不推荐新用户使用。

在升级到 Fedora 18 或更新版本时,推荐的使用 FedUp 工具。使用 FedUp 升级说明见 This section

在升级到 Fedora 17 或早期版本时,推荐使用包含 Anaconda 安装器的可引导媒体,详见 Installation Guide,或者通过 PreUpgradePreUpgrade 是一个稍有不同的更新方法,需要在重启系统进入 Anaconda 安装器前下载全部软件包。

尽管使用 yum 升级有效,但它不确定作为发布过程的一个环节而被测试,见 Fedora QA;在 Fedora installation guide 页也没有相应的文档说明。如果你没有做好在出问题后自己解决的准备,你应当使用推荐的安装方法。

当你使用 yum 更新时将无法从 FedUp 或 Anaconda 得到帮助,但是在一个典型系统中,你可以在有限的停机时间内通过 ssh 远程更新系统。(你仍需要重启系统使得新内核和系统库或服务运行)。

当遵循下面的建议时,在一个典型安装的系统中使用 yum 仍能得到很好的实时升级。

参与

如果你在使用 yum 升级的过程中遇到一般性依赖问题,请将它们归档至 http://bugzilla.redhat.com。但在提交 bug 前请阅读此页、所有相关页,搜索邮件列表归档。当然,确保此页最新。

如果你想参与使得实时更新平滑进行,加入 Live Upgrade Special Interest Group

使用 yum 升级详解

1. 备份你的系统

备份所有个人数据到移动硬盘或其他机器。如果发生不可恢复的错误需要重新安装,你将不会丢失任何数据。

2. 阅读常见问题

向下拉这个页面会有具体版本通过 yum 升级常见问题的清单。其中一些问题需要在升级前关注。

升级 Fedora 的一般性建议可以查看 Upgrading 页面。你也可以阅读 Installation GuideRelease Notes 页面查找你计划升级到的版本——它们包含了关于升级问题的重要信息。最后,检查 Common bugs 列表。

3. 清理

在升级前后检索并删除所有的 .rpmsave 和 .rpmnew 文件。(如果开启了 selinux 并移动了配置文件的话,记得检查安全配置。)

查找未使用配置文件
分解和合并通过以下脚本查找出的改动: yum install rpmconf; rpmconf -a 找出并删除不再被使用的配置文件: find /etc /var -name '*.rpm?*'

现在最好移除不再使用的软件包——尤其是那些不标准的软件包。

检索和查找未使用的软件包
你可以通过 yum-utils 软件包中的 package-cleanup 工具找出不再被依赖的软件包: yum install yum-utils; package-cleanup --leaves。 这些软件包将在下一步被删除,但在这之前得检查是否被直接使用或被不依赖 rpm 软件包的应用使用。 删除: yum remove package-name-and-version
另外一个用来清除未使用软件包的实用工具是 rpmreaper。它是一个用于图形化查看 rpm 依赖和将被删除软件包的值守应用。通过一个软件包可以即时查看到其他相关的节点,所以无须再多次检索来查找未使用软件包的子树。安装: yum install rpmreaper
查找和检索丢失的软件包
检查被遗弃的软件包 (例如不再被软件库包含) : package-cleanup --orphans。 这也将列出卸载不完全但是又无法被 "%postun" 清除的软件包。

4. Do the upgrade

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

Go to a text console

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

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
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. Make sure Fedora is upgraded

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. Preparing for reboot

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.

Version specific notes

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 16 -> Fedora 17

This references an unreleased version of Fedora. The steps here may change before release.

First install the new Fedora 17 gpg key

rpm --import https://fedoraproject.org/static/1ACA3465.txt

Fedora 17 will locate the entire base operating system in /usr. The directories /bin, /sbin, /lib, /lib64 will only be symlinks:

/bin → /usr/bin
/sbin → /usr/sbin
/lib → /usr/lib
/lib64 → /usr/lib64

Some reasoning behind this change is outlined here:

http://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge

Currently installed systems need some manual steps to convert the current system to match the layout of Fedora 17. After that, the system can continue to be updated with YUM as usual.

Some RPM packages in Fedora 17 are carrying an RPM dependency guard, which will make sure, they can only be installed when /bin, /sbin, /lib, /lib64 are symlinks and not directories like in Fedora 16 and older.

The installed system’s base filesystem layout can not be safely altered, while the system itself is running on top of it. Dracut, the initramfs used to find and mount the root filesystem, can be instructed to convert the filesystem to match Fedora 17’s expectations.

If your system has a split-off /usr, a separate mount point, the dracut /usr mount conversion logic might not work. If /usr resides on the net, then ou should add "rd.neednet=1" and the network settings like "ip=dhcp" on the kernel command line. /usr on iSCSI, FCoE, NBD also is supported, as long as “netroot=...” is specified on the kernel command line for these disks (see man dracut.kernel(7)). If you have /usr on LVM, MD raid or DM raid, make sure the kernel command line has either all settings like "rd.lvm.lv=..." to ensure the /usr device is accessible in dracut or just remove all restrictions like "rd.lvm...", "rd.md...", "rd.dm...". Either way, you should probably use anaconda to update, if you are experiencing problems with a separate /usr.

Here are the steps to prepare your system, to convert it, and to be able to continue updating your installed system with yum:

Download and install the most recent dracut packages:

# yum update dracut

You should at least have dracut-009-14.fc15 for Fedora 15 or dracut-013-22.fc16 for Fedora 16.

Turn off any "hostonly" settings in /etc/dracut.conf*, if you turned on "hostonly".

Update the installed initramfs image for your current kernel, and instruct dracut to include the dracut module to convert your current filesystem:

# dracut --force --add convertfs

If your system has a split-off /usr, a separate mount point, and you don't know the kernel command line parameter to add, you can also try (dracut tries to generate them internally):

# dracut -H --force --add convertfs

If dracut detects ‘rd.convertfs’ on the kernel command line at bootup, it starts the filesystem conversion of the root filesystem. If it is already converted, it will just do nothing.

dracut will by default update the initramfs for the currently running kernel. Make sure that no new kernel has been installed since last boot and that you really will boot into the updated initramfs.

Change the following kernel commandline parameter directly in the bootloader menu, which is shown during bootup, or edit the line in /etc/grub*.cfg to remove ro and rhgb and append rw rd.info rd.convertfs enforcing=0

Explanation of the options:

- remove “ro” (read only)
- append “rw” (read write) to let dracut mount your root filesystem writeable
- remove “rhgb” (Red Hat graphical boot) to disable the graphical bootsplash
- append “rd.info” to get a more verbose output from dracut
- append “rd.convertfs” to enable the /usr-move conversion script in dracut
- append “enforcing=0” to disable SELinux enforcement

During bootup, dracut will now convert your filesystem, and /lib, /lib64, /bin and /sbin should then all be symbolic links to the corresponding directories in /usr.

After the conversion, the system needs to be immediately updated to Fedora 17. No packages from Fedora 16 or Fedora 15, or older rawhide packages must be installed anymore. Make sure to disable any Fedora 15 and Fedora 16 repositories in yum!

Any files with conflicting names, which the conversion could not resolve, will be backed up to files named *.usrmove~ residing in /usr/lib, /usr/lib64, /usr/bin and /usr/sbin.

Verify that dracut really completed the conversion. The log messages, which dracut has generated during bootup, can be retrieved with:

# dmesg | grep dracut

After a successful conversion, revert the changes made to the kernel command line in the bootloader config file /etc/grub*.cfg.

Then run,

# yum --releasever=17 update rpm
# rm -f /var/lib/rpm/__*
# rpm --rebuilddb
# yum --releasever=17 --disableplugin=presto --skip-broken distro-sync
# fixfiles onboot  

After upgrading, all should be set and done.

Have fun with your system and say “Good bye” to /bin, /sbin, /lib, /lib64 and meet them in /usr.

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.

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

Next run chkconfig --list and note the enabled services; you will need to re-enable these with systemctl enable xxxxx.service after you reboot, as the sysvinit settings aren't propagated into systemd. See release notes for more details.

Upgrade all packages with

yum update yum
yum clean all
yum --releasever=16 --disableplugin=presto distro-sync
Bootloader change
After the upgrade, you will have the grub2 and grub-efi packages installed and the 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. If installed, the firstaidkit-plugin-grub package may prevent the upgrade; do simply remove that package if that is the case.

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.

To switch to grub2, run the command su -c '/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg', then proceed as described above with reinstalling the bootloader.

Known you upgrade -specific issues (for common problems, see references above):

  • 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.
  • mysql 5.5.20 shipped with F15 uses InnoDB as default storage engine. After upgrading, mysqld could refuse to start-up with error Unknown/unsupported storage engine: InnoDB if argument skip-innodb is given on command line or configuration file /etc/my.cnf. Workarounds are removing the line (InnoDB will be run as default engine), or adding default-storage-engine command options specifying some other storage engine.

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

Yum upgrading from older versions
Upgrading from older versions of Fedora is archived here: Upgrading from EOL Fedora using package manager