I/O error and read only file issue

I downloaded Ubuntu because I need to run linux software (MUMmer, a bioinformatics tool) on my PC. Im trying to follow this websites instructions: and I get to the step where I need to update and upgrade packages and I have to type:

sudo apt update && sudo apt upgrade

and I get these errors: first error

I tried googling it and it said to try:

sudo apt-get update

but when I did, I got these errors:

Hit:1 focal InRelease
Err:1 focal InRelease Couldn't create temporary file /tmp/apt.conf.waoP04 for passing config to apt-key
Ign:2 focal-updates InRelease
Ign:3 focal-security InRelease
Ign:4 focal-backports InRelease
Err:5 focal-security Release Could not open file /var/lib/apt/lists/partial/security.ubuntu.com_ubuntu_dists_focal-security_Release - open (30: Read-only file system) [IP: 91.189.88.152 80]
Err:6 focal-updates Release Could not open file /var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_focal-updates_Release - open (30: Read-only file system) [IP: 91.189.88.142 80]
Err:7 focal-backports Release Could not open file /var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_focal-backports_Release - open (30: Read-only file system) [IP: 91.189.88.152 80]
Reading package lists... Error!
W: chown to _apt:root of directory /var/lib/apt/lists/partial failed - SetupAPTPartialDirectory (30: Read-only file system)
W: chmod 0700 of directory /var/lib/apt/lists/partial failed - SetupAPTPartialDirectory (30: Read-only file system)
W: chown to _apt:root of directory /var/lib/apt/lists/auxfiles failed - SetupAPTPartialDirectory (30: Read-only file system)
W: chmod 0700 of directory /var/lib/apt/lists/auxfiles failed - SetupAPTPartialDirectory (30: Read-only file system)
W: Not using locking for read only lock file /var/lib/apt/lists/lock
W: Problem unlinking the file /var/lib/apt/lists/partial/.apt-acquire-privs-test.Auv1Lz - IsAccessibleBySandboxUser (30: Read-only file system)
W: Problem unlinking the file /var/lib/apt/lists/partial/.apt-acquire-privs-test.bTmzQz - IsAccessibleBySandboxUser (30: Read-only file system)
W: Problem unlinking the file /var/lib/apt/lists/partial/.apt-acquire-privs-test.x6Yb4z - IsAccessibleBySandboxUser (30: Read-only file system)
W: Problem unlinking the file /var/lib/apt/lists/partial/.apt-acquire-privs-test.14iUqA - IsAccessibleBySandboxUser (30: Read-only file system)
W: Problem unlinking the file /var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_focal_InRelease - PrepareFiles (30: Read-only file system)
W: chown to _apt:root of file /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_focal_InRelease failed - Item::QueueURI (30: Read-only file system)
W: chmod 0600 of file /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_focal_InRelease failed - Item::QueueURI (30: Read-only file system)
W: chown to root:root of file /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_focal_InRelease failed - 400::URIFailure (30: Read-only file system)
W: chmod 0644 of file /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_focal_InRelease failed - 400::URIFailure (30: Read-only file system)
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: focal InRelease: Couldn't create temporary file /tmp/apt.conf.waoP04 for passing config to apt-key
W: Problem unlinking the file /var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_focal-updates_InRelease - PrepareFiles (30: Read-only file system)
W: Problem unlinking the file /var/lib/apt/lists/partial/security.ubuntu.com_ubuntu_dists_focal-security_InRelease - PrepareFiles (30: Read-only file system)
W: Problem unlinking the file /var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_focal-backports_InRelease - PrepareFiles (30: Read-only file system)
W: Problem unlinking the file /var/lib/apt/lists/partial/security.ubuntu.com_ubuntu_dists_focal-security_Release - PrepareFiles (30: Read-only file system)
E: The repository ' focal-security Release' no longer has a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: Problem unlinking the file /var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_focal-updates_Release - PrepareFiles (30: Read-only file system)
E: The repository ' focal-updates Release' no longer has a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: Problem unlinking the file /var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_focal-backports_Release - PrepareFiles (30: Read-only file system)
E: The repository ' focal-backports Release' no longer has a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (30: Read-only file system)
W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (30: Read-only file system)
E: Unable to mkstemp /tmp/clearsigned.message.osv9ux - GetTempFile (30: Read-only file system)
E: The package lists or status file could not be parsed or opened.

