Anacron, gnome-disk-utility, and gnome-tweak-tool don't work properly

Asked by Mike Pastor

Ubuntu 12.04 LTS
8 2016

It is necessary to set the HOME environment variable additionally to the DISPLAY variable in order to run GUI applications or scripts that launch GUI applications from Anacron.

Is this a bug?

---

When gnome-tweak-tool is downloaded, the entire Gnome Shell is downloaded with it. The user is not really informed of this. All gnome-tweak-tool dependencies are listed in Software Center as "automatic". On uninstalling it, all gnome-tweak-tool dependencies remain. The Shell stays. That's alot of unused software on the hard drive - assuming it needed to be there in the first place. This should be remedied. It all had to be uninstalled manually.

---

Within the last five to six months:

gnome-disk-utility > Hard Disk View SMART data and run self-tests > Refresh Read SMART Data walking up the disk (which will give you the hard drive temperature) crashes - then Apport asks if you will like to report it.

All the apt-cache dependencies are there..

Will this be fixed any time soon? It is very useful.

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

I can give an answer to the second question:

If you use the package management tools to install a package that has dependencies, then the dependent packages will of course be installed, too. If you now uninstall the package that you installed manually, then the other packages that were installed to meet the dependencies will not be automatically uninstalled. This is per design of the package management system.

But there is the simple command

sudo apt-get --purge autoremove

to purge packages that have been installed to meet other package's dependencies and that are no more needed any more.
Synaptic also has a function to remove such packages.

Revision history for this message
Mike Pastor (zolruntulope) said :
#2

The response is a little confusing:

The "gnome-tweak-tool" was installed with "Software Center". It was then uninstalled with "Software Center". If by "that you installed manually" you meant use of command line tools, I did not use command line tools to install or uninstall "gnome-tweak-tool".

"apt-get autoremove" is run frequently on this system and ran two times after "Software Center" uninstalled "gnome-tweak-tool".

The "apt-get" man page lists the "autoremove" command as the command to:
"remove packages that were automatically installed to satisfy dependencies for other packages": it didn't remove the dependencies listed for "gnome-tweak-tool" in the "Software Center".

I don't think "sudo apt-get --purge autoremove" has ever been run on this system, it is my understanding that the "--purge" option is really just for configuration files.

I can't keep reinstalling to find out if it would uninstall different.

The uninstalled dependencies were uninstalled "manually" with the "Software Center" (sorry for any confusion) one at a time.

The system seems to be functioning quite fine without them.

The word "automatic" is beside all the "gnome-tweak-tool" dependencies in "Software Center" (the installed history part) - it is not beside "gnome-tweak-tool". The man page for "apt-mark" states (and I think I remember seeing it someplace else) - "When you request that a package
   is installed, and as a result other packages are installed to satisfy its dependencies,
   the dependencies are marked as being automatically installed. Once these automatically
   installed packages are no longer depended on by any manually installed packages, they
   will be removed by e.g. apt-get or aptitude"

The "Software Center" being a frontend, I assumed it would work the same way. If the packages with the "automatic" are not uninstalled when the application depending on them is uninstalled, why is the "automatic" word displayed after them?

It looks like something must be fixed.

And further, why is the overwhelming "Gnome Shell" installed with the "gnome-tweak-tool"?

Revision history for this message
Mike Pastor (zolruntulope) said :
#3

The response is a little confusing:

The "gnome-tweak-tool" was installed with "Software Center". It was then uninstalled with "Software Center". If by "that you installed manually" you meant use of command line tools, I did not use command line tools to install or uninstall "gnome-tweak-tool".

"apt-get autoremove" is run frequently on this system and ran two times after "Software Center" uninstalled "gnome-tweak-tool".

The "apt-get" man page lists the "autoremove" command as the command to:
"remove packages that were automatically installed to satisfy dependencies for other packages": it didn't remove the dependencies listed for "gnome-tweak-tool" in the "Software Center".

I don't think "sudo apt-get --purge autoremove" has ever been run on this system, it is my understanding that the "--purge" option is really just for configuration files.

I can't keep reinstalling to find out if it would uninstall different.

