Site Tools


start:orphanedcleanup

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
start:orphanedcleanup [2022/05/17 19:06] peterstart:orphanedcleanup [2023/09/14 20:47] (current) peter
Line 1: Line 1:
 +DATE CHECKED THIS PAGE WAS VALID: 14/09/2023 
 +
 On testing it is possible a package is removed that you have installed, due to some issue with the package or that is is abandoned. For this reason it is a good idea to every now and again check that the packages on your system have not become orphaned and you still have a pretty clean system.  On testing it is possible a package is removed that you have installed, due to some issue with the package or that is is abandoned. For this reason it is a good idea to every now and again check that the packages on your system have not become orphaned and you still have a pretty clean system. 
 +
 +Note: You should keep a log of any orphaned packages you remove in case they are added back to testing, then you can install them again on the system.
  
 Its also worthwhile checking if any recommended packages are missing from time to time. Its essentially just checking that what your system has is logical and will be kept up to date by apt. By doing this you will reduce the amount of problems you have as well as avoid having to reinstall your OS clean because you are auditing it and keeping it under control. Its also worthwhile checking if any recommended packages are missing from time to time. Its essentially just checking that what your system has is logical and will be kept up to date by apt. By doing this you will reduce the amount of problems you have as well as avoid having to reinstall your OS clean because you are auditing it and keeping it under control.
Line 5: Line 9:
 The first thing I like to do is ensure I have cleaned up any unneeded packages apt detects itself: The first thing I like to do is ensure I have cleaned up any unneeded packages apt detects itself:
 <code> <code>
 +sudo apt-get dist-upgrade
 sudo apt-get autoremove sudo apt-get autoremove
 </code> </code>
 +
 +If there were a lot of updates I would reboot here also just in case.
  
 That is safe to do as apt is detecting what it needs and removes what it does not. However you should always read what it wants to remove and check you agree its logical. That is safe to do as apt is detecting what it needs and removes what it does not. However you should always read what it wants to remove and check you agree its logical.
Line 24: Line 31:
 Now I have a clean place to start from and the packages I want installed, I can now look for packages I dont want, and are orphaned. Now I have a clean place to start from and the packages I want installed, I can now look for packages I dont want, and are orphaned.
  
-Orphaned packages are bad, because they will never receive an update. They no longer reside in any source in your apt package manager, for whatever reason. So this is where we must tread carefully as we can break our install if we remove packages that we need, but somehow became orphaned.+Orphaned packages are bad, because they will never receive an update, can cause unexpected results if used by your system or have vulnerabilities that are known to everyone except your system. They no longer reside in any source in your apt package manager, for whatever reason, but can still be accessed by your box. So this is where we must tread carefully as we can break our install if we remove packages that we need, but somehow became orphaned, or didnt get replaced correctly.
  
 In any case our overall goal should be to decide, do we want this? If yes - try to find why its no longer in the repositories we have configured. If no - see if removing it is dangerous. In any case our overall goal should be to decide, do we want this? If yes - try to find why its no longer in the repositories we have configured. If no - see if removing it is dangerous.
Line 91: Line 98:
  
 I then reboot my machine and check everything is working. I recommend keeping the timeshift snapshot a few days in case you don't notice something broken right away. I then reboot my machine and check everything is working. I recommend keeping the timeshift snapshot a few days in case you don't notice something broken right away.
 +
 +-----------------------------------------------------------------------------
 +
 +Another thing that can happen is that packages get marked for manual install that over time you no longer need.
 +
 +You can check what packages are marked for manual installation by running:
 +<code>
 +sudo aptitude search '!~M ~i !~E !~prequired !~pimportant !~pstandard' 
 +</code>
 +
 +Or alternatively a less filtered option
 +
 +<code>
 +aptitude search '!~M ~i'
 +</code>
 +
 +You will have to check carefully if you want all the packages in there. Removing all of them without any thought would break your system and there should be no harm leaving them alone but if you do want to clean your system a bit its another thing to check. Output example:
 +
 +{{:images:manualinstallapt.png|}}
 +
  
start/orphanedcleanup.1652814367.txt.gz · Last modified: 2022/05/17 19:06 by peter