and it said to try

sudo apt-get install wget ca-certificates

but I got this error:

W: Not using locking for read only lock file /var/lib/dpkg/lock-frontend
W: Not using locking for read only lock file /var/lib/dpkg/lock
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.

after runningsudo dpkg --configure -a

I get this error:

dpkg: error: unable to access the dpkg database directory /var/lib/dpkg: Read-only file system

I tried looking for solutions but I have no idea what all this is or means, unfortunately. I don't know what this /var/lib/dkkg directory is or where it is or what I need to do.

I tried ignoring this error and moving on to the other steps, for downloading anaconda, which I need to then download biocondna but then I get this error:

wget: error while loading shared libraries: /lib/x86_64-linux-gnu/libpsl.so.5: cannot read file data: Input/output error

Any help would be much appreciated because I'm starting to dispair. Thank you in advance.

EDIT: The output of powershell.output

EDIT NUMBER 2 : Errors when installing anaconda, more RO stuff.:

/home/noor/anaconda3 - Press ENTER to confirm the location - Press CTRL-C to abort the installation - Or specify a different location below
[/home/noor/anaconda3] >>>
PREFIX=/home/noor/anaconda3
installing: python-3.7.0-hc3d631a_0 ...
Python 3.7.0
installing: blas-1.0-mkl ...
installing: ca-certificates-2018.03.07-0 ...
installing: conda-env-2.6.0-1 ...
installing: intel-openmp-2019.0-118 ...
installing: libgcc-ng-8.2.0-hdf63c60_1 ...
installing: libgfortran-ng-7.3.0-hdf63c60_0 ...
installing: libstdcxx-ng-8.2.0-hdf63c60_1 ...
installing: bzip2-1.0.6-h14c3975_5 ...
installing: expat-2.2.6-he6710b0_0 ...
installing: fribidi-1.0.5-h7b6447c_0 ...
installing: gmp-6.1.2-h6c8ec71_1 ...
installing: graphite2-1.3.12-h23475e2_2 ...
installing: icu-58.2-h9c2bf20_1 ...
installing: jbig-2.1-hdba287a_0 ...
installing: jpeg-9b-h024ee3a_2 ...
installing: libffi-3.2.1-hd88cf55_4 ...
installing: libsodium-1.0.16-h1bed415_0 ...
installing: libtool-2.4.6-h544aabb_3 ...
installing: libuuid-1.0.3-h1bed415_2 ...
installing: libxcb-1.13-h1bed415_1 ...
installing: lzo-2.10-h49e0be7_2 ...
installing: mkl-2019.0-118 ...
tar: lib/libmkl_vml_avx512.so: Wrote only 1536 of 10240 bytes
tar: lib/libmkl_vml_avx512.so: Cannot utime: Read-only file system
tar: lib/libmkl_vml_avx2.so: Cannot open: Read-only file system
tar: lib/libmkl_vml_avx.so: Cannot open: Read-only file system
tar: lib/libmkl_vml_avx512_mic.so: Cannot open: Read-only file system
tar: lib/libmkl_sequential.so: Cannot open: Read-only file system
tar: lib/libmkl_gnu_thread.so: Cannot open: Read-only file system
tar: lib/libmkl_tbb_thread.so: Cannot open: Read-only file system
tar: lib/libmkl_pgi_thread.so: Cannot open: Read-only file system
tar: lib/libmkl_intel_thread.so: Cannot open: Read-only file system
tar: lib/libmkl_def.so: Cannot open: Read-only file system
tar: lib/libmkl_mc.so: Cannot open: Read-only file system
tar: lib/libmkl_mc3.so: Cannot open: Read-only file system
tar: lib/libmkl_avx.so: Cannot open: Read-only file system
tar: lib/libmkl_avx2.so: Cannot open: Read-only file system
tar: lib/libmkl_avx512.so: Cannot open: Read-only file system
tar: lib/libmkl_core.so: Cannot open: Read-only file system
tar: lib/libmkl_avx512_mic.so: Cannot open: Read-only file system
tar: Exiting with failure status due to previous errors
2

