Is it possible to undo all changes made by "aptitude build-dep xxxxxx" i.e to un-install all dependencies installed by this command?
Is it possible to undo all changes made by "aptitude build-dep xxxxxx" i.e to un-install all dependencies installed by this command?
For the future, I highly recommend using
mk-build-deps -i
instead ofaptitude build-dep
. That leaves a package installed in your system, depending on the build-deps, that you can easily uninstall later.I found these commands on a Launchpad question:
There is also an alternative based around sed that copes with brackets in package names:
Note: Replace
PACKAGE_NAME
with your own package.I don't think there's an automatic way. Packages installed through
build-dep
are recorded in the same way as if they'd been directly requested by name.If you know approximately when you ran
aptitude build-dep
, you can find which packages got installed when you ran the command by looking through the logs in/var/log/aptitude*
or/var/log/apt/*
.You can run
apt-cache showsrc PACKAGENAME | grep '^Build-depends:'
to list the build dependencies of the package. Review each of them to see if you want them; mark the ones you don't care about as not manually installed (apt-get markauto PACKAGENAME
) and flush the non-required packages (apt-get autoremove
).