1

Pardon this newbie question, but I've previously run into serious issues as I wanted to try other desktop environments other than the default one in Ubuntu, precisely because I didn't know how to completely remove some/all of them and get back to the default settings.

I think I ran into these issues because I didn't know which packages to remove as I didn't know which packages were installed at the first place. Commands like

sudo apt-get purge <package name>

still left some applications installed on my system that were originally installed by the original package.

I have a couple of questions here

  1. how do I list all the packages to be installed by installing a specific package and see which of these packages are already installed on my machine (if any)?

  2. I imagine purging only the new packages that were installed by this specific package would get things back to the default settings. Is that right? Is there an easy, quick, and effective way to get things back to the default settings (aside from backing up my data)?

  • You can see which packets would get installed by apt-get before actually installing them when you have it do a dry-run: sudo apt-get install -s MyNewProgramm where the -s means simulate. However, this only shows what packages would get installed on your current system, not which packages are included into your installed one generally (those you already have installed won't show up). – Byte Commander Feb 18 '15 at 10:49
  • @ByteCommander no need to use sudo with -s. Will save you from really dangerous typos... ;-) – Rmano Feb 18 '15 at 11:07
  • 1
    @Rmano Oh, you're right. But without sudo you get an ugly hint that it will need root privileges for the real execution. However, without sudo could be better here anyway. – Byte Commander Feb 18 '15 at 11:10
2

The basic command to show dependencies is

apt-cache depends <package> 

which will show you the dependencies (there is even a rdepends option to show the reversed dependencies).

You can add this to the @ByteCommander's suggestion to use simulate install to see which packages will be installed in your system:

apt-get install -s ubuntu-desktop

(no need to use sudo in simulated mode!)

But to really answer the question, no, it is not possible sometime to go completely back. A classical example is ubuntu-gnome-desktop (Gnome shell) and ubuntu-desktop (Unity). Their dependencies partly overlap --- for example:

[romano:~] % apt-cache depends ubuntu-desktop | grep seah
  Depends: seahorse
[romano:~] % apt-cache depends ubuntu-gnome-desktop | grep seah
  Depends: seahorse

...and the overlapping packages may have different configuration defaults.

You can approximate the thing you want by purging all the packages and reinstalling them --- but it can be really dangerous, because the intermediate step can be a non-functional system.

Even outside of the packages, sometime the DEs make changes in your home directory that can affect other DEs (and files in your home are not restored even using purge and reinstall). So if you want to check another DE, do that with a fresh new user.

My personal experience is that the "insulation" of the various desktop environments is not perfect at all; Unity and Gnome shell are the worst offenders (probably because they share a lot), with other it can be better --- I do not know.

  • Thank you for your answer! But isn't there even a way to take like a snapshot of these configuration defaults and apply them back as necessary? – Kareem Feb 18 '15 at 11:00
  • There is still no automated snapshot-rollback functionality in Ubuntu (although you should be able to hack it with brtfs filesystem...); I normally use a virtual machine for that kind of things. Most of this applies: askubuntu.com/questions/49869/… – Rmano Feb 18 '15 at 11:05
  • One more thing please regarding your edit, is it guaranteed that if I install any package in general, or a desktop environment in particular, with a new user that everything will be installed locally? – Kareem Feb 18 '15 at 11:24
  • @Kareem no. The two problems are independent --- you will have both of them. Using a new user will only solve the home directory problem. The other stands. A virtual machine or a container (this one I know too little to help) is the only solution I think. Maybe you can research starting here: xmodulo.com/lxc-containers-ubuntu.html – Rmano Feb 18 '15 at 11:27
  • Yeah, I know about VMs and actually use them, but I was just looking for a way that saves the time of trying things out. Thank you anyway! – Kareem Feb 18 '15 at 11:54

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.