Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 915  / 3 Years ago, thu, october 14, 2021, 2:41:28

man apt-get says:



autoremove is used to remove packages that were automatically installed to satisfy dependencies for other packages and are now no longer needed.



So why is it not automatically called every time I remove package?


EDIT


Essentially, my question is: Why use remove <pkg name> and not autoremove <pkg name> to remove packages.


See here


PS: This won't break dependency as said here


More From » apt

 Answers
6

See the AptGet/Howto - Ubuntu Documentation page to clear your doubts.



It says:



apt-get autoremove


This command removes packages that were installed by other packages and are no longer needed.



apt-get autoremove <package_name>


This command removes an installed package and dependencies.



and



apt-get remove <package_name>


This command removes an installed package, leaving configuration files intact.



EDIT



It depends on how much you trust the dependancy tracker. While almost always correct, there are times when you would want a dependancy to remain, particularly when you are a developer or power user installing software that is not in the repository.



If you always install software through apt-get, without exception, and trust all the dependancies to be correct (which they usually are), then you can use apt-get autoremove and gain a small amount of drive space and a reduced exposure to potential security holes by having it remove packages that no longer have any packages that need them.



But if you install software manually, or develop software, or do not want to deal with a possible dependancy error, then not using autoremove to clear potentially unused packages is probably the safer choice. Regardless of whether you use apt-get autoremove every now and then or not, you will always remove software using apt-get remove Package



For example, if I install AwesomePackage, it may depend on AwesomeLibrary, and thus AwesomeLibrary will get automatically installed as a dependancy. When I remove AwesomePackage using autoremove, as long as no other package has AwesomeLibrary as a dependancy it will be uninstalled as well. But if SuperPackage also requires AwesomeLibrary, or if I had installed AwesomeLibrary explicitly myself rather than having it come in automatically as a dependancy (apt-get install AwesomeLibrary), then autoremove would not get rid of it.



The reason it is not the default is that having AwesomeLibrary on the system, unused, is a very minor issue. It will almost never cause problems, and most dependancies don't take up much space. There are exceptions, but the times when removing a dependancy will cause problems outnumber the times when it will solve or prevent a problem.



Source: SuperUser: When would you use apt-get remove over apt-get autoremove?


[#29754] Friday, October 15, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
cocal

Total Points: 236
Total Questions: 111
Total Answers: 123

Location: Belarus
Member since Tue, Mar 14, 2023
1 Year ago
cocal questions
Tue, Oct 12, 21, 20:46, 3 Years ago
Sat, Oct 8, 22, 04:23, 2 Years ago
Wed, Sep 14, 22, 22:38, 2 Years ago
Sun, Dec 18, 22, 02:24, 1 Year ago
Wed, Jun 29, 22, 17:31, 2 Years ago
;