Apt-get dist-nâng cấp -y vs apt-get nâng cấp


0

Tôi đã tự hỏi điều này nhiều lần và vẫn chưa tìm thấy câu trả lời của tôi ở bất cứ đâu. Bất cứ ai cũng có thể giải thích tại sao một số nguồn ném vào -y sau lệnh nâng cấp? Chức năng của nó là gì.

Câu trả lời:


2
  • apt-get updatetải xuống danh sách gói từ kho lưu trữ và "cập nhật" chúng để có được thông tin về các phiên bản mới nhất của gói và phụ thuộc của chúng. Nó sẽ làm điều này cho tất cả các kho lưu trữ và PPA.

    Từ 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 sẽ tìm nạp các phiên bản mới của các gói hiện có trên máy nếu APT biết về các phiên bản mới này bằng cách cập nhật apt-get.

    Từ 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.  
    

    Nếu bạn chọn không sử dụng apt-getvới -ytùy chọn, bạn sẽ cần trả lời tất cả các lời nhắc mà bạn nhận được từ lệnh đó một cách tương tác để tiếp tục thực hiện lệnh.


Thiếu lời giải thích cho sự khác biệt giữa nâng cấp và nâng cấp xa. Nó cũng ở trong trang man, chủ yếu là nó xử lý các thay đổi (thường là do chuyển đổi phiên bản chính) từ những gì tôi hiểu. Tiền tố "trích dẫn" với a> sẽ giúp tôi dễ đọc hơn.
Seth
Khi sử dụng trang web của chúng tôi, bạn xác nhận rằng bạn đã đọc và hiểu Chính sách cookieChính sách bảo mật của chúng tôi.
Licensed under cc by-sa 3.0 with attribution required.