Monday, April 29, 2024
12
rated 0 times [  12] [ 0]  / answers: 1 / hits: 1383  / 3 Years ago, sat, may 8, 2021, 9:31:19

I specifically installed libreoffice-writer on my system and then purged it with sudo apt-get purge '*libreoffice-writer*' --autoremove. After this i ran these terminal commands one after the other to ascertain whether i actually got rid of all the files associated with libreoffice or libreoffice-writer -


apt-cache search libreoffice-writer

sudo find / -name libreoffice

command output image


and then i ran apt-cache search libreoffice and it displayed dozens of files with the name 'libreoffice'
output image


As you can see in the terminal images, why are there so many associated files still left? How do i get rid of all of these files in such a way that the next time i install anything from libreoffice it should install itself like it was installing for the first time on my system ?


More From » package-management

 Answers
3

Apt maintains a local database of all available deb package from all currently-known sources. "Available" means that it includes packages that you don't currently have installed as well as the packages that you DO currently have installed.



  • apt-cache searches the database

  • apt update refreshes the database from those sources

  • apt list libreoffice-writer or apt list libreoffice* will specify which packages in the output are installed.




Now let's look at files and directories that remain after a --purge.



  • Directories may remain if they are not empty after apt is done removing files. Some other package (or the admin) may be using the directory, too.



  • Apt will NEVER remove any file located under your /home directory. (The manpage is very clear about that)






A word about using wildcards with apt: Many users are surprised when wildcards cause extra packages to be marked for action, and when packages they expected to be marked aren't.


There could be lots of possible reasons why you get an action different than you expect: Dependencies, unexpected names, misspellings, wrong wildcard, etc.


There are two schools of thought on safe, effective usage of wildcards with apt:



  1. Use apt's --simulate to test the action first. Review your output and find the unexpected BEFORE doing it for real.



  2. Avoid using wildcards at all. Use apt's tools to KNOW the correct packages you want to act upon. Then list those packages.




[#1050] Monday, May 10, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
mocipe

Total Points: 161
Total Questions: 106
Total Answers: 118

Location: Cambodia
Member since Thu, Oct 7, 2021
3 Years ago
mocipe questions
;