天天看點

yum update upgrade差別

    今天在做centos的核心更新測試,在使用源碼更新的時候,在網上開到在更新核心之前先進行yum update、yum upgrade。這個兩個到底有什麼差別嗎?網上搜尋了一大把發現全是這樣的說法:

    yum -y update

        更新所有包,改變軟體設定和系統設定,系統版本核心都更新

    yum -y upgrade

        更新所有包,不改變軟體設定和系統設定,系統版本更新,核心不改變

而且還信誓旦旦的貼上了測試結果,真的是這樣的嗎???!!!我們還是看下man yum 是怎麼說的吧!!!

update 

    if run without any packages, update will update every currently installed package.  if one or more packages or pack-age globs are specified, yum will only update the listed packages.  while updating packages, yum will ensure that all dependencies are satisfied.  (see specifying package names for more information) if the packages or globs specified match to packages which are not currently installed then update will not install them.  update  operates  on  groups,files, provides and filelists just like the "install" command.

    if the main obsoletes configure option is true (default) or the --obsoletes flag is present yum will include package obsoletes in its calculations - this makes  it  better  for  distro-version  changes,  for  example:  upgrading  from somelinux 8.0 to somelinux 9.

    note that  "update"  works  on installed packages first, and only if there are no matches does it look for available packages. the difference is most noticeable when you do "update foo-1-2" which will act exactly as  "update  foo"  if foo-1-2 is installed. you can use the "update-to" if you’d prefer that nothing happen in the above case.

upgrade

    is the same as the update command with the --obsoletes flag set. see update for more details.