So I recently got a new raspberry pi 4 and I went to update it and ran the following commands:
sudo apt-get update and
sudo apt-get upgrade. The update command ran perfectly fine but when I ran upgrade I got errors stating this:
* dphys-swapfile.service - dphys-swapfile - set up, mount/unmount, and delete a swap file Loaded: loaded (/lib/systemd/system/dphys-swapfile.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Wed 2021-01-06 10:39:20 GMT; 17ms ago Docs: man:dphys-swapfile(8) Process: 7793 ExecStart=/sbin/dphys-swapfile setup (code=exited, status=0/SUCCESS) Process: 7816 ExecStart=/sbin/dphys-swapfile swapon (code=exited, status=255/EXCEPTION) Main PID: 7816 (code=exited, status=255/EXCEPTION)
Jan 06 10:39:20 raspberrypi systemd: dphys-swapfile.service: Failed with result 'exit-code'. Jan 06 10:39:20 raspberrypi systemd: Failed to start dphys-swapfile - set up, mount/unmount, and delete a swap file. dpkg: error processing package dphys-swapfile (--configure): installed dphys-swapfile package post-installation script subprocess returned error exit status 1 Errors were encountered while processing: dphys-swapfile E: Sub-process /usr/bin/dpkg returned an error code (1)
I've done a fair bit of googling and researching but I just can't seem to find anything. I've tried running this command
sudo apt-get reinstall coreutils to maybe reinstall swapfile but it gave me a similar error. I also tried a fresh flash of Raspbian but the same error came up when I went to update that too. I'm new to linux as this is my first time using it and I'm not sure how to go about fixing this.
Also sorry if I messed up in the format for this post in some way. This is my first post here :)