Stack Exchange
apt-get autoremove doesn't accept regular expressions?
Running apt-get install libboost.*1.40.0 (Ubuntu 10.04.4) works perfectly.
But apt-get autoremove libboost.*1.40.0... not so much. Any workaround?
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting libboost-system1.40.0 for regex 'libboost.*1.40.0'
Note, selecting libboost-python1.40.0 for regex 'libboost.*1.40.0'
Note, selecting libboost-signals1.40.0 for regex 'libboost.*1.40.0'
Note, selecting libboost-program-options1.40.0 for regex 'libboost.*1.40.0'
Note, selecting libboost-date-time1.40.0 for regex 'libboost.*1.40.0'
Note, selecting libboost-test1.40.0 for regex 'libboost.*1.40.0'
Note, selecting libboost-iostreams1.40.0 for regex 'libboost.*1.40.0'
Note, selecting libboost-wave1.40.0 for regex 'libboost.*1.40.0'
Note, selecting libboost-graph1.40.0 for regex 'libboost.*1.40.0'
Note, selecting libboost-thread1.40.0 for regex 'libboost.*1.40.0'
Note, selecting libboost-serialization1.40.0 for regex 'libboost.*1.40.0'
Note, selecting libboost-math1.40.0 for regex 'libboost.*1.40.0'
Note, selecting libboost-regex1.40.0 for regex 'libboost.*1.40.0'
Note, selecting libboost-filesystem1.40.0 for regex 'libboost.*1.40.0'
E: Couldn't find package libboost.*1.40.0

Edit: In fact this has nothing to do with autoremove, even remove will do the same
~# apt-get remove libboost-[a-z]*1.40.0
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note , selecting libboost-system1.40.0 for regex 'libboost-[a-z]*1.40.0'
Note, selecting libboost-python1.40.0 for regex 'libboost-[a-z]*1.40.0'
Note, selecting libboost-signals1.40.0 for regex 'libboost-[a-z]*1.40.0'
Note, selecting libboost-test1.40.0 for regex 'libboost-[a-z]*1.40.0'
Note, selecting libboost-iostreams1.40.0 for regex 'libboost-[a-z]*1.40.0'
Note, selecting libboost-wave1.40.0 for regex 'libboost-[a-z]*1.40.0'
Note, selecting libboost-graph1.40.0 for regex 'libboost-[a-z]*1.40.0'
Note, selecting libboost-thread1.40.0 for regex 'libboost-[a-z]*1.40.0'
Note, selecting libboost-serialization1.40.0 for regex 'libboost-[a-z]*1.40.0'
Note, selecting libboost-math1.40.0 for regex 'libboost-[a-z]*1.40.0'
Note, selecting libboost-regex1.40.0 for regex 'libboost-[a-z]*1.40.0'
Note, selecting libboost-filesystem1.40.0 for regex 'libboost-[a-z]*1.40.0'
E: Couldn't find package libboost-[a-z]*1.40.0


autoremove doesn't take any options.  It automatically removes all packages that were auto installed and are no longer required.

@psusi Actually it does. apt-get autoremove foo will remove foo along with any pending packages scheduled for auto removal.

@dobey No, according to the manpage one should use it like this: apt-get remove --auto-remove pkg. The commands check, clean, autoclean, autoremove, update, upgrade, dselect-upgrade and dist-upgrade don't take any package as arguments.

It seems that either the program is wrong, or the man page is.  Time to file a bug report.

Actually, even apt-get remove libboost.*1.40.0 fails with the same error message so it has nothing to do with autoremove.

As a workaround, you can run dpkg -l|grep 'libboost.*1.40.0'|cut -d' ' -f3|xargs sudo apt-get remove --purge to remove them from your system.

I had to add -qq to the apt-get command because otherwise it would auto-abort (??) but otherwise thanks!
