What is the easiest way to remove all development library packages that have been installed manually, i.e. via apt-get install libsomelib-dev
, on Ubuntu 22.04?
Something like:
sudo apt-get remove lib*-dev
But excluding those libraries that are needed for other programs. The above command causes a lot of applications and essential system packages to be removed as well - that's what I'm trying to avoid.
apt-mark showmanual | grep -e "^lib.*-dev"
will get you a list of all manually-installed packages the name of which starts with "lib" and end with "-dev". I think feeding that intoapt remove
will get you what you're after.apt remove $(apt-mark showmanual | grep -e "^lib.*-dev")
may be what you're looking for. – MDeBusk Oct 02 '22 at 17:03