如何安装 coccinelle Ubuntu 18.04

在本教程中,我们学习如何安装 coccinelle Ubuntu 18.04。 coccinelle 是 C 语言的语义修补工具

介绍

在本教程中我们学习如何安装 coccinelle 在 Ubuntu 18.04。

什么是 coccinelle

胭脂虫是:

Coccinelle 是 C 语言的程序匹配和转换工具。程序员将要匹配的代码和要执行的转换描述为语义补丁,它看起来像标准补丁,但可以在任意数量的代码站点处转换多个文件。

有三种安装方法 coccinelle 在 Ubuntu 18.04。 我们可以用 apt-get, aptaptitude。 在以下部分中,我们将描述每种方法。 您可以选择其中之一。

使用 apt-get 安装 coccinelle

更新 apt 数据库 apt-get 使用以下命令。

更新apt数据库后,我们可以安装 coccinelle 使用 apt-get 通过运行以下命令:

sudo apt-get -y install coccinelle

使用 apt 安装 coccinelle

更新 apt 数据库 apt 使用以下命令。

更新apt数据库后,我们可以安装 coccinelle 使用 apt 通过运行以下命令:

sudo apt -y install coccinelle

使用 aptitude 安装 coccinelle

如果您想遵循此方法,您可能需要先安装 aptitude,因为 aptitude 通常不会默认安装 Ubuntu。 更新 apt 数据库 aptitude 使用以下命令。

更新apt数据库后,我们可以安装 coccinelle 使用 aptitude 通过运行以下命令:

sudo aptitude -y install coccinelle

如何卸载 coccinelle Ubuntu 18.04

仅卸载 coccinelle 打包我们可以使用以下命令:

sudo apt-get remove coccinelle

卸载 coccinelle 及其依赖项

卸载 coccinelle 及其不再需要的依赖项 Ubuntu 18.04,我们可以使用以下命令:

sudo apt-get -y autoremove coccinelle

删除 coccinelle 配置和数据

去除 coccinelle 配置和数据来自 Ubuntu 18.04我们可以使用以下命令:

sudo apt-get -y purge coccinelle

删除 coccinelle 配置、数据及其所有依赖项

我们可以使用下面的命令来删除 coccinelle 配置、数据及其所有依赖项,我们可以使用以下命令:

sudo apt-get -y autoremove --purge coccinelle

参考

概括

在本教程中我们学习如何安装 coccinelle 封装在 Ubuntu 18.04 使用不同的包管理工具: apt, apt-getaptitude