1

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.

szx
  • 550
  • Since you do not even state what version of Ubuntu you are using it would be very hard to make any suggestion. I do believe what you want can not be done but maybe someone else knows. – David Oct 02 '22 at 13:43
  • @David Added Ubuntu version to the question, thanks – szx Oct 02 '22 at 13:44
  • Does this answer your question? How to remove a repository? – graham Oct 02 '22 at 14:38
  • 1
    I won't include this as an answer because I don't intend to test it on my system, but: 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 into apt 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

0 Answers0