(1)查看安装的gcc版本
[y@localhost Desktop]$ rpm -q gcc
gcc-4.4.7-23.el6.x86_64
(2)执行卸载命令 rpm -e
[y@localhost Desktop]$ rpm -e gcc-4.4.7-23.el6.x86_64
error: Failed dependencies:
gcc = 4.4.7-23.el6 is needed by (installed) gcc-c++-4.4.7-23.el6.x86_64
gcc = 4.4.4 is needed by (installed) libtool-2.2.6-15.5.el6.x86_64
提示gcc-4.4.7-23.el6.x86_64被2个软件依赖,卸载失败,则先卸载被依赖的软件包
sudo rpm -e gcc-c++-4.4.7-23.el6.x86_64
sudo rpm -e libtool-2.2.6-15.5.el6.x86_64
(4)再执行sudo rpm -e gcc-4.4.7-23.el6.x86_64进行卸载
sudo rpm -e gcc-4.4.7-23.el6.x86_64
卸载成功
(5) 验证,输入gcc -v
[y@localhost Desktop]$ gcc -v
bash: gcc: command not found
提示command not found,说明的确卸载成功了。