Answer the question
In order to leave comments, you need to log in
How to permanently delete batch data?
Hello. I have been using Ubuntu relatively recently, since the release of 13.10. I liked the system initially, but the desire to reinstall is quite frequent).
This is due to the fact that I do not understand how to remove packages correctly. For example: put a web server. After some time, I realized that there was not enough space for databases on the main disk, I needed to transfer the database to the main one.
I messed around with the settings a bit, decided to remove mysql and set it up again. They say that purge removes all data, but no. Settings files and databases have been preserved. Why the question: how to remove everything related to the application and leave it as it was before installation?
Answer the question
In order to leave comments, you need to log in
Depends on the application. If we talk about the configuration (for mysql this is /etc/mysql/my.conf if I'm not mistaken), then purge will remove it. If we talk about the contents of the database, then it would be slightly incorrect to delete it automatically. For example, I installed MariaDB - it removes MySQL by dependencies, but picks up its database. I would be very surprised if I discovered the loss of databases and tables during such an update.
The bulk of such files (although this is a very rare occurrence) are located in /var/lib and /usr/share (judging by my observations). You can also search the file system with the package name.
The second is the user configuration. For example, if you delete a browser or window manager, their settings will remain in the user's home folder, although the rest of the system will have a number. Usually these settings are in:
~/
~/.config
~/.local/share
You can browse there and remove what you don't need. In the worst case, the application will load with default settings (just don't touch folders like .gnugpg, .ssh, .pki, etc., which may be related to logging into your account and the like, delete only those names that you know what they are).
The third is the gconf/dconf settings store - sort of like the registry in Windows. Removing partitions only through the terminal, if desired, you can use it.
Well, the last - when installing packages - list the minimum set of packages. For example, if you need a web server with Apache2, PHP and MySQL, the easiest way is to install mysql-server first, and then PhpMyAdmin, which will pull all the necessary dependencies with it (or manually mysql-client apache2 php5). I recommend using synaptic - by choosing a package to install, you will get a list of what is installed by dependencies, perhaps one package will be enough (for example, it is often advised to install nvidia-current nvidia-settings packages, when the first is enough, it will pull the second one according to dependencies). In this case, when you demolish the package, all dependencies will be offered for removal automatically, and when you enter a list of packages in three lines, for cleanliness, you will have to look and remove everything one by one manually, otherwise they will stand forever, because they are manually installed and seem to be needed by someone. Still sometimes packages are installed that are recommended, after removal they may not be offered for removal; You can opt out of such packages like this:
The result was almost an article, but in general, that's it. This use of the system allows you to keep it clean for a long time, unlike Windows, where garbage collection is inevitable. There are a very limited number of places where files can remain, and they are easy to find.
As an example, my system was updated from 12.04, now it's been four months since it's been on 14.04, and it did a downgrade once or twice, for example, from 14.04 to 13.10, but then again updated to 14.04. The system is clean and fast.
And if there are any problems - in 99% they can be solved without reinstalling, just ask people.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question