Package managers for installing applications
用於安裝應用程式的套件管理器
Previously, you learned about Linux distributions and that different distributions derive from different sources, such as Debian or Red Hat Enterprise Linux distribution. You were also introduced to package managers, and learned that Linux applications are commonly distributed through package managers. In this reading, you’ll apply this knowledge to learn more about package managers.
之前,你已經學習過 Linux 發行版,並了解到不同的發行版來自不同的來源,例如 Debian 或 Red Hat Enterprise Linux 發行版。你也接觸過套件管理器,並了解到 Linux 應用程式通常是通過套件管理器分發的。在這篇閱讀中,你將運用這些知識來進一步了解套件管理器。
Introduction to package managers
套件管理器介紹
A package is a piece of software that can be combined with other packages to form an application. Some packages may be large enough to form applications on their own.
套件是一段可以與其他套件結合形成應用程式的軟體。有些套件可能足夠大,可以單獨形成應用程式。
Packages contain the files necessary for an application to be installed. These files include dependencies, which are supplemental files used to run an application.
套件包含安裝應用程式所需的檔案。這些檔案包括相依性,這些是用來執行應用程式的輔助檔案。
Package managers can help resolve any issues with dependencies and perform other management tasks. A package manager is a tool that helps users install, manage, and remove packages or applications. Linux uses multiple package managers.
套件管理器可以幫助解決任何依賴性問題並執行其他管理任務。套件管理器是一種工具,幫助用戶安裝、管理和移除套件或應用程式。Linux 使用多種套件管理器。
Note: It’s important to use the most recent version of a package when possible. The most recent version has the most up-to-date bug fixes and security patches. These help keep your system more secure.
注意:盡可能使用套件的最新版本非常重要。最新版本包含最新的錯誤修正和安全補丁,這些有助於保持系統的安全性。
Types of package managers
套件管理器的類型
Many commonly used Linux distributions are derived from the same parent distribution. For example, KALI LINUX ™, Ubuntu, and Parrot all come from Debian. CentOS comes from Red Hat.
許多常用的 Linux 發行版源自相同的母發行版。例如,KALI LINUX™、Ubuntu 和 Parrot 都來自 Debian。CentOS 則來自 Red Hat。
This knowledge is useful when installing applications because certain package managers work with certain distributions. For example, the Red Hat Package Manager (RPM) can be used for Linux distributions derived from Red Hat, and package managers such as dpkg can be used for Linux distributions derived from Debian.
這些知識在安裝應用程式時非常有用,因為某些套件管理器適用於特定的發行版。例如,Red Hat Package Manager(RPM)可以用於從 Red Hat 衍生的 Linux 發行版,而像 dpkg 這樣的套件管理器可以用於從 Debian 衍生的 Linux 發行版。
Different package managers typically use different file extensions. For example, Red Hat Package Manager (RPM) has files which use the .rpm file extension, such as Package-Version-Release_Architecture.rpm. Package managers for Debian-derived Linux distributions, such as dpkg, have files which use the .deb file extension, such as Package_Version-Release_Architecture.deb
不同的套件管理器通常使用不同的文件擴展名。例如,Red Hat Package Manager (RPM) 的文件使用 .rpm 文件擴展名,如 Package-Version-Release_Architecture.rpm。用於 Debian 衍生的 Linux 發行版的套件管理器,如 dpkg,其文件使用 .deb 文件擴展名,如 Package_Version-Release_Architecture.deb.
Package management tools 套件管理工具
In addition to package managers like RPM and dpkg, there are also package management tools that allow you to easily work with packages through the shell. Package management tools are sometimes utilized instead of package managers because they allow users to more easily perform basic tasks, such as installing a new package. Two notable tools are the Advanced Package Tool (APT) and Yellowdog Updater Modified (YUM).
除了像 RPM 和 dpkg 這樣的套件管理器之外,還有一些套件管理工具可以讓你通過 shell 輕鬆地處理套件。套件管理工具有時會被用來代替套件管理器,因為它們允許用戶更輕鬆地執行基本任務,例如安裝新套件。兩個值得注意的工具是 Advanced Package Tool (APT) 和 Yellowdog Updater Modified (YUM)。
Advanced Package Tool (APT)
APT is a tool used with Debian-derived distributions. It is run from the command-line interface to manage, search, and install packages.
APT 是一個用於基於 Debian 的發行版的工具。它從命令行介面運行,用於管理、搜尋和安裝套件。
Yellowdog Updater Modified (YUM)
YUM is a tool used with Red Hat-derived distributions. It is run from the command-line interface to manage, search, and install packages. YUM works with .rpm files.
YUM 是一個用於 Red Hat 衍生發行版的工具。它從命令行介面運行,用於管理、搜索和安裝套件。YUM 使用 .rpm 文件。
Key takeaways 關鍵要點
A package is a piece of software that can be combined with other packages to form an application. Packages can be managed using a package manager. There are multiple package managers and package management tools for different Linux distributions. Package management tools allow users to easily work with packages through the shell. Debian-derived Linux distributions use package managers like dpkg as well as package management tools like Advanced Package Tool (APT). Red Hat-derived distributions use the Red Hat Package Manager (RPM) or tools like Yellowdog Updater Modified (YUM).
套件是一個可以與其他套件結合形成應用程式的軟體。套件可以使用套件管理器來管理。不同的 Linux 發行版有多種套件管理器和套件管理工具。套件管理工具允許使用者通過 shell 輕鬆地處理套件。Debian 衍生的 Linux 發行版使用像 dpkg 這樣的套件管理器以及像 Advanced Package Tool (APT) 這樣的套件管理工具。Red Hat 衍生的發行版使用 Red Hat Package Manager (RPM) 或像 Yellowdog Updater Modified (YUM) 這樣的工具。