赞
踩
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
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
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
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
.
我们还可以使用一个命令来卸载多个软件包。 我们将软件包名称用空格分隔。 在此示例中,我们将删除名为tmux
和vim
软件包。
$ sudo apt-get remove tmux vim
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-writer
, openoffice-calc
等。我们可以使用globe *
操作来指定所有以openoffice-
name开头的软件包,例如openoffice-*
。
$ sudo apt-get remove openoffice-*
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
等。
Uninstalling packages with remove
will 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
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/
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。