Closed hancush closed 3 years ago
auto-remove should be good!
ubuntu@ip-10-0-0-22:~$ sudo apt-get autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
linux-headers-5.4.0-1029-aws : Depends: linux-aws-5.4-headers-5.4.0-1029 but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
Incredible that there's a version of the headers we haven't installed, har har. I'm hesitant to screw too much with things on a production server without a second set of eyeballs. Can we pair on this at some point?
yes. let's see if we need all of r&d
Annual server maintenance checklist. Update app / server inventory, especially for legacy setup.
Did apt --fix-broken-install
. Kept local version of package whenever apt prompted that a file may have changed. Then was able to successfully run apt-get autoremove
and reclaim > 2 GB of space. We probably don't want to automate this, but it would be good to clean up apt packages on an annual basis, hence the annual maintenance checklist.
We probably also want to confirm system journal to a max size.
Finally, we should turn on disk use alarms so we receive alerts if servers run out of space.
Revised work list:
Created a revised inventory of applications deployed on legacy AWS infrastructure: https://docs.google.com/spreadsheets/d/1_c1_v4IJ5wLpjUt0p0Feq3LXskItu5Ml9J6gZucSqpw/edit?usp=sharing (excepting most of the sites on Staging). Very gratifying to see how many static sites we've migrated to Netlify, and definitely see some opportunities to migrate even more (for example, SSCE and SFM are both slated to migrate to Heroku this year).
I'll create an annual server maintenance issue and schedule the next round of work (2021)
Description
I received a notification that the R&R SSL cert was set to expire. I shelled into the server and attempted to confirm that we'd installed the auto-renew cron tab, but found that there was no disk space left when I tried to tab complete. Ran
df
to confirm disk use was the problem.Second challenge: Without disk space, I couldn't sort
du
output to identify the largest files, so I Googled an alternative and settled onfind
with a minimum file size. At first I tried 10M, but that yielded a lot of files, so I upped it to 20M.I noticed several large system journal files, so Googled again, and found that
journalctl
has easy cleanup commands. Ran one to free up more than half a gig.Many of the remaining large files seem to be many versions of Linux AWS headers:
I think we should be able to clean up old versions and reclaim further space with
apt-get autoremove
, but I want to double check that with @fgregg to ensure it doesn't cause any unintended side effects.Some next steps: