Apt-get dist-upgrade -y против apt-get upgrade

Apt-get dist-upgrade -y против apt-get upgrade

Я задавался этим вопросом время от времени и пока не нашел ответа нигде. Может ли кто-нибудь объяснить, почему некоторые источники добавляют -y после команды обновления? В чем ее функция.

решение1

  • apt-get updateзагружает списки пакетов из репозиториев и «обновляет» их, чтобы получить информацию о новейших версиях пакетов и их зависимостях. Это будет сделано для всех репозиториев и PPA.

    Отhttps://linux.die.net/man/8/apt-get

              Used to re-synchronize the package index files from their sources. 
              The indexes of available packages are fetched from the location(s) 
              specified in /etc/apt/sources.list(5). An update should always be 
              performed before an upgrade or dist-upgrade.
    
  • apt-get upgradeзагрузит новые версии пакетов, существующих на машине, если APT узнает об этих новых версиях с помощью apt-get update.

    Отhttps://linux.die.net/man/8/apt-get

              Used to install the newest versions of all packages currently
              installed on the system from the sources enumerated in 
              /etc/apt/sources.list(5). Packages currently installed with new 
              versions available are retrieved and upgraded; under no 
              circumstances are currently installed packages removed, nor
              are packages that are not already installed retrieved and 
              installed. New versions of currently installed packages that 
              cannot be upgraded without changing the install status of another 
              package will be left at their current version. An update must be 
              performed first so that apt-get knows that new versions of 
              packages are available. 
    
  • -y, --yes, --assume-yes

              Automatic yes to prompts; assume "yes" as answer to all prompts and
              run non-interactively. If an undesirable situation, such as
              changing a held package, trying to install a unauthenticated
              package or removing an essential package occurs then apt-get will
              abort. Configuration Item: APT::Get::Assume-Yes.  
    

    Если вы решили не использовать опцию apt-getwith -y, вам придется отвечать на все запросы, которые вы получите от этой команды, в интерактивном режиме, чтобы выполнение команды продолжилось.

Связанный контент