The uninstalled dependencies were uninstalled "manually" with the "Software Center" (sorry for any confusion) one at a time.

The system seems to be functioning quite fine without them.

The word "automatic" is beside all the "gnome-tweak-tool" dependencies in "Software Center" (the installed history part) - it is not beside "gnome-tweak-tool". The man page for "apt-mark" states (and I think I remember seeing it someplace else) - "When you request that a package
   is installed, and as a result other packages are installed to satisfy its dependencies,
   the dependencies are marked as being automatically installed. Once these automatically
   installed packages are no longer depended on by any manually installed packages, they
   will be removed by e.g. apt-get or aptitude"

The "Software Center" being a frontend, I assumed it would work the same way. If the packages with the "automatic" are not uninstalled when the application depending on them is uninstalled, why is the "automatic" word displayed after them?

It looks like something must be fixed.

And further, why is the overwhelming "Gnome Shell" installed with the "gnome-tweak-tool"?

Revision history for this message
Mike Pastor (zolruntulope) said :
#4

Sorry about the second (repeated) post above. Is there a way to erase that? I can't find one anywhere here.

Revision history for this message
Manfred Hampl (m-hampl) said :
#5

To the double post: you can "hide" one of them by clicking the respective link on https://answers.launchpad.net/ubuntu/+question/366168

What I meant with "manual install":
When make a new installation of an Ubuntu desktop system, several packages are installed by default, including meta-packages for the kernel and the kernel headers. These meta packages care for installing newer version of the kernel when available, whenever you initiate a package update/upgrade. This what I meant with "automatic".

And what I meant with "manual": If you want to have an additional package installed and instruct the package management system to install it, that is manual (maybe better call it user-initiated). It does not matter which tool you use for this purpose, (apt-get, software-center, synaptic,...). Such package is always marked as "manually installed".

To the "--purge" option of apt-get autoremove:
If you use a package management tool to uninstall a package, then there are two possibilities:
1. uninstall just the package, but keep configuration settings in place, such that after a reinstall the same settings are used as before or
2. uninstall the package and remove the configuration settings.

The first one is default when you uninstall a package (with apt-get, software-center, synaptic,...) and puts the package into a state that it is listed as "rc" in dpkg.
Only if you add --purge to the apt-get remove or autoremove command (or use apt-get purge) also the configuration files are deleted, and the package will no more be listed with the "dpkg -l" command.

I am not aware of an option inside software-center to remove the configuration settings for packages that have been uninstalled. Maybe this could be given as suggestion for future versions.

I never had problems with "apt-get --purge autoremove". This command has always removed obsolete packages no more needed. I do not understand that the gnome-shell and related packages would have been left over if not needed any more.

For diagnostic purposes, what is the output of the following commands (to be executed in a terminal window):

uname -a
lsb_release -crid
dpkg -l | grep -v '^ii'

Revision history for this message
Launchpad Janitor (janitor) said :
#6

This question was expired because it remained in the 'Needs information' state without activity for the last 15 days.

Revision history for this message
Mike Pastor (zolruntulope) said :
#7

dpkg -l | grep -v '^ii' is a long list. Is there a way to attach it to page or should it be cut and pasted directly within this window?

Revision history for this message
Manfred Hampl (m-hampl) said :
#8

If the list is very long, then you probably better upload it to http://pastebin.ubuntu.com and just copy the link to that file into the question document.

Revision history for this message
Mike Pastor (zolruntulope) said :
#9

uname -a

Linux GPD 3.2.0-113-generic-pae #155-Ubuntu SMP Tue Oct 18 18:45:09 UTC 2016 i686 i686 i386 GNU/Linux

lsb_release -crid

Distributor ID: Ubuntu
Description: Ubuntu 12.04.5 LTS
Release: 12.04
Codename: precise

dpkg -l '*' | grep -v '^ii'

http://pastebin.ubuntu.com/23357637/

Revision history for this message
Manfred Hampl (m-hampl) said :
#10

The output is so long, because you executed the command
dpkg -l '*' | grep -v '^ii'
instead of
dpkg -l | grep -v '^ii'

But anyhow, there are no broken or half installed packages listed.

Now back to your questions:
Is there still something that do you want to know, or where you need help?

Revision history for this message
Mike Pastor (zolruntulope) said :
#11

dpkg -l | grep -v '^ii' gave absolutely no output. I assumed perhaps the command was wrong.

Revision history for this message
Manfred Hampl (m-hampl) said :
#12

I would have expected that "dpkg -l | grep -v '^ii'" gives at least four lines of heading.
No detail lines below the heading are a positive result.

Revision history for this message
Mike Pastor (zolruntulope) said :
#13

It does give four lines of heading. It seemed you were looking for packages I may have uninstalled that caused the problem.

A question I have with regard to this one issue is to your insistence that "apt-get --purge autoremove" should have been used. I believed that "apt-get autoremove" was basically the same thing. With the last “ClamAV” update, it removed the “AV” library, but it didn't touch the "gnome-tweak-tool" dependencies when run for that purpose - it did the same thing with "RVM" dependencies. Are you saying that the "..--purge autoremove" would have definitely removed them or were you just explaining the meaning of the word "--purge"?

Configuration settings are not the dependencies.

To other questions: is there a good source of instruction on how to use the "Anacron" program. "Anacron" is one of the strangest programs I've ever used. The man pages and scant installed documentation don't actually instruct very much. It sets up a strange environment with very few variables and we're not told how to administer those variables to get the result we want. For the life of me, I can't understand why it's necessary to set up the HOME variable to launch a GUI from the anacrontab or the “Cron” files (/etc). It took a year to figure it was necessary. I had to export the LANG variable into a Ruby script to get a regular expression to work, etc. The online search doesn't really yield very much.

I hope the "gnome-disk-utility" is fixed soon - it was a good tool.

Revision history for this message
Manfred Hampl (m-hampl) said :
#14

I cannot help with anacron, I have never tried using it myself.

For the --purge option of apt-get autoremove:
I always recommend to use "apt-get --purge autoremove" and not the plain "apt-get autoremove" command, because I assume that everybody who wants to have surplus packages uninstalled will also want to have the configuration files for these packages deleted. If the packages to be deleted do not have configuration files that may be left over, then both variants of the command will do exactly the same.

Running "dpkg -l | grep .v '^ii'" will list all packages where the config files are left over with a status of 'rc'. Your output did not shown any.

Revision history for this message
Mike Pastor (zolruntulope) said :
#15

The user is instructed to assign the DISPLAY variable when launching a GUI application from "cron", "cron.*"
, or "anacron" -- it doesn't work; to launch a GUI application from a "crontab"-like environment establish t
his before any commands that launch it:

DISPLAY=:0
XAUTHORITY=< home_directory >/.Xauthority

To launch a GUI from a script, from "cron.daily", for example, "env" or "export" these variables first:

env DISPLAY=:0 XAUTHORITY=$HOME/.Xauthority

or

export DISPLAY=:0 XAUTHORITY=$HOME/.Xauthority

For launching a Ruby GUI put both variables in "ENV" before launching the GUI.

-----

With regard to the 3rd question:

     "...sh Read SMART Data walking up the..."

It is "...waking up the disk..."

Apology for the misspelling.

Thanks.

Revision history for this message
Mike Pastor (zolruntulope) said :
#16

I chose to repost because the cut-and-paste was sloppy.

The user is instructed to assign the DISPLAY variable when launching a GUI application from "cron", "cron.*", or "anacron" -- it doesn't work; to launch a GUI application from a "crontab"-like environment establish this before any commands that launch it:

DISPLAY=:0
XAUTHORITY=< home_directory >/.Xauthority

To launch a GUI from a script, from "cron.daily", for example, "env" or "export" these variables first:

env DISPLAY=:0 XAUTHORITY=$HOME/.Xauthority

or

export DISPLAY=:0 XAUTHORITY=$HOME/.Xauthority

For launching a Ruby GUI put both variables in "ENV" before launching the GUI.

-----

With regard to the 3rd question:

     "...sh Read SMART Data walking up the..."

It is "...waking up the disk..."

Apology for the misspelling.

Thanks.

Revision history for this message
Mike Pastor (zolruntulope) said :
#17

Just to add:

within anacron -- the anacrontab - the "export" syntax seems to be required.