You are not logged in.

#1 Yesterday 09:36:45

FernandoBasso
Member
From: Brazil
Registered: 2010-10-27
Posts: 118
Website

[SOLVED] Error could not remove /var/cache/pacman/pkg/download-*

$ aur sync --upgrades && \
  sudo pacman --sync --refresh --sysupgrade

(redacted output)

:: Proceed with installation? [Y/n]
error: Partition / too full: 400344 blocks needed, 39166 blocks free
error: failed to commit transaction (not enough free disk space)
Errors occurred, no packages were upgraded.

$ lsblk -f /dev/nvme0n1
NAME        FSTYPE      FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
nvme0n1
├─nvme0n1p1 vfat        FAT32       3D6B-C149                             853.2M    17% /efi
├─nvme0n1p2 ext4        1.0         60b9e567-4bf5-46ee-8fb2-7ebccb8103d6    153M    95% /
└─nvme0n1p3 crypto_LUKS 2           ea9f5a54-72d1-401f-a3d7-90cf5c528ca9
  └─home    ext4        1.0         002c5d3b-14e0-411a-8091-525f3663873e  144.7G    78% /home

Indeed, nvme0n1p2 partition which contains the system is almost full at 95%. Run the command to clear pacman's cache and free disk space, and it produced this output, which includes some errors:

$ sudo pacman --sync --clean --clean
[sudo] password for devy:

Cache directory: /var/cache/pacman/pkg/
:: Do you want to remove ALL files from cache? [y/N] y
removing all files from cache...
error: could not remove /var/cache/pacman/pkg/download-QIQPWQ: Is a directory
error: could not remove /var/cache/pacman/pkg/download-WQs8Lr: Is a directory
error: could not remove /var/cache/pacman/pkg/download-J8AVRZ: Is a directory
error: could not remove /var/cache/pacman/pkg/download-TXaEBJ: Is a directory
error: could not remove /var/cache/pacman/pkg/download-4qauwN: Is a directory
error: could not remove /var/cache/pacman/pkg/download-72RS65: Is a directory
error: could not remove /var/cache/pacman/pkg/download-CzWajG: Is a directory
error: could not remove /var/cache/pacman/pkg/download-bMEKMt: Is a directory
error: could not remove /var/cache/pacman/pkg/download-er6JPP: Is a directory

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

Despite those errors, the cache was cleared (at least part of it), as it is now at 61%.

$ lsblk -f /dev/nvme0n1
NAME        FSTYPE      FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
nvme0n1
├─nvme0n1p1 vfat        FAT32       3D6B-C149                             853.2M    17% /efi
├─nvme0n1p2 ext4        1.0         60b9e567-4bf5-46ee-8fb2-7ebccb8103d6   31.8G    61% /
└─nvme0n1p3 crypto_LUKS 2           ea9f5a54-72d1-401f-a3d7-90cf5c528ca9
  └─home    ext4        1.0         002c5d3b-14e0-411a-8091-525f3663873e  144.7G    78% /home

Also, those directories are empty:

$ sudo tree -CF /var/cache/pacman/pkg/
/var/cache/pacman/pkg//
├── download-4qauwN/
├── download-72RS65/
├── download-bMEKMt/
├── download-CzWajG/
├── download-er6JPP/
├── download-J8AVRZ/
├── download-QIQPWQ/
├── download-TXaEBJ/
└── download-WQs8Lr/

10 directories, 0 files

dotfiles [devel *%|u=]
$ sudo du -h /var/cache/pacman/pkg/
4.0K	/var/cache/pacman/pkg/download-QIQPWQ
4.0K	/var/cache/pacman/pkg/download-WQs8Lr
4.0K	/var/cache/pacman/pkg/download-J8AVRZ
4.0K	/var/cache/pacman/pkg/download-TXaEBJ
4.0K	/var/cache/pacman/pkg/download-4qauwN
4.0K	/var/cache/pacman/pkg/download-72RS65
4.0K	/var/cache/pacman/pkg/download-CzWajG
4.0K	/var/cache/pacman/pkg/download-bMEKMt
4.0K	/var/cache/pacman/pkg/download-er6JPP
764K	/var/cache/pacman/pkg/

I'd like some insights into the error and the reason for those directories to cause the error, even though they are all empty. I didn't check if they were empty before pacman -Scc, though, but because of the error, maybe they were empty before.

Last edited by FernandoBasso (Yesterday 10:45:18)


There is a difference between knowing the path and walking the path.

Offline

#2 Yesterday 10:11:56

mpan
Member
Registered: 2012-08-01
Posts: 1,676
Website

Re: [SOLVED] Error could not remove /var/cache/pacman/pkg/download-*

These directories may be safely removed:

$ sudo rm -r /var/cache/pacman/pkg/download-*/

A bug (issue #297) in makepkg is responsible for these stray directories.

Last edited by mpan (Yesterday 10:12:46)

Offline

#3 Yesterday 10:44:08

FernandoBasso
Member
From: Brazil
Registered: 2010-10-27
Posts: 118
Website

Re: [SOLVED] Error could not remove /var/cache/pacman/pkg/download-*

mpan wrote:

These directories may be safely removed:

$ sudo rm -r /var/cache/pacman/pkg/download-*/

A bug (issue #297) in makepkg is responsible for these stray directories.

Done. Thanks for the info and the link.


There is a difference between knowing the path and walking the path.

Offline

#4 Yesterday 16:41:23

dimich
Member
From: Kharkiv, Ukraine
Registered: 2009-11-03
Posts: 858

Re: [SOLVED] Error could not remove /var/cache/pacman/pkg/download-*

/etc/pacman.d/hooks/99-cache-cleanup.hook

[Trigger]
Type = Package
Operation = Install
Operation = Upgrade
Target = *

[Action]
Description = [workaround] Cleaning up empty download directories in cache...
When = PostTransaction
Exec = /usr/bin/find /var/cache/pacman/pkg/ -mindepth 1 -maxdepth 1 -type d -name 'download-*' -empty -print -delete

Offline

Board footer

Powered by FluxBB