Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set the number of historical packages to be retained? #2529

Open
witt-bit opened this issue Nov 9, 2024 · 2 comments
Open

How to set the number of historical packages to be retained? #2529

witt-bit opened this issue Nov 9, 2024 · 2 comments

Comments

@witt-bit
Copy link

witt-bit commented Nov 9, 2024

Affected Version

yay -V
yay v12.4.2 - libalpm v15.0.0

Describe the bug

My computer has a small disk space, and the ~/.cache/yay directory is always full. I have to manually delete some previously downloaded source packages frequently. I hope there is a configuration item in ~/.config/yay/config.json that can configure the number of historical packages to be retained. The yay command can help me delete the source packages that have been built or downloaded before.

yay -Pg

{
	"aururl": "https://aur.archlinux.org",
	"aurrpcurl": "https://aur.archlinux.org/rpc?",
	"buildDir": "/home/witt/.cache/yay",
	"editor": "vim",
	"editorflags": "",
	"makepkgbin": "makepkg",
	"makepkgconf": "",
	"pacmanbin": "pacman",
	"pacmanconf": "/etc/pacman.conf",
	"redownload": "no",
	"answerclean": "",
	"answerdiff": "",
	"answeredit": "",
	"answerupgrade": "",
	"gitbin": "git",
	"gpgbin": "gpg",
	"gpgflags": "",
	"mflags": "",
	"sortby": "votes",
	"searchby": "name-desc",
	"gitflags": "",
	"removemake": "ask",
	"sudobin": "sudo",
	"sudoflags": "",
	"version": "12.4.2",
	"requestsplitn": 150,
	"completionrefreshtime": 7,
	"maxconcurrentdownloads": 5,
	"bottomup": true,
	"sudoloop": true,
	"timeupdate": false,
	"devel": false,
	"cleanAfter": false,
	"keepSrc": false,
	"provides": true,
	"pgpfetch": true,
	"cleanmenu": true,
	"diffmenu": true,
	"editmenu": false,
	"combinedupgrade": true,
	"useask": false,
	"batchinstall": false,
	"singlelineresults": false,
	"separatesources": true,
	"debug": false,
	"rpc": true,
	"doubleconfirm": true,
	"rebuild": "no"
}
@jdholtz
Copy link
Contributor

jdholtz commented Nov 11, 2024

There's no configuration option AFAIK. There has been discussion in some other issues though. From those discussions, I found a couple of external programs that may help solve your issue:
https://github.com/aokellermann/yaycache
https://herbort.me/posts/automatically-cleaning-pacman-and-yay-cache-in-arch-linux/

@witt-bit
Copy link
Author

witt-bit commented Nov 12, 2024

There's no configuration option AFAIK. There has been discussion in some other issues though. From those discussions, I found a couple of external programs that may help solve your issue:AFAIK 没有配置选项。不过,还对其他一些问题进行了讨论。从这些讨论中,我发现了一些可能有助于解决您的问题的外部程序: https://github.com/aokellermann/yaycache https://herbort.me/posts/automatically-cleaning-pacman-and-yay-cache-in-arch-linux/

Thank you very much for your patience. yaycache can completely solve my problem. I can currently complete it by configuring yaycache-hook, but I think this should be the default choice for yay to avoid a very large ~/.cache/yay directory. Most users, as light users, may not investigate so deeply. Using yaycache as a dependency by default is beneficial to the promotion of archLinux/manjaro systems and makes it easier for more people to use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants