Issues Updating and Upgrading on Ubuntu EC2
Random issues and how to fix
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
⚙️ Check out my series on Automating Cybersecurity Metrics | Code.
🔒 Related Stories: Bugs | AWS Security | Network Security
💻 Free Content on Jobs in Cybersecurity | ✉️ Sign up for the Email List
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I already wrote about how I was trying to troubleshoot an issue which magically was no longer an issue today.
After that issue seemed to magically fix itself I started wondering how my system got updated and if there were any new updates. Today I tried to apt-get update and upgrade my Ubuntu EC2 instance.
sudo apt-get update
sudo apt-get upgradeWhen I tried I got an error that the system was out of disk space on the root drive which I didn’t get the time I ran update and upgrade. Odd.
So I started searching around for things I could delete off the root drive. I found some interesting files in the /tmp directory — one referencing SSH which I don’t use, so I deleted it.
sudo ls /tmpAnother directory started with snap or .snap. I took my changes and deleted that as well. I moved some files I had downloaded to my other drive.
Then I tried to follow the process again and it didn’t work. I had to run the following:
sudo apt --fix-broken installThat is likely due to the disk space issue which prevented from files from installing:
The following packages have unmet dependencies:
linux-headers-5.19.0-1027-aws : Depends: linux-aws-5.19-headers-5.19.0-1027 but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).Along the way I got an error message that the AWS version (kernel? I can’t find the error now as I think it was in a pop up dialog) was not the correct version. It looked like it was a version behind. The system was rebooting. OK. It didn’t really give me any other options. Glad I wasn’t running anything important that could not be interrupted. A warning in advance would be great.
After doing all that and update and upgrade seem to be happy again.
Unfortunately it did not fix this error with code that used to work before. The AWS CLI Profile works, but not when I use it with the Boto3 client. The profile requires MFA and an external ID. It used to work. Still trying to resolve it.
File "/home/ubuntu/.local/lib/python3.10/site-packages/botocore/client.py", line 530, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/home/ubuntu/.local/lib/python3.10/site-packages/botocore/client.py", line 964, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (UnauthorizedOperation) when calling the DescribeNetworkInterfaces operation: You are not authorized to perform this operation.Follow for updates.
Teri Radichel | © 2nd Sight Lab 2023
About Teri Radichel:
~~~~~~~~~~~~~~~~~~~~
⭐️ Author: Cybersecurity Books
⭐️ Presentations: Presentations by Teri Radichel
⭐️ Recognition: SANS Award, AWS Security Hero, IANS Faculty
⭐️ Certifications: SANS ~ GSE 240
⭐️ Education: BA Business, Master of Software Engineering, Master of Infosec
⭐️ Company: Penetration Tests, Assessments, Phone Consulting ~ 2nd Sight LabNeed Help With Cybersecurity, Cloud, or Application Security?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
🔒 Request a penetration test or security assessment
🔒 Schedule a consulting call
🔒 Cybersecurity Speaker for PresentationFollow for more stories like this:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
❤️ Sign Up my Medium Email List
❤️ Twitter: @teriradichel
❤️ LinkedIn: https://www.linkedin.com/in/teriradichel
❤️ Mastodon: @teriradichel@infosec.exchange
❤️ Facebook: 2nd Sight Lab
❤️ YouTube: @2ndsightlab





