There is two ways to add or remove an unwanted rpm package. The first way, is to use the rpm utility by itself to install or remove a single rpm package at a time. The second way is to use an automatic package manager such as yum that will automatically add or remove any software dependencies along with the desired package. Examples of both methods are displayed below.
To remove an rpm package using rpm:
First, check for the installed software package name using the -q option for rpm:
rpm -q packagename
rpm -q httpd
Currently, my computer has the following version of httpd installed:
httpd-2.2.4-2.fc6
To uninstall the software package using rpm use the -e option:
rpm -e httpd-2.2.4-2.fc6
*Note: rpm may give errors detailing dependencies thet were required by the software that you are uninstalling. See example below:
| |
$ rpm -e httpd-2.2.3-5
error: Failed dependencies:
httpd >= 2.2.0 is needed by (installed)
gnome-user-share-0.10-5.i386 |
|
The dependencies must be removed before you can continue the uninstallation of the linux software. For this reason, it it easier to use a package manager such as yum to assist with installation of linux software.
To remove an rpm package using yum:
First, check for the installed software package using the list option for yum:
yum list packagename
yum list httpd
There will be alot of text displayed on the screen and the process may take a while to complete, when check is done, at the end of the output there will be a status list. Currently, my computer has the following version of httpd installed:
Installed Packages
httpd.i386 2.2.4-2.fc6 installed
To uninstall the software package using yum use the remove option:
yum remove httpd
*Notes: You don't have to enter the full package filename when using yum, you just need the software name. You may need to be superuser to use yum. See example below:
| |
$ yum remove httpd
Loading "installonlyn" plugin
You need to be root to perform this command.
$ su
Password:
# yum remove httpd
Loading "installonlyn" plugin
Setting up Remove Process
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Package httpd.i386 0:2.2.3-5 set to be erased
--> Running transaction check
Setting up repositories
[Errno 14] HTTP Error 503: Date: Thu, 19 Apr 2007 22:18:12 GMT
Server: Apache
Last-Modified: Tue, 27 Feb 2007 21:02:38 GMT
ETag: "49800094-c15-93ed7780"
Accept-Ranges: bytes
Content-Length: 3093
Connection: close
Content-Type: text/html; charset=ISO-8859-1
Trying other mirror.
core 100% |=========================| 1.1 kB
00:00
updates 100% |=========================| 1.2 kB
00:00
extras 100% |=========================| 1.1 kB
00:00
Reading repository metadata in from local files
--> Processing Dependency: httpd >= 2.2.0 for package: gnome-user-share
--> Restarting Dependency Resolution with new changes.
--> Populating transaction set with selected packages. Please wait.
---> Package gnome-user-share.i386 0:0.10-5 set to be erased
--> Running transaction check
Dependencies Resolved
====================================================================
Package Arch Version Repository
Size
====================================================================
Removing:
httpd i386 2.2.3-5 installed
2.8 M
Removing for dependencies:
gnome-user-share i386 0.10-5 installed
89 k
Transaction Summary
====================================================================
Install 0 Package(s)
Update 0 Package(s)
Remove 2 Package(s)
Is this ok [y/N]: y
Downloading Packages:
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Removing : httpd #########################
[1/2]
Removing : gnome-user-share #########################
[2/2]
Removed: httpd.i386 0:2.2.3-5
Dependency Removed: gnome-user-share.i386 0:0.10-5
Complete!
# |
|
|