我需要清理我的系统并重新做所有事情。有没有简单的方法可以删除我安装的每个软件包(直到 CentOS 最小化)?我记不住所有的软件包,
yum list installed
拉出上千个包裹的列表。
谢谢!
编辑:我无法重新安装 CentOS。
答案1
您应该重新安装系统。删除软件包以达到最小化需要的时间比重新安装最小化设置要多得多。如果无法重新安装,为什么不保持原样呢?您是否想节省空间?
无论如何,以下是 CentOS 最小 RPM 软件包列表。针对现有列表运行 diff 并确定要删除的内容:
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
答案2
这似乎不是遍历包列表并删除该包的简单情况,因为有些包是对于基本操作至关重要的系统包(除非您特别想破坏系统,那么您不妨重新安装)。
如果您想查看系统上有哪些软件包,但似乎不依赖任何东西,您可以package-cleanup --quiet --leaves
从yum-utils
(或package-cleanup --quiet --leaves --exclude-bin
排除二进制文件)运行。
要自动删除所有被遗弃的软件包,请尝试:
package-cleanup --quiet --leaves --exclude-bin | xargs yum remove -y
答案3
您可以尝试在虚拟机中进行最小安装,然后比较软件包列表,从虚拟机中删除列表中不存在的软件包。也许可以结合@jamza 的回答
答案4
我不得不重新安装 CentOS... 浪费钱买 CD 驱动器,而且 RAM 也坏了,但我已经让服务器启动并运行了。