[CentOS-devel] Disk size on Vagrant image

Sat Aug 19 13:12:06 UTC 2017
Anssi Johansson <avij at centosproject.org>

Laurentiu Pancescu kirjoitti 19.8.2017 klo 9.03:
> We have to uninstall some packages that Anaconda insists on always 
> installing, but we don't regain the space used by those packages unless 
> we fill the freed sectors with zeros.

How about:

for pkg in $packages_to_be_removed
do
	rpm -ql $pkg | while read file
	do
		if [ -f $file ]
		then
			shred -n0 -uz $file
		fi
	done
done
rpm --erase $packages_to_be_removed

This would eliminate the need of having to use dd. Obviously some 
packages may want to run an uninstallation script at uninstall time, 
which may (or may not) cause errors if some critical executables have 
vanished. rpm's --noscripts may help in that case, if running the 
uninstallation script is not actually necessary.

With the dd step removed, enlarging the file system size should be 
easier, if desired.