본문 바로가기
[OS]

apt/yum/brew 등 패키지관리자의 update와 upgrade의 차이

by 조조군 2020. 12. 20.
반응형

우리는 OS를 운영할때 brew나 yum, apt등을 이용하여 패키지를 관리합니다. 

저도 보통 서버에서는 yum을 통해 관리하고, 맥북에서는 brew를 자주 쓰고있습니다. 

최신버전을 유지하고 싶을땐 update와 upgrade를 둘 다 해주고있었는데요 

문득 그차이가 궁금해졌습니다.


결과 요약

  • yum

    • update : 최신 버전으로 패키지 수정 + 사용하지 않는 패키지 유지
      • $yum update
    • upgrade : 최신 버전으로 패키지 수정 + 사용하지 않는 패키지 삭제 
      • $yum upgrade
    • $yum update --obsoletes 와 $yum upgrade는 같은 처리를 합니다. 
      • --obsoletes 는 사용하지 않는 패키지 삭제 옵션
  • apt

    • update : 업그레이드 가능한 패키지들의 버전에 대한 정보를 업데이트
      • $apt update 
      • 실제로 패키지 수정은 안됨
      • git fetch느낌
    • upgrade : 업그레이드가 가능한 패키지들을 최신 버전으로 패키지 수정
      • $apt upgrade
    • $apt update으로 최신 패키지 정보 확인후 $apt upgrade으로 최신 버전으로 수정을 진행
참고 : apt와 apt-get은 비슷하지만 다른 프로그램
  • apt는 apt-get과 apt-cache의 기능 중에서 잘 사용되지 않는 기능을 제외하고 만든 새로운 tool
  • apt 사용을 권장하고있다. 

 

 

  • brew

    •  update : 업그레이드 가능한 패키지들의 버전에 대한 정보를 업데이트
      • $brew update
      • 업그레이드 가능한 패키지를 화면에 표시해줌
    • upgrade : 업그레이드가 가능한 패키지들을 최신 버전으로 패키지 수정
      • $brew upgrade

가이드 문서

  • yum의 공식문서 내용
    • update :
      update If run without any packages, update will update every currently
      installed package. If one or more packages are specified, Yum will only update the listed packages. While updating packages, yum will ensure that all dependencies are satisfied. If no package matches the given package name(s), they are assumed to be a shell glob and any matches are then installed.
      If the --obsoletes flag is present yum will include package obsoletes in its calculations - this makes it better for dis- tro-version changes, for example: upgrading from somelinux 8.0 to somelinux 9.
    • upgrade :
      Is the same as the update command with the --obsoletes flag set. See update for more details.
 

ManYum - Linux@Duke Project Wiki

man yum These are man pages for yum. man page for yum 2.2.1 begin NAME yum - Yellowdog Updater Modified SYNOPSIS yum [options] [command] [package ...] DESCRIPTION yum is an interactive, automated update program which can be used for maintaining systems usi

web.archive.org

  • brew의 공식문서 내용
    • update : 
      Fetch the newest version of Homebrew and all formulae from GitHub using git(1)
      and perform any necessary migrations.
    • upgrade :
      Upgrade outdated casks and outdated, unpinned formulae using the same options  they were originally installed with, plus any appended brew formula options. If cask or formula are specified, upgrade only the given cask or formula kegs (unless they are pinned; see pin, unpin).
      Unless HOMEBREW_NO_INSTALL_CLEANUP is set, brew cleanup will then be run for the upgraded formulae or, every 30 days, for all formulae.
 

brew(1) – The Missing Package Manager for macOS (or Linux)

Documentation for the missing package manager for macOS.

docs.brew.sh

  • apt의 공식문서 내용
    • update :
      The packaging system uses a private database to keep track of which packages are installed, which are not installed and which are available for installation. The apt-get program uses this database to find out how to install packages requested by the user and to find out which additional packages are needed in order for a selected package to work properly. 
      To update this list, you would use the command apt-get update. This command looks for the package lists in the archives found in /etc/apt/sources.list; see The /etc/apt/sources.list file, Section 2.1 for more information about this file.
      It's a good idea to run this command regularly to keep yourself and your system informed about possible package updates, particularly security updates.
    • upgrade :
      Package upgrades are a great success of the APT system. They can be achieved with a single command: apt-get upgrade. You can use this command to upgrade packages within the same distribution, as well as to upgrade to a new distribution, although for the latter the command apt-get dist-upgrade is preferred; see section Upgrading to a new release, Section 3.5 for more details. 
      It's useful to run this command with the -u option. This option causes APT to show the complete list of packages which will be upgraded. Without it, you'll be upgrading blindly. APT will download the latest versions of each package and will install them in the proper order. It's important to always run apt-get update before you try this. See section Updating the list of available packages, Section 3.1. Look at this example:
 

APT HOWTO (Obsolete Documentation) - Managing packages

Higher versions of sylpheed available from any release will take preference over version 0.4.99, as will any installed higher version of slypheed; so 0.4.99 will be installed only if no version is installed already. This is the priority of installed packag

www.debian.org

 

반응형

댓글