9

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
  zlib1g-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.

gir1.2-gtk-2.0

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

Thanks for reading.

3

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.

5

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.

2

From man apt-get:

 autoremove
       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?

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

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.

1

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.

1

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.

apx

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.