epm-clean 1.28 KB
Newer Older
1 2
#!/bin/sh
#
Vitaly Lipatov's avatar
Vitaly Lipatov committed
3 4
# Copyright (C) 2012,2014  Etersoft
# Copyright (C) 2012,2014  Vitaly Lipatov <lav@etersoft.ru>
5
#
6 7 8
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
9 10 11 12 13
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU Affero General Public License for more details.
15
#
16 17
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
18 19 20 21
#

epm_clean()
{
Vitaly Lipatov's avatar
Vitaly Lipatov committed
22 23
case $PMTYPE in
	apt-rpm|apt-dpkg)
24
		sudocmd apt-get clean
25
		;;
Vitaly Lipatov's avatar
Vitaly Lipatov committed
26 27 28
	aptitude-dpkg)
		sudocmd aptitude clean
		;;
Vitaly Lipatov's avatar
Vitaly Lipatov committed
29
	yum-rpm)
30
		sudocmd yum clean all
31
		#sudocmd yum makecache
32
		;;
33 34 35
	dnf-rpm)
		sudocmd dnf clean all
		;;
Vitaly Lipatov's avatar
Vitaly Lipatov committed
36
	urpm-rpm)
37
		sudocmd urpmi --clean
38
		;;
39 40 41
	pacman)
		sudocmd pacman -Sc
		;;
Vitaly Lipatov's avatar
Vitaly Lipatov committed
42
	zypper-rpm)
43
		sudocmd zypper clean
44
		;;
45 46 47 48 49
	nix)
		sudocmd nix-collect-garbage
		;;
	slackpkg)
		;;
50 51 52
	pkgng)
		sudo pkg clean
		;;
53
	*)
54
		fatal "Have no suitable command for $PMTYPE"
55 56
		;;
esac
57
	info "It is recommend to run 'epm autoremove' also"
58 59

}