Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need to clean my system and redo it all. Is there any easy way to get rid of every single package I've installed (to a point where it's CentOS minimal)? I can't remember all of the packages and

yum list installed

pulls up a list of 1,000s of packages.

Thanks!

Edit: I cannot reinstall CentOS.

share|improve this question

closed as not constructive by Scott Pack, Ward, Khaled, Dave M, pauska Apr 22 '13 at 12:56

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

2  
You can remove every package on the system, but not reinstall CentOS? That doesn't make the slightest bit of sense. –  ceejayoz Apr 9 '13 at 1:03
    
@ceejayoz The OP is asking how to revert the present install to a configuration identical to a "CentOS Minimal" install. –  jscott Apr 9 '13 at 1:18
    
check the group list (# yum grouplist), and then try to remove e.g: (# yum groupremove "Dialup Networking Support" "Editors" "Mail Server" "Network Servers" "System Tools" "Text-based Internet" "Web Server" ) –  chocripple Apr 9 '13 at 1:34
3  
@jscott Yes, and I'm saying that if you're able to revert it to a minimal install (i.e. it's presumably not performing some critical function if it doesn't need any of them), I'm having a hard time imagining why it's not possible to just reinstall the OS. –  ceejayoz Apr 9 '13 at 1:35
1  
No CD and no USB? This doesn't sound like ServerFault material. –  ceejayoz Apr 11 '13 at 0:39

4 Answers 4

up vote 5 down vote accepted

You should simply reinstall your system. Removing packages to get to minimal takes far more time than the reinstallation of a minimal setup. If you can't reinstall, why not just leave it as-is. Are you trying to save space?

Either way, here's the CentOS Minimal RPM package list. Run a diff against your existing list and determine what to remove:

MAKEDEV.x86_64
acl.x86_64
aic94xx-firmware.noarch
atmel-firmware.noarch
attr.x86_64
audit.x86_64
audit-libs.x86_64
authconfig.x86_64
b43-openfwwf.noarch
basesystem.noarch
bash.x86_64
bfa-firmware.noarch
binutils.x86_64
bzip2.x86_64
bzip2-libs.x86_64
ca-certificates.noarch
centos-release.x86_64
checkpolicy.x86_64
chkconfig.x86_64
coreutils.x86_64
coreutils-libs.x86_64
cpio.x86_64
cracklib.x86_64
cracklib-dicts.x86_64
cronie.x86_64
cronie-anacron.x86_64
crontabs.noarch
curl.x86_64
cyrus-sasl.x86_64
cyrus-sasl-lib.x86_64
dash.x86_64
db4.x86_64
db4-utils.x86_64
dbus-glib.x86_64
dbus-libs.x86_64
device-mapper.x86_64
device-mapper-event.x86_64
device-mapper-event-libs.x86_64
device-mapper-libs.x86_64
dhclient.x86_64
diffutils.x86_64
dracut.noarch
dracut-kernel.noarch
e2fsprogs.x86_64
e2fsprogs-libs.x86_64
efibootmgr.x86_64
elfutils-libelf.x86_64
ethtool.x86_64
expat.x86_64
file-libs.x86_64
filesystem.x86_64
findutils.x86_64
fipscheck.x86_64
fipscheck-lib.x86_64
gamin.x86_64
gawk.x86_64
gdbm.x86_64
glib2.x86_64
glibc.x86_64
glibc-common.x86_64
gmp.x86_64
gnupg2.x86_64
gpgme.x86_64
grep.x86_64
grub.x86_64
grubby.x86_64
gzip.x86_64
hwdata.noarch
info.x86_64
initscripts.x86_64
iproute.x86_64
iptables.x86_64
iptables-ipv6.x86_64
iputils.x86_64
ipw2100-firmware.noarch
ipw2200-firmware.noarch
ivtv-firmware.noarch
iwl1000-firmware.noarch
iwl3945-firmware.noarch
iwl4965-firmware.noarch
iwl5000-firmware.noarch
iwl5150-firmware.noarch
iwl6000-firmware.noarch
iwl6050-firmware.noarch
kbd.x86_64
kbd-misc.noarch
kernel.x86_64
kernel-firmware.noarch
keyutils-libs.x86_64
krb5-libs.x86_64
less.x86_64
libacl.x86_64
libattr.x86_64
libblkid.x86_64
libcap.x86_64
libcap-ng.x86_64
libcgroup.x86_64
libcom_err.x86_64
libcurl.x86_64
libdrm.x86_64
libertas-usb8388-firmware.noarch
libffi.x86_64
libgcc.x86_64
libgcrypt.x86_64
libgpg-error.x86_64
libidn.x86_64
libnih.x86_64
libselinux.x86_64
libselinux-utils.x86_64
libsemanage.x86_64
libsepol.x86_64
libss.x86_64
libssh2.x86_64
libstdc++.x86_64
libudev.x86_64
libusb.x86_64
libuser.x86_64
libutempter.x86_64
libuuid.x86_64
libxml2.x86_64
logrotate.x86_64
lua.x86_64
lvm2.x86_64
lvm2-libs.x86_64
m4.x86_64
mingetty.x86_64
module-init-tools.x86_64
mysql-libs.x86_64
ncurses.x86_64
ncurses-base.x86_64
ncurses-libs.x86_64
net-tools.x86_64
newt.x86_64
newt-python.x86_64
nspr.x86_64
nss.x86_64
nss-softokn.x86_64
nss-softokn-freebl.x86_64
nss-sysinit.x86_64
nss-util.x86_64
openldap.x86_64
openssh.x86_64
openssh-server.x86_64
openssl.x86_64
pam.x86_64
passwd.x86_64
pciutils-libs.x86_64
pcre.x86_64
pinentry.x86_64
plymouth.x86_64
plymouth-core-libs.x86_64
plymouth-scripts.x86_64
policycoreutils.x86_64
popt.x86_64
postfix.x86_64
procps.x86_64
psmisc.x86_64
pth.x86_64
pygpgme.x86_64
python.x86_64
python-iniparse.noarch
python-libs.x86_64
python-pycurl.x86_64
python-urlgrabber.noarch
ql2100-firmware.noarch
ql2200-firmware.noarch
ql23xx-firmware.noarch
ql2400-firmware.noarch
ql2500-firmware.noarch
readline.x86_64
redhat-logos.noarch
rootfiles.noarch
rpm.x86_64
rpm-libs.x86_64
rpm-python.x86_64
rsyslog.x86_64
rt61pci-firmware.noarch
rt73usb-firmware.noarch
sed.x86_64
selinux-policy.noarch
selinux-policy-targeted.noarch
setup.noarch
shadow-utils.x86_64
slang.x86_64
sqlite.x86_64
sudo.x86_64
system-config-firewall-base.noarch
sysvinit-tools.x86_64
tar.x86_64
tcp_wrappers-libs.x86_64
tzdata.noarch
udev.x86_64
upstart.x86_64
ustr.x86_64
util-linux-ng.x86_64
vim-minimal.x86_64
which.x86_64
xorg-x11-drv-ati-firmware.noarch
xz-libs.x86_64
yum.noarch
yum-metadata-parser.x86_64
yum-plugin-fastestmirror.noarch
zd1211-firmware.noarch
zlib.x86_64
share|improve this answer

It does not seem like a simple case of iterating over the package list and removing that package as some will be system packages which are vital to basic operation (unless you specifically want to brick the system, then you might as well reinstall).

If you want to see what packages are on the system but don't seem to be depended on for anything, you could run package-cleanup --quiet --leaves from yum-utils ( or package-cleanup --quiet --leaves --exclude-bin to exclude binaries ).

To remove all oprhaned packages automatically try:

package-cleanup --quiet --leaves --exclude-bin | xargs yum remove -y
share|improve this answer

You could try doing a minimal install in a VM, and diff the package lists, removing any that aren't in the list from the VM. Perhaps combined with @jamza's answer

share|improve this answer

I had to reinstall CentOS... it was a waste of money for a CD drive, and the RAM went dead, but I've got the server up and running.

share|improve this answer
1  
So... why not not give the checkmark to someone else (like ewwhite) who suggested you do this in the first place? –  Mark Henderson Apr 16 '13 at 23:58
    
The RAM went dead? –  ewwhite Apr 17 '13 at 0:00
    
Because I needed to buy a CD drive and everything... it was not what I wanted to do. –  rtainc Apr 22 '13 at 1:43

Not the answer you're looking for? Browse other questions tagged or ask your own question.