I did this: $ apt-cache pkgnames | tr -d 'a-zA-Z0-9' | tr -d - | tr -d '\n' The only remaining characters were '.' and '+'.