Вы можете сделать
list=$(apt-cache --names-only search ^k3b-* | awk '{ print $1 }' | \ grep -v bad-pkg) sudo apt-get install $list