1 Answer

We established in comments and chat that you ran out of disk space on the Windows drive where WSL is installed. This caused WSL to mark the drive as read-only to Ubuntu, masking the true problem.

Once this happens, it's not possible to recover from it from Ubuntu. The virtual disk that WSL2 uses will grow when files are added to it, but it does not automatically shrink when data is removed. There are workarounds, but I think you'd need free disk space in order to use them anyway.

So since this is a freshly (re)installed Ubuntu and you've already removed a previous version, I'm going to suggest we start with uninstalling all current WSL instances (Ubuntu and Ubuntu 20.04). That will recover at least some space for Windows to function properly, as you might start seeing errors there as well.

However, as you are fairly low on disk space, this clearly isn't going to be enough. You'll need to free up some space on the Windows side before attempting to reinstall WSL/Ubuntu and Anaconda.

I'd recommend 4GB if you can get that much. A base WSL/Ubuntu install takes around 1.7GB iirc. Then you'll need to do updates, the Anaconda install, and presumably data. And Windows is going to want some free disk space for its purposes as well. You can probably make it work with 3GB, but I'd really try for 4 if you can.

I'm kind of surprised that Windows didn't pop up the "low disk space" warning and offer to run the Disk Cleanup option, but at least start there. From the Start menu, type "Disk Cleanup" and see how much space you can recover. Dang - I have 27GB right there myself! Hopefully you'll be as lucky!


Okay, continuing this since you just don't have much space to reclaim on C:, but you do seem to have more space on your D: drive.

Start by removing both existing WSL distributions if you haven't already. That should give you at least enough space to start.

Then reinstall "Ubuntu" as you did before. Launch it one time to create your user/password, then exit it. We've established that you should have at least enough disk space on C: to do that.

Now, go to PowerShell:

# Modify this first line if you'd like to use a different location
$WSL_BASE = "D:\WSL"
mkdir "$WSL_BASE\instances\Ubuntu"
mkdir "$WSL_BASE\images"
cd "$WSL_BASE"
wsl --export Ubuntu "$WSL_BASE\images\ubuntu.tar"
# The "UbuntuD" in the next line can be whatever you want to name it
wsl --import UbuntuD "$WSL_BASE\instances\Ubuntu" "$WSL_BASE\images\ubuntu.tar" --version 2
wsl ~ -d UbuntuD

You should now be in a the UbuntuD that we installed on the D: drive. You should be root, since WSL doesn't "remember" your default username when --import'ing. We can set it with the following:

Important - The following code block is a multi-line command and most be run all at once (don't run line-by-line as suggested with the others.

Also important - Modify the "username" in this line before pasting the following:

sudo sh -c "( cat << EOF
[user]
default=username
EOF
) > /etc/wsl.conf"

exit to return to PowerShell. Then wsl --terminate UbuntuD from PowerShell.

From PowerShell:

wsl --set-default UbuntuD
wsl ~

Try your sudo apt update && sudo apt upgrade and install Anaconda again.

Hopefully that gives you the space you need.

Now uninstall "Ubuntu" so that you reclaim the space from C:.

Note that your very low disk space on C: is going to continue to be a major problem for other Windows apps, I would expect, but at least not for WSL at this point.

Also recommend installing Windows Terminal from the Microsoft Store. It will pick up your new WSL distribution and automatically create a profile for it.

3

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like