Error cleaning package cache

When I run sudo pacman -Sc, I get the following error


$ sudo pacman -Sc
Packages to keep:
  All locally installed packages

Cache directory: /var/cache/pacman/pkg/
:: Do you want to remove all other packages from cache? [Y/n] y
removing old packages from cache...
error: could not open file /var/cache/pacman/pkg/download-4OLa2G: Error reading fd 7
error: could not open file /var/cache/pacman/pkg/download-XSO4gN: Error reading fd 7
error: could not open file /var/cache/pacman/pkg/download-oWfncl: Error reading fd 7

Database directory: /var/lib/pacman/
:: Do you want to remove unused repositories? [Y/n] y
removing unused sync repositories...

What is going on?

How to fix this?

1 Like

I get the same or similar here. It’s probably just it cant read the it because it’s no longer in that repo.

[ricklinux@rick-ms7c37 ~]$ sudo pacman -Sc
Packages to keep:
  All locally installed packages

Cache directory: /var/cache/pacman/pkg/
:: Do you want to remove all other packages from cache? [Y/n] 
removing old packages from cache...
error: could not open file /var/cache/pacman/pkg/download-Rq5Ryo: Error reading fd 7
error: could not open file /var/cache/pacman/pkg/download-ngTjC4: Error reading fd 7

Database directory: /var/lib/pacman/
:: Do you want to remove unused repositories? [Y/n] 

Edit: That’s just my guess? :person_shrugging:

How to remove it permanently?

Did you press enter at the end? Isn’t the error message gone then?

I meant, how to make pacman forget about these non-existent files? They show up again the next time I ran pacman -Sc

Try paccache -r :person_shrugging:

It says ==> no candidate packages found for pruning

But the issue persists.

This looks like you had a download fail at some point, leaving partially downloaded file fragments.

Just delete them manually.

2 Likes

Sometimes i think people worry to much about error messages and other times they don’t. :zany_face:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.