[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: holding packages



I put the following in /usr/local/bin apt and can do many simple
operations easily.

apt install foo bar
apt remove foo bar
apt hold foo bar
apt unhold foo bar
apt show foo bar
apt search foo

I'm sure it could be made more flexible.  If anyone improves it,
please send the changes back to me.

Dan

#!/bin/sh

case $1 in
    update|install|remove|autoclean|dist-upgrade|upgrade)
	apt-get $*
	;;
	
    search|show)
	apt-cache $*
	;;
    hold)
    	(while [ $# -gt 1 ]; do echo "$2" hold; shift; done) | dpkg --set-selections
	;;
    unhold)
    	(while [ $# -gt 1 ]; do echo "$2" install; shift; done) | dpkg --set-selections
	;;
    *)
    	echo Unknown option:  $1.
	exit 1
	;;
esac



Reply to: