当前位置:   article > 正文

如何使用示例的Apt-Get卸载命令从Ubuntu,Debian,Mint和Kali中删除软件包

apt-get uninstall

apt-get is a standard package manager provided by popular distributions like Ubuntu, Debian, Mint, and Kali. We can use apt-get remove and purge in order to remove packages from the system. apt-get This package manager provides a lot of options in order to manage packages precisely. We have already examined very complete tutorial about apt-get command in the following link.

apt-get是由Ubuntu,Debian,Mint和Kali等流行发行版提供的标准软件包管理器。 我们可以使用apt-get remove和purge来从系统中删除软件包。 apt-get此软件包管理器提供了许多选项,以便精确地管理软件包。 我们已经在下面的链接中检查了关于apt-get命令的非常完整的教程。

Apt and Apt-Get Tutorial With Examples

Apt和Apt-Get教程及示例

卸载单个软件包(Uninstall Single Package)

The simples usage form for apt-get remove command is providing a single package name. While providing package name we can provide only package name or other architecture and distributions related parts too. In this example, we will remove tmux package.

apt-get remove命令的简单用法表格提供了单个程序包名称。 提供软件包名称时,我们也只能提供软件包名称或其他与体系结构和发行版相关的部分。 在此示例中,我们将删除tmux软件包。

$ sudo apt-get remove tmux
Uninstall Single Package
Uninstall Single Package
卸载单个软件包

自动删除包裹(Automatically Remove Package)

As we can see in the previous example the apt-get command is asking a question about are we sure for this operation. Providing Y will accept but every time doing this can bore us. We can provide -y option if we want to accept and do not provide further Y to the console like below.

正如我们在前面的示例中看到的那样,apt-get命令正在询问有关是否确定要执行此操作的问题。 只要提供Y就可以接受,但每次这样做都会让我们感到无聊。 如果我们要接受并且不向控制台提供进一步的Y ,则可以提供-y选项,如下所示。

$ sudo apt-get remove -y tmux

卸载多个软件包 (Uninstall Multiple Packages)

We can also uninstall multiple packages with a single command. We will separate the package names with space. In this example, we will remove packages named tmux and vim.

我们还可以使用一个命令来卸载多个软件包。 我们将软件包名称用空格分隔。 在此示例中,我们将删除名为tmuxvim软件包。

$ sudo apt-get remove tmux vim

使用Globe卸载多个软件包 (Uninstall Multiple Packages with Globe)

Some packages are provided with the same begging but the different end for their names. For example openoffice-writer , openoffice-calc etc. We can use  globe * operation to specify all packages those starts with openoffice- name like openoffice-*.

某些程序包的乞求方式相同,但名称不同。 例如openoffice-writeropenoffice-calc等。我们可以使用globe *操作来指定所有以openoffice- name开头的软件包,例如openoffice-*

$ sudo apt-get remove openoffice-*
Uninstall Multiple Packages with Globe
Uninstall Multiple Packages with Globe
使用Globe卸载多个软件包

From the screenshot, we can see that the selected packages for removal. If there is a problem like not matching the package name the package name will be not listed. There is also the glob expression which simply means that the given package name and sub packages. For example, openoffice-* means all package names starting with openoffice-will be selected like openoffice-unbundled etc.

从屏幕截图中,我们可以看到选定的软件包要删除。 如果出现诸如与软件包名称不匹配的问题,则不会列出软件包名称。 还有glob表达式,它仅表示给定的程序包名称和子程序包。 例如, openoffice-*表示将选择所有以openoffice-开头的软件包名称,例如openoffice-unbundled等。

LEARN MORE  Linux RPM Command With Examples For CentOS, RedHat, Fedora
了解更多Linux RPM命令以及有关CentOS,RedHat和Fedora的示例

清除软件包太过删除软件包(Uninstall Packages and Remove Configurations Too with purge)

Uninstalling packages with removewill only uninstall package but do not remove related configuration and cache files. We can use purge in order to remove all related configuration and cache files like below.

使用remove卸载软件包只会卸载软件包,而不会删除相关的配置和缓存文件。 我们可以使用purge来删除所有相关的配置和缓存文件,如下所示。

$ sudo apt-get remove --purge tmux
Uninstall Packages and Remove Configurations Too
Uninstall Packages and Remove Configurations Too
太过卸载软件包并删除配置

卸载未使用的程序包和缓存文件(Uninstall Unused Packages and Cache Files)

After some time the old and cache files will take some space in our disk. These files are completely unnecessary files and can be removed without a problem. The autoremove command can be used to remove all these files and cache.

一段时间后,旧文件和缓存文件将在磁盘上占用一些空间。 这些文件完全是不需要的文件,可以毫无问题地删除。 autoremove命令可用于删除所有这些文件和缓存。

$ sudo apt-get autoremove
 

翻译自: https://www.poftut.com/remove-packages-ubuntu-debian-mint-kali-apt-get-uninstall-command-examples/

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/你好赵伟/article/detail/858532
推荐阅读
相关标签
  

闽ICP备14008679号