2022
我们一起努力

Ubuntu 中卸载 deb 包具体方法

在本教程中,我将详细介绍如何找到确切的包名称,然后使用它来删除应用。我还将讨论使用图形方法删除 deb 包。

img
img

从 .deb 文件安装应用 非常简单。双击它,它会在软件中心中打开,然后从那里安装它。

但是如何在 Ubuntu 或 Debian 中卸载 deb 包呢?如何删除一段时间前安装的软件包呢。

虽然这有几个如果和但是,但删除 .deb 文件的最简单和最可靠的方法是使用 apt remove 命令。

sudo apt remove program_name1.

如你所见,你需要在这里知道确切的包名称。这可能并不总是显而易见的。例如,如果你在 Ubuntu 上安装 Google Chrome,则该程序在命令行中称为 “google-chrome-stable”。你已经知道了吗?我猜你不知道。

在本教程中,我将详细介绍如何找到确切的包名称,然后使用它来删除应用。我还将讨论使用图形方法删除 deb 包。

从 Ubuntu 中删除通过 .deb 文件安装的软件包

在我向你展示如何从命令行删除 deb 包之前,让我们在软件中心应用中快速查看它。

方法 1:检查应用是否可以从软件中心移除

Ubuntu 有软件中心 GUI 应用,允许搜索、安装和删除应用。

搜索时,软件中心可能不会显示已安装的应用。

Searching for installed applications may not show any results in Ubuntu Software Center
Searching for installed applications may not show any results in Ubuntu Software Center

Searching for installed applications may not show any results in Ubuntu Software Center

但是,如果向下滚动,你仍可能在“已安装”部分下找到它。外部应用通常不带徽标显示。

Some installed applications can be found in the ‘installed’ tab of the Software Center
Some installed applications can be found in the ‘installed’ tab of the Software Center

Some installed applications can be found in the ‘installed’ tab of the Software Center

如果找到它,你可以通过单击“垃圾桶”图标或“删除”按钮来删除该应用。

Removing applications from the Ubuntu software center
Removing applications from the Ubuntu software center

Removing applications from the Ubuntu software center

一句话:检查是否可以从软件中心删除应用。

方法 2:使用 apt 命令删除应用

我假设你不知道该应用命令的确切名称。你可能不知道 Google Chrome 安装为 google-chrome-stable 而 Edge 安装为 microsoft-edge-stable,这很正常。

如果你知道前几个字母,那么 tab 补全可能会有所帮助。否则,你可以 使用 apt 命令列出已安装的应用 并使用 grep 搜索应用程序名称:

apt list --installed | grep -i possible_package_name1.

例如,你可以智能地猜测 Google Chrome 包的名称中应该包含 chrome。你可以这样搜索:

apt list --installed | grep -i chrome1.

在某些情况下,你可能会得到多个结果。

check if google chrome installed in ubuntu

check if google chrome installed in ubuntu

如果你不确定这些软件包的作用,你可以随时通过以下方式获取它们的详细信息:

apt info exact_package_name1.

获得确切的软件包名称后,你可以使用 apt remove 命令将其删除。

sudo apt remove exact_package_name1.

你还可以使用 apt-get remove 或 dpkg uninstall 命令来删除。

Removing applications installed via .deb files using the apt command

Removing applications installed via .deb files using the apt command

方法 3:使用 Synaptic 包管理器删除 deb 应用

另一种方法是使用 Synaptic 包管理器。在 GNOME 以“软件中心”的形式创建其图形包管理器之前,Synaptic 是 Ubuntu 和许多其他发行版中的默认 GUI 包管理器。

它仍然是 Xfce 桌面环境 上的推荐工具。

首先安装它:

sudo apt install synaptic1.

打开 Synaptic 并搜索包名称。查找标记为绿色的已安装软件包。右键单击它们,然后单击“标记为删除”。之后点击应用。

Removing Deb packages using Synaptic package manager

Removing Deb packages using Synaptic package manager

对你有帮助吗?

我非常乐意使用 apt 命令删除从 .deb 文件中安装的软件包。但我可以理解,并不是每个人都喜欢使用命令行。

在删除从外部 .deb 文件安装的应用时,我发现软件中心中找不到它。软件中心还可以做的更好一些。

本文来源:www.lxlinux.net/11052.html,若引用不当,请联系修改。

赞(0)
文章名称:《Ubuntu 中卸载 deb 包具体方法》
文章链接:https://www.fzvps.com/229004.html
本站文章来源于互联网,如有侵权,请联系管理删除,本站资源仅供个人学习交流,请于下载后24小时内删除,不允许用于商业用途,否则法律问题自行承担。
图片版权归属各自创作者所有,图片水印出于防止被无耻之徒盗取劳动成果的目的。

评论 抢沙发

评论前必须登录!