Morganamilo / paru

Feature packed AUR helper
GNU General Public License v3.0
5.7k stars 222 forks source link

recommended CacheDir setting doesn't work (well) with 'paru -Scc' #734

Open RubenKelevra opened 2 years ago

RubenKelevra commented 2 years ago

Affected Version

paru v1.10.0 - libalpm v13.0.1

Description

I have the local repo configured and use the chroot option. The packages get stored in /var/lib/paru/aur_chroot. When there's no section in the pacman.conf for the AUR repo, you get the following message from paru:

Output

$ paru -Syu
error: no local repos configured, add one to your pacman.conf:
    [options]
    CacheDir = /var/lib/repo/aur

    [aur]
    SigLevel = PackageOptional DatabaseOptional
    Server = file:///var/lib/repo/aur

So I've added my /var/lib/paru/aur_chroot as second CacheDir for Pacman.

When I now run paru -Sc with the recommended options, I get some error messages:

$ paru -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...

Cache directory: /var/lib/paru/aur_chroot/
:: Do you want to remove all other packages from cache? [Y/n] 
removing old packages from cache...
error: could not open file /var/lib/paru/aur_chroot/root: Error reading fd 8
error: missing package metadata in /var/lib/paru/aur_chroot/root.lock
error: could not open file /var/lib/paru/aur_chroot/rubenk: Error reading fd 8
error: missing package metadata in /var/lib/paru/aur_chroot/rubenk.lock

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

Clone Directory: /home/rubenk/.cache/paru/clone
:: Do you want to remove all other AUR packages from cache? [Y/n]: 

Diff Directory: /home/rubenk/.cache/paru/diff
:: Do you want to remove all saved diffs? [Y/n]: 

If I want to clean my cache with paru -Scc completely, I get further error messages:

$ paru -Scc

Cache directory: /var/cache/pacman/pkg/
:: Do you want to remove ALL files from cache? [y/N] y
removing all files from cache...

Cache directory: /var/lib/paru/aur_chroot/
:: Do you want to remove ALL files from cache? [y/N] y
removing all files from cache...
error: could not remove /var/lib/paru/aur_chroot/root: Is a directory
error: could not remove /var/lib/paru/aur_chroot/rubenk: Is a directory

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

Clone Directory: /home/rubenk/.cache/paru/clone
:: Do you want to remove ALL AUR packages from cache? [y/N]: y

Diff Directory: /home/rubenk/.cache/paru/diff
:: Do you want to remove all saved diffs? [Y/n]: y

Afterwards a paru call fails which blocks any further use of paru without manual intervention:

$ paru
[sudo] password for rubenk: 
no new news
:: Synchronizing package databases...
 core                                                                                                             157,3 KiB  1966 KiB/s 00:00 [---------------------------------------------------------------------------------------] 100%
 extra                                                                                                           1724,1 KiB  20,0 MiB/s 00:00 [---------------------------------------------------------------------------------------] 100%
 community                                                                                                          6,6 MiB  89,1 MiB/s 00:00 [---------------------------------------------------------------------------------------] 100%
 multilib                                                                                                         175,4 KiB  42,8 MiB/s 00:00 [---------------------------------------------------------------------------------------] 100%
 endeavouros                                                                                                       31,7 KiB   512 KiB/s 00:00 [---------------------------------------------------------------------------------------] 100%
 chaotic-aur                                                                                                     1710,0 KiB   834 KiB/s 00:02 [---------------------------------------------------------------------------------------] 100%
 aur.db failed to download
error: failed retrieving file 'aur.db' from disk : Couldn't open file /var/lib/paru/aur_chroot/aur.db
error: failed to synchronize all databases (unexpected error)

paru.conf and pacman.conf

``` [options] PgpFetch Devel Provides DevelSuffixes = -git -cvs -svn -bzr -darcs -always -hg -fossil BottomUp RemoveMake SudoLoop CombinedUpgrade CleanAfter UpgradeMenu NewsOnUpgrade BatchInstall LocalRepo Chroot = /var/lib/paru/aur_chroot [bin] FileManager = nnn ```
```conf [options] CacheDir = /var/cache/pacman/pkg/ CacheDir = /var/lib/paru/aur_chroot HoldPkg = pacman glibc Architecture = auto NoExtract = usr/lib/firefox/fonts/TwemojiMozilla.ttf Color ILoveCandy VerbosePkgLists DisableDownloadTimeout ParallelDownloads = 2 SigLevel = Required DatabaseOptional LocalFileSigLevel = Optional [core] Include = /etc/pacman.d/mirrorlist [extra] Include = /etc/pacman.d/mirrorlist [community] Include = /etc/pacman.d/mirrorlist [multilib] Include = /etc/pacman.d/mirrorlist [endeavouros] SigLevel = PackageRequired Include = /etc/pacman.d/endeavouros-mirrorlist [chaotic-aur] Include = /etc/pacman.d/chaotic-mirrorlist [aur] SigLevel = PackageOptional DatabaseOptional Server = file:///var/lib/paru/aur_chroot ```
Morganamilo commented 2 years ago

Yep, I hate it. All my solutions for this have been rejected so there will likely never be any solution.