I was compiling a tool called Rejoystick so I installed a few packages and dependencies. But now I don't need it any more so I removed those packages. Running apt-get shows that I have some packages that are automatically installed and are no longer needed.

But I have a bad experience with apt-get autoremove. It broke my desktop environment when I uninstalled wine some time ago. Luckily, I had a clonezilla partition backup then, but this time, I don't have a backup. So I'm cautious. Running apt-get shows these packages are orphaned

  gir1.2-gtk-2.0 libasound2-dev libavahi-client-dev libavahi-common-dev
  libcaca-dev libcairo-script-interpreter2 libdbus-1-dev libdrm-dev
  libexpat1-dev libfontconfig1-dev libfreetype6-dev libgl1-mesa-dev
  libglu1-mesa-dev libharfbuzz-dev libharfbuzz-gobject0 libice-dev
  libpcre3-dev libpcrecpp0 libpixman-1-dev libpng12-dev libpthread-stubs0-dev
  libslang2-dev libsm-dev libx11-dev libx11-doc libx11-xcb-dev libxau-dev
  libxcb-dri2-0-dev libxcb-dri3-dev libxcb-glx0-dev libxcb-present-dev
  libxcb-randr0-dev libxcb-render0-dev libxcb-shape0-dev libxcb-shm0-dev
  libxcb-sync-dev libxcb-xfixes0-dev libxcb1-dev libxcomposite-dev
  libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev
  libxft-dev libxi-dev libxinerama-dev libxrandr-dev libxrender-dev
  libxshmfence-dev libxxf86vm-dev mesa-common-dev x11proto-composite-dev
  x11proto-core-dev x11proto-damage-dev x11proto-dri2-dev x11proto-fixes-dev
  x11proto-gl-dev x11proto-input-dev x11proto-kb-dev x11proto-randr-dev
  x11proto-record-dev x11proto-render-dev x11proto-xext-dev
  x11proto-xf86vidmode-dev x11proto-xinerama-dev xorg-sgml-doctools xtrans-dev

I'm not sure if I should run apt-get autoremove. I was searching details related to each of these packages so that I can understand which ones are needed but they all seem important e.g.


I have Cinnamon, GNOME and Unity installed, I think apt-get autoremove will break something. Any help will be appreciated.

Thanks for reading.


It should be perfectly safe to run sudo apt-get autoremove This should only remove packages that are not in use or needed any longer. If its a necessary package that would "break" your system if removed it shouldn't remove it.

| improve this answer | |
  • I would strongly recommend not using autoremove. In my case, two Ubuntu installs (16.04 and 18.04) got broken. It may also be related to my Desktop environment, which is Mate. I say this, because I had the same thing happen on a FreeBSD 11 install, that had Mate. It too recommended an autoremove, and following the suggestion, that install also got broken. Even if you don't have Mate, I still recommend against it. – mistige Nov 27 '19 at 15:26

As others mentioned, autoremove should be safe, but then again, you said that you have bad experiences, and I also remember autoremove removing some stuff that should not be removed.

It seems like autoremove can have problems with some meta-packages. Say you installed the gnome meta-package for the entire gnome-desktop (or it was installed when setting up the system), which also includes programs like evolution and lots of games, which you might want to remove, because you are using thunderbird and do not want to have those games and the like. This requires you to also remove the gnome meta-package, since it depends on all those packages. But this will make all the other packages that were installed as dependencies of gnome "auto-removeable", including e.g. gnome-shell, which you most likely want to keep if you want to continue using that desktop.

So it's always a good idea to check the packages recommended for auto-removal. If you are using a graphical package manager like synaptic, you can easily do so and uncheck the "automatically installed" flag from packages you want to keep (like gnome-shell in the above example). This will also remove all the packages those depend on from the auto-removeable list, so you might only have to "fix" a few of those, and not all.

Still, it should not remove anything that's really essential to your system, so even if you accidentally removed e.g. your desktop, you can still boot and log into your system and revert those changes using the command line.

| improve this answer | |
  • Update: Recently, after a dist upgrade, autoremove actually removed something related to disc-decryption (still not sure what exactly), causing my system to be unable to boot with the latest Kernel. Luckily, I still could boot an older Kernel that was still installed and re-install all that was autoremoved, otherwise my system would have been wrecked. – tobias_k Sep 27 at 12:06

From man apt-get:

       autoremove is used to remove packages that were automatically
       installed to satisfy dependencies for other packages and are now no
       longer needed. 

Have you installed other packages (and their dependencies), and subsequently removed the packages?

| improve this answer | |
  • yes i did , i explained in the question – Shantanu Bedajna Jan 12 '16 at 15:46

apt-get remove can ABSOLUTELY destroy your system. It's happened to me twice and I can repeat it (on a Debian-based distro); both times on a vbox, so no big whoop. I watched it remove my entire XFCE installation.

| improve this answer | |

Usually it should be save to run autoremove. But in case of packaging bugs essential packages might get removed. I made my system unbootable by running an apt autoremove, so I highly recommend quickly looking through the packages which are to be removed.

| improve this answer | |
  • What exactly should a person who would ask this question be looking for? – Eric Mar 6 at 4:54
  • You are absolutely right, a beginner has basically no chance knowing which packages are supposed to be removed or could be dangerous. After using a debian based distribution for longer time you might know some packages or could guess from the time if it could be dangerous to remove it or not. For example removing a kernel could be a problem, but not if it is not the only one installed. The linked bug report removed support for decrypting the disk, so after a reboot I was completely stuck. Googling the package before autoremove would have saved me 5h. – lumbric Mar 6 at 14:40

apt-get autoremove is harmful(as per my experience on fedora and debian) i had to re-install a whole 612 mb's packages after running it. Instead look out for the apps that you do not like and remove them 1 at a time.


| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.