良许Linux教程网 干货合集 Ubuntu 中卸载 deb 包具体方法

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 文件安装的应用时,我发现软件中心中找不到它。软件中心还可以做的更好一些。

以上就是良许教程网为各位朋友分享的Linu系统相关内容。想要了解更多Linux相关知识记得关注公众号“良许Linux”,或扫描下方二维码进行关注,更多干货等着你 !

137e00002230ad9f26e78-265x300
本文由 良许Linux教程网 发布,可自由转载、引用,但需署名作者且注明文章出处。如转载至微信公众号,请在文末添加作者公众号二维码。
良许

作者: 良许

良许,世界500强企业Linux开发工程师,公众号【良许Linux】的作者,全网拥有超30W粉丝。个人标签:创业者,CSDN学院讲师,副业达人,流量玩家,摄影爱好者。
上一篇
下一篇

发表评论

联系我们

联系我们

公众号:良许Linux

在线咨询: QQ交谈

邮箱: yychuyu@163.com

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

关注微博
返回顶部