How To Install coccinelle-examples on CentOS 8

coccinelle-examples is Examples for coccinelle

Introduction

In this tutorial we learn how to install coccinelle-examples on CentOS 8.

What is coccinelle-examples

The coccinelle-examples package contains examples for coccinelle.

We can use yum or dnf to install coccinelle-examples on CentOS 8. In this tutorial we discuss both methods but you only need to choose one of method to install coccinelle-examples.

Install coccinelle-examples on CentOS 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install coccinelle-examples using dnf by running the following command:

sudo dnf -y install coccinelle-examples

Install coccinelle-examples on CentOS 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install coccinelle-examples using yum by running the following command:

sudo yum -y install coccinelle-examples

How To Uninstall coccinelle-examples on CentOS 8

To uninstall only the coccinelle-examples package we can use the following command:

sudo dnf remove coccinelle-examples

coccinelle-examples Package Contents on CentOS 8

/usr/share/doc/coccinelle-examples
/usr/share/doc/coccinelle-examples/demos
/usr/share/doc/coccinelle-examples/demos/assignment_matching.c
/usr/share/doc/coccinelle-examples/demos/assignment_matching.cocci
/usr/share/doc/coccinelle-examples/demos/assignment_matching.res
/usr/share/doc/coccinelle-examples/demos/camltococci.c
/usr/share/doc/coccinelle-examples/demos/camltococci.cocci
/usr/share/doc/coccinelle-examples/demos/camltococci.res
/usr/share/doc/coccinelle-examples/demos/change_all_param.c
/usr/share/doc/coccinelle-examples/demos/change_all_param.cocci
/usr/share/doc/coccinelle-examples/demos/check_region.c
/usr/share/doc/coccinelle-examples/demos/check_region.cocci
/usr/share/doc/coccinelle-examples/demos/conjunction.c
/usr/share/doc/coccinelle-examples/demos/conjunction.cocci
/usr/share/doc/coccinelle-examples/demos/ctr_unit_test.c
/usr/share/doc/coccinelle-examples/demos/ctr_unit_test.cocci
/usr/share/doc/coccinelle-examples/demos/defaultscript.c
/usr/share/doc/coccinelle-examples/demos/defaultscript.cocci
/usr/share/doc/coccinelle-examples/demos/demo_rule9
/usr/share/doc/coccinelle-examples/demos/demo_rule9/README
/usr/share/doc/coccinelle-examples/demos/demo_rule9/g_NCR5380.c
/usr/share/doc/coccinelle-examples/demos/demo_rule9/g_NCR5380.res
/usr/share/doc/coccinelle-examples/demos/demo_rule9/nsp_cs.c
/usr/share/doc/coccinelle-examples/demos/demo_rule9/nsp_cs.res
/usr/share/doc/coccinelle-examples/demos/demo_rule9/rule9.cocci
/usr/share/doc/coccinelle-examples/demos/demo_rule9/rule9_1.cocci
/usr/share/doc/coccinelle-examples/demos/demo_rule9/rule9_2.cocci
/usr/share/doc/coccinelle-examples/demos/demo_rule9/rule9_3.cocci
/usr/share/doc/coccinelle-examples/demos/demo_rule9/rule9_4.cocci
/usr/share/doc/coccinelle-examples/demos/demo_rule9/rule9_5.cocci
/usr/share/doc/coccinelle-examples/demos/demo_rule9/scsiglue.c
/usr/share/doc/coccinelle-examples/demos/demo_rule9/scsiglue.res
/usr/share/doc/coccinelle-examples/demos/demo_rule9/sym53c8xx.c
/usr/share/doc/coccinelle-examples/demos/demo_rule9/sym53c8xx.res
/usr/share/doc/coccinelle-examples/demos/depend.c
/usr/share/doc/coccinelle-examples/demos/depend.cocci
/usr/share/doc/coccinelle-examples/demos/exists1.c
/usr/share/doc/coccinelle-examples/demos/exists1.cocci
/usr/share/doc/coccinelle-examples/demos/exists1.res
/usr/share/doc/coccinelle-examples/demos/exists2.c
/usr/share/doc/coccinelle-examples/demos/exists2.cocci
/usr/share/doc/coccinelle-examples/demos/exists2.res
/usr/share/doc/coccinelle-examples/demos/exists3.c
/usr/share/doc/coccinelle-examples/demos/exists3.cocci
/usr/share/doc/coccinelle-examples/demos/exists3.res
/usr/share/doc/coccinelle-examples/demos/exists4.c
/usr/share/doc/coccinelle-examples/demos/exists4.cocci
/usr/share/doc/coccinelle-examples/demos/exists4.res
/usr/share/doc/coccinelle-examples/demos/external_ana.c
/usr/share/doc/coccinelle-examples/demos/external_ana.cocci
/usr/share/doc/coccinelle-examples/demos/external_ana.data
/usr/share/doc/coccinelle-examples/demos/first.c
/usr/share/doc/coccinelle-examples/demos/first.cocci
/usr/share/doc/coccinelle-examples/demos/foo.c
/usr/share/doc/coccinelle-examples/demos/foo.cocci
/usr/share/doc/coccinelle-examples/demos/foobar.c
/usr/share/doc/coccinelle-examples/demos/foobar.cocci
/usr/share/doc/coccinelle-examples/demos/format.c
/usr/share/doc/coccinelle-examples/demos/format.cocci
/usr/share/doc/coccinelle-examples/demos/format.res
/usr/share/doc/coccinelle-examples/demos/headers.cocci
/usr/share/doc/coccinelle-examples/demos/headers.iso
/usr/share/doc/coccinelle-examples/demos/headers2.iso
/usr/share/doc/coccinelle-examples/demos/hello
/usr/share/doc/coccinelle-examples/demos/hello/hello-ocaml.cocci
/usr/share/doc/coccinelle-examples/demos/hello/hello-python.cocci
/usr/share/doc/coccinelle-examples/demos/hello/hello-regexp.cocci
/usr/share/doc/coccinelle-examples/demos/hello/hello-smpl.cocci
/usr/share/doc/coccinelle-examples/demos/hello/helloworld.c
/usr/share/doc/coccinelle-examples/demos/ifdef_skip_tag.c
/usr/share/doc/coccinelle-examples/demos/initial_final.cocci
/usr/share/doc/coccinelle-examples/demos/initvirt.c
/usr/share/doc/coccinelle-examples/demos/initvirt.cocci
/usr/share/doc/coccinelle-examples/demos/interprocedural_adhoc.c
/usr/share/doc/coccinelle-examples/demos/interprocedural_adhoc.cocci
/usr/share/doc/coccinelle-examples/demos/ioctl_multiple_rules.c
/usr/share/doc/coccinelle-examples/demos/ioctl_multiple_rules.cocci
/usr/share/doc/coccinelle-examples/demos/iso-kzalloc.c
/usr/share/doc/coccinelle-examples/demos/iso-kzalloc.cocci
/usr/share/doc/coccinelle-examples/demos/iteration.cocci
/usr/share/doc/coccinelle-examples/demos/itimer.c
/usr/share/doc/coccinelle-examples/demos/itimer.cocci
/usr/share/doc/coccinelle-examples/demos/itimer.patch
/usr/share/doc/coccinelle-examples/demos/itimer.res
/usr/share/doc/coccinelle-examples/demos/itimerfullfunc.sgrep
/usr/share/doc/coccinelle-examples/demos/janitorings
/usr/share/doc/coccinelle-examples/demos/janitorings/ARRAY_SIZE.cocci
/usr/share/doc/coccinelle-examples/demos/janitorings/BUG_ON.cocci
/usr/share/doc/coccinelle-examples/demos/janitorings/BUG_ON.sgrep
/usr/share/doc/coccinelle-examples/demos/janitorings/alloc_page.cocci
/usr/share/doc/coccinelle-examples/demos/janitorings/bad_zero-orig.cocci
/usr/share/doc/coccinelle-examples/demos/janitorings/bad_zero.c
/usr/share/doc/coccinelle-examples/demos/janitorings/bad_zero.cocci
/usr/share/doc/coccinelle-examples/demos/janitorings/bad_zero_affect.cocci
/usr/share/doc/coccinelle-examples/demos/janitorings/clear_page.cocci
/usr/share/doc/coccinelle-examples/demos/janitorings/empty.iso
/usr/share/doc/coccinelle-examples/demos/janitorings/is_power_of_2.cocci
/usr/share/doc/coccinelle-examples/demos/janitorings/kcalloc_un.cocci
/usr/share/doc/coccinelle-examples/demos/janitorings/kzalloc-fix.cocci
/usr/share/doc/coccinelle-examples/demos/janitorings/kzalloc-orig.cocci
/usr/share/doc/coccinelle-examples/demos/janitorings/kzalloc.cocci
/usr/share/doc/coccinelle-examples/demos/janitorings/list_for_each.c
/usr/share/doc/coccinelle-examples/demos/janitorings/list_for_each.cocci
/usr/share/doc/coccinelle-examples/demos/janitorings/list_for_each_safe.c
/usr/share/doc/coccinelle-examples/demos/janitorings/list_for_each_safe.sgrep
/usr/share/doc/coccinelle-examples/demos/janitorings/netdev_find_allocfunc.c
/usr/share/doc/coccinelle-examples/demos/janitorings/netdev_find_allocfunc.sgrep
/usr/share/doc/coccinelle-examples/demos/janitorings/netdev_priv.c
/usr/share/doc/coccinelle-examples/demos/janitorings/netdev_priv.cocci
/usr/share/doc/coccinelle-examples/demos/janitorings/netdev_priv2.cocci
/usr/share/doc/coccinelle-examples/demos/janitorings/netdev_priv_dangerous.sgrep
/usr/share/doc/coccinelle-examples/demos/janitorings/remove_cast_kmalloc.cocci
/usr/share/doc/coccinelle-examples/demos/janitorings/set_current_state.cocci
/usr/share/doc/coccinelle-examples/demos/janitorings/static_initfunc.c
/usr/share/doc/coccinelle-examples/demos/janitorings/static_initfunc.cocci
/usr/share/doc/coccinelle-examples/demos/janitorings/string-array-decl-opti.c
/usr/share/doc/coccinelle-examples/demos/janitorings/string-array-decl-opti.cocci
/usr/share/doc/coccinelle-examples/demos/janitorings/useless_cast.c
/usr/share/doc/coccinelle-examples/demos/janitorings/useless_cast.cocci
/usr/share/doc/coccinelle-examples/demos/launch.sh
/usr/share/doc/coccinelle-examples/demos/localidexpression.c
/usr/share/doc/coccinelle-examples/demos/localidexpression.cocci
/usr/share/doc/coccinelle-examples/demos/localidexpression.res
/usr/share/doc/coccinelle-examples/demos/macro_fix_standard.h
/usr/share/doc/coccinelle-examples/demos/macro_parsing_problem.c
/usr/share/doc/coccinelle-examples/demos/manual
/usr/share/doc/coccinelle-examples/demos/manual/already_tagged.c
/usr/share/doc/coccinelle-examples/demos/manual/already_tagged.cocci
/usr/share/doc/coccinelle-examples/demos/manual/get_put.c
/usr/share/doc/coccinelle-examples/demos/manual/get_put.cocci
/usr/share/doc/coccinelle-examples/demos/manual/get_put_full.c
/usr/share/doc/coccinelle-examples/demos/manual/get_put_full.cocci
/usr/share/doc/coccinelle-examples/demos/manual/get_put_ver1.c
/usr/share/doc/coccinelle-examples/demos/not.c
/usr/share/doc/coccinelle-examples/demos/not.cocci
/usr/share/doc/coccinelle-examples/demos/not.res
/usr/share/doc/coccinelle-examples/demos/ocaml
/usr/share/doc/coccinelle-examples/demos/ocaml.c
/usr/share/doc/coccinelle-examples/demos/ocaml.cocci
/usr/share/doc/coccinelle-examples/demos/ocaml/README
/usr/share/doc/coccinelle-examples/demos/ocaml/dbm.c
/usr/share/doc/coccinelle-examples/demos/ocaml/dbm.cocci
/usr/share/doc/coccinelle-examples/demos/ocaml/pg.c
/usr/share/doc/coccinelle-examples/demos/ocaml/pg.cocci
/usr/share/doc/coccinelle-examples/demos/ocaml1.c
/usr/share/doc/coccinelle-examples/demos/ocaml1.cocci
/usr/share/doc/coccinelle-examples/demos/ocaml2.c
/usr/share/doc/coccinelle-examples/demos/ocaml2.cocci
/usr/share/doc/coccinelle-examples/demos/orgmode.c
/usr/share/doc/coccinelle-examples/demos/orgmode.cocci
/usr/share/doc/coccinelle-examples/demos/orgmode2.cocci
/usr/share/doc/coccinelle-examples/demos/pcre.c
/usr/share/doc/coccinelle-examples/demos/pcre.cocci
/usr/share/doc/coccinelle-examples/demos/pcre2.c
/usr/share/doc/coccinelle-examples/demos/pcre2.cocci
/usr/share/doc/coccinelle-examples/demos/platform_ifdef.c
/usr/share/doc/coccinelle-examples/demos/platform_ifdef.cocci
/usr/share/doc/coccinelle-examples/demos/plusplus1.c
/usr/share/doc/coccinelle-examples/demos/plusplus1.cocci
/usr/share/doc/coccinelle-examples/demos/plusplus1.res
/usr/share/doc/coccinelle-examples/demos/plusplus2.c
/usr/share/doc/coccinelle-examples/demos/plusplus2.cocci
/usr/share/doc/coccinelle-examples/demos/plusplus2.res
/usr/share/doc/coccinelle-examples/demos/poscon.c
/usr/share/doc/coccinelle-examples/demos/poscon.cocci
/usr/share/doc/coccinelle-examples/demos/posmult.c
/usr/share/doc/coccinelle-examples/demos/posmult.cocci
/usr/share/doc/coccinelle-examples/demos/printloc.c
/usr/share/doc/coccinelle-examples/demos/printloc.cocci
/usr/share/doc/coccinelle-examples/demos/proc_info.c
/usr/share/doc/coccinelle-examples/demos/proc_info.cocci
/usr/share/doc/coccinelle-examples/demos/pycocci.c
/usr/share/doc/coccinelle-examples/demos/pycocci.cocci
/usr/share/doc/coccinelle-examples/demos/python_identifier.c
/usr/share/doc/coccinelle-examples/demos/python_identifier.cocci
/usr/share/doc/coccinelle-examples/demos/python_iteration.c
/usr/share/doc/coccinelle-examples/demos/python_iteration.cocci
/usr/share/doc/coccinelle-examples/demos/python_regexp.c
/usr/share/doc/coccinelle-examples/demos/python_regexp.cocci
/usr/share/doc/coccinelle-examples/demos/pythontococci.c
/usr/share/doc/coccinelle-examples/demos/pythontococci.cocci
/usr/share/doc/coccinelle-examples/demos/pythontococci.res
/usr/share/doc/coccinelle-examples/demos/regexp.c
/usr/share/doc/coccinelle-examples/demos/regexp.cocci
/usr/share/doc/coccinelle-examples/demos/regexp2.c
/usr/share/doc/coccinelle-examples/demos/regexp2.cocci
/usr/share/doc/coccinelle-examples/demos/sgrep
/usr/share/doc/coccinelle-examples/demos/sgrep/README
/usr/share/doc/coccinelle-examples/demos/sgrep/a_and_b.c
/usr/share/doc/coccinelle-examples/demos/sgrep/a_and_b.sgrep
/usr/share/doc/coccinelle-examples/demos/sgrep/dangerous_GFP_KERNEL.sgrep
/usr/share/doc/coccinelle-examples/demos/sgrep/dangerous_GFP_KERNEL2.sgrep
/usr/share/doc/coccinelle-examples/demos/sgrep/dangerous_arith_pointer_cast.sgrep
/usr/share/doc/coccinelle-examples/demos/sgrep/device_id.sgrep
/usr/share/doc/coccinelle-examples/demos/sgrep/double_cast.sgrep
/usr/share/doc/coccinelle-examples/demos/sgrep/free.sgrep
/usr/share/doc/coccinelle-examples/demos/sgrep/intr4.sgrep
/usr/share/doc/coccinelle-examples/demos/sgrep/null.sgrep
/usr/share/doc/coccinelle-examples/demos/sgrep/run.sh
/usr/share/doc/coccinelle-examples/demos/sgrep/simple.c
/usr/share/doc/coccinelle-examples/demos/sgrep/simple.sgrep
/usr/share/doc/coccinelle-examples/demos/simple.c
/usr/share/doc/coccinelle-examples/demos/simple.cocci
/usr/share/doc/coccinelle-examples/demos/spp
/usr/share/doc/coccinelle-examples/demos/spp/Makefile
/usr/share/doc/coccinelle-examples/demos/spp/test
/usr/share/doc/coccinelle-examples/demos/spp/test.c
/usr/share/doc/coccinelle-examples/demos/spp/test.cocci
/usr/share/doc/coccinelle-examples/demos/spp/test.h
/usr/share/doc/coccinelle-examples/demos/spp/test2.c
/usr/share/doc/coccinelle-examples/demos/spp/testpy.cocci
/usr/share/doc/coccinelle-examples/demos/type_fields.c
/usr/share/doc/coccinelle-examples/demos/type_fields.cocci
/usr/share/doc/coccinelle-examples/demos/unsigned.cocci
/usr/share/doc/coccinelle-examples/demos/unsigned.txt
/usr/share/doc/coccinelle-examples/demos/usb_submit_urb.c
/usr/share/doc/coccinelle-examples/demos/usb_submit_urb.cocci
/usr/share/doc/coccinelle-examples/demos/video_usercopy.c
/usr/share/doc/coccinelle-examples/demos/video_usercopy.cocci
/usr/share/doc/coccinelle-examples/demos/virt.c
/usr/share/doc/coccinelle-examples/demos/virt.cocci
/usr/share/doc/coccinelle-examples/demos/vm.c
/usr/share/doc/coccinelle-examples/demos/vm.cocci
/usr/share/doc/coccinelle-examples/demos/xxx_info.c
/usr/share/doc/coccinelle-examples/demos/xxx_info.cocci

References

Summary

In this tutorial we learn how to install coccinelle-examples on CentOS 8 using yum and dnf.