yum 更新内核_如何防止Yum更新内核

yum 更新内核

yum 更新内核

When you’re running production servers, the one thing you don’t want to do is upgrade the kernel every time a new update comes out. Why? Because that’s the only Linux update operation that requires a reboot once it’s done—and in a production environment you often can’t have downtime.

当您运行生产服务器时,您不想做的一件事就是每次出现新更新时都升级内核。 为什么? 因为这是唯一Linux更新操作,完成后需要重新启动-在生产环境中,您通常不会停机。

场景 (The Scenario)

So you finally have your rpm based server set, stable and secure.  Life is good and you don’t figure you have to do anything else for some time.

因此,您终于有了稳定可靠的基于rpm的服务器集。 生活是美好的,你不认为自己必须在一段时间内做任何其他事情。

Then, for some reason, you run at the command line as root:

然后,由于某种原因,您以root身份在命令行中运行:

#yum -y -d0 update

#yum -y -d0更新

Which just happens to supply an affirmative answer to all prompts for the yum command. Which also happens to run as quietly as possible. And which happens this time to include an update to the kernel packages.

恰好为yum命令的所有提示提供了肯定的答案。 这也恰好尽可能安静地运行。 这次发生的情况包括对内核软件包的更新。

And now things are not working correctly.  How could you have prevented this?

现在,事情无法正常进行。 您怎么能避免这种情况?

Although you obviously and desperately need a vacation now, you should revisit your system update schedule, your documentation (which, of course, is meticulous, current and readily available) and especially the configuration files that control yum.

尽管您显然现在迫切需要休假,但您应该重新查看系统更新时间表,文档(当然是细致的,最新的并且随时可用),尤其是控制yum的配置文件。

But first, why wouldn’t you want to update the kernel?

但是首先,为什么不更新内核?

  1. Things sometimes break.  An update might make modules or drivers incompatible so devices such as a wireless card are no longer functional.

    事情有时会破裂。 更新可能会使模块或驱动程序不兼容,从而使诸如无线卡之类的设备不再起作用。
  2. Maintain versions across server populations.  This would certainly apply if you have a mix of different server distributions along with some home built boxes.

    维护服务器群之间的版本。 如果您混合使用不同的服务器发行版和一些内置盒,则肯定适用。
  3. Compiled the kernel manually, thus bypassing the automatic configuration supplied by yum

    手动编译内核,从而绕过yum提供的自动配置
  4. You are horribly proud of your uptime so performing a reboot to activate the  new kernel would not be in your best interest.  So if you never reboot, there is never a need to update it.

    您为正常运行时间感到非常骄傲,因此执行重新启动以激活新内核不会对您有最大好处。 因此,如果您从不重启,则无需更新它。

Why would you want to update the kernel?

您为什么要更新内核?

  1. Primarily – security.  Kernels have holes just like applications and, if not patched, can provide opportunities for the compromising of the system by the bad guys.

    主要是安全性。 内核就像应用程序一样具有漏洞,即使不进行修补,也可以为坏人提供破坏系统的机会。
  2. Especially if you are not using a 3rd party repository, to keep your version as up to date as possible.  Major distros release patches to all of their included code including the kernel and strive to test it before release to ensure stability.  To not update is to lag behind which might make things more difficult when performing an upgrade to a major version release.

    特别是如果您不使用第三方存储库,请保持版本最新。 主要发行版发布了所有包含内核的代码的补丁程序,包括内核,并努力在发布前对其进行测试以确保稳定性。 不更新是滞后的,在升级到主要版本时,这可能会使事情变得更加困难。
  3. Taking advantage of a new feature (or to fix a previously broken one) would make you possibly more amenable to a kernel update.

    利用一项新功能(或修复先前已损坏的功能)将使您更可能接受内核更新。

To update the kernel just do what you did above.  Or, better, eliminate the  command line switches so you have some control over the update process and can see what is happening.  Run:

要更新内核,只需执行上面的操作即可。 或者,更好的是,消除命令行开关,以便您可以控制更新过程并查看正在发生的情况。 跑:

#yum update

#yum更新

and follow the prompts.

并按照提示进行操作。

防止Yum更新内核 (Preventing Yum from Updating the Kernel)

However, if you don’t ever want to just blindly have the kernel updated, you can add the following to your /etc/yum.conf file:

但是,如果您不想盲目更新内核,则可以将以下内容添加到/etc/yum.conf文件中:

exclude=kernel*

排除=内核*

Or, if you insist on using a vanilla configuration file and control everything via the CLI, use

或者,如果您坚持使用原始配置文件并通过CLI控制所有内容,请使用

#yum –exclude=kernel* update

#yum –exclude = kernel *更新

Both of these methods will eliminate the kernel from being updated or even included in the potential update listing.

这两种方法都将消除内核的更新,甚至不会将其包含在潜在的更新列表中。

翻译自: https://www.howtogeek.com/50898/how-to-prevent-yum-from-updating-the-kernel/

yum 更新内核

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值