LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-04-2010, 10:38 AM   #1
dlugasx
Member
 
Registered: Dec 2008
Location: Germany/Poland
Distribution: CentOS / Debian / Solaris / RedHat
Posts: 266

Rep: Reputation: 19
Question CentOS - remove package with configuration files - HOW ?


Hi Gurus,

I need an advice concerning rpm package.

How to remove package with his configuration files.

rpm -e doesnt delete any configuration files, is there any similar command to debians apt-get --purge ?



cheers

dlugasx
 
Old 12-04-2010, 11:58 AM   #2
carltm
Member
 
Registered: Jan 2007
Location: Canton, MI
Distribution: CentOS, SuSE, Red Hat, Debian, etc.
Posts: 703

Rep: Reputation: 99
I recall that rpm will not delete any configuration file that has
been altered. So if you've changed any configuration, that file
will not be deleted by rpm.

One thing you can do is re-install the package and query to find
and remove all the configuration files, then erase the package.

rm -f `rpm -qc packagename`; rpm -e packagname
 
Old 12-04-2010, 02:01 PM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
...another way would be to run 'rpm -qc packagename' before you remove it or run '( find /etc -type f -iname \*.conf -o -iname \*.config -o -iname \*.cfg 2>/dev/null | xargs rpm -qf ) | grep owned;' after (adjust filenames or extensions if necessary). BTW "not owned by a package" means no %{config} tag was used, not that the file is not vital for running some package. So be careful when removing things.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] List modified configuration files [CentOS 5.4] carbonfiber Red Hat 6 02-21-2010 07:24 AM
list installed package files and how to know which package a file belongs bujecas Slackware 3 01-09-2010 03:14 PM
failed to configure, remove and install package after cancelling configuration umarzuki Debian 4 10-09-2009 09:17 AM
Remove all configuration files of a Package -- Ubuntu Drapper Drake Dimitriy Linux - Software 1 06-10-2006 01:58 AM
apt-get remove package-name & config files robbbert Linux - Software 2 04-20-2006 05:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration