Can we use bleachbit with sudo on Ubuntu (10.04+) ?

Forum tags: 


Will crash the system if we use the bleachbit with sudo on Ubuntu (10.04+) ? Is there users (on this forums) who had try it ?

Thank you!

As the author of BleachBit, I've tested BleachBit with sudo lightly with Ubuntu 10.04 and 10.10. Also, I haven't heard of any special concerns except, as with other Linux distributions, to be careful if you use non-English locales with the Localizations cleaner: at a minimum, set it up in the preferences menu.

As with non-sudo use, be careful with the items you select. The old saying is, "One man's trash is another man's treasure."

There have been reports of BleachBit not starting with root permissions on Ubuntu 11.04 (not yet released), but this only concerns the startup---not the actual cleaning use of BleachBit. There is workaround for the startup problem.

Andrew, lead developer

For graphical applictions, it's not recommended to use sudo, but instead use gksudo or su-to-root:

gksudo bleachbit

su-to-root -X -c bleachbit

If you install the Ubuntu package, a menu is automatically created to run BleachBit as root with the above su-to-root command.

I had better luck with a custom menu entry that uses "gksudo bleachbit".

Maybe this could be changed to the default for the Ubuntu packages?

I clean the system with Bleachbit first. After that i open bleachbit with gksudo. With gksudo, bleachbit cleans just these files:

Clipboard 0
apt-get autoclean 0
apt-get autoremove 0
Truncate 0 /var/log/boot.log
Truncate 0 /var/log/messages

But after that i re-open again bleachbit with sudo and it cleans many other files (about 10-15 files extra). So i think we need "sudo" for bleachbit. Am i right ?

Thank you!

If you run BleachBit with "sudo", you will notice it cleans through all of your user's paths, not root's. If you want it to run with the root's paths, you either need to run:

gksudo bleachbit


su-to-root -X -c "bleachbit"

* If you run without sudo, gksudo, or su-to-root, it will run as a normal user, without root privileges, and it will not be able to clean up APT, logs, and other root-only files.

* If you run it with "sudo", it will run it with root privileges, but it will still use your user's home folder and other paths; but you will be able to clean APT, logs, etc.

* If you run it with "gksudo" or "su-to-root", then it will run it with root privileges *and* use the root's paths (not the user's.)

So I recommend running it normally, to clean out user settings, files, and temp. And then running it again with gksudo (or su-to-root) to clean out APT, logs, etc. Each way of running it allows you to set *different* options, without interfering with each other. So if you check APT when running it with gksudo, you can still leave APT unchecked when running it like normal.

Isn't there a bleachbit-admin command that launchs it with root privleges? I remember using it before.

In the packages I provide on this site you should see two shortcuts in the GNOME/KDE menu. One of the shortcuts is "BleachBit as Administrator." On Ubuntu, this shortcut invokes
su-to-root -X -c bleachbit

For the package provided in the Debian and Ubuntu repositories, I think the maintainer put something else.

Andrew, lead developer