Skip to content

Clearing cache fails when no pacman cache directories exist #2652

@S0AndS0

Description

@S0AndS0

Affected Version

yay v12.5.0 - libalpm v15.0.0

Describe the bug

Following paths seem to be expected by yay -Scc and cause failure in clearing user home cache when non-existent

  • /var/cache/pacman/pkg/
  • /var/lib/pacman/

Reproduction Steps

  1. Use tmpfs for pacman cache
  2. Attempt to clear yay cache after a fresh boot
  3. Question my life choices

Expected behavior

Expect yay to check if pacman cache directories exist prior to attempting to clear them

Output

  • When no pacman cache directories exist
    yay -Scc
    #> 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 access cache directory /var/cache/pacman/pkg/
    #> Database directory: /var/lib/pacman/
    #> :: Do you want to remove unused repositories? [Y/n] y
    #> removing unused sync repositories...
    #>  -> exit status 1
  • When pacman cache directories do exist
    yay -Scc
    #> Cache directory: /var/cache/pacman/pkg/
    #> :: Do you want to remove ALL files from cache? [y/N] y
    #> removing all files from cache...
    #> 
    #> Database directory: /var/lib/pacman/
    #> :: Do you want to remove unused repositories? [Y/n] y
    #> removing unused sync repositories...
    #> 
    #> Build directory: /home/s0ands0/.cache/yay
    #> :: Do you want to remove ALL AUR packages from cache? [Y/n] y
    #> removing AUR packages from cache...

Notes

Not really a big deal, I probably could've answered no to the first two pacman related directories 🤷

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions