You are not logged in.

#1 2025-07-31 09:52:14

jebez
Banned
From: Alpes mountains, France
Registered: 2025-01-15
Posts: 204

Feature request: remove the created files & folders of a package

I googled "arch linux remove created files of package" I found https://bbs.archlinux.org/viewtopic.php?id=51080 , https://unix.stackexchange.com/question … it-created , the answer is: manually remove...

E.g. I installed Zaz https://archlinux.org/packages/extra/x86_64/zaz/ (this game hasn't vsync...)

sudo pacman -S zaz

then always (see https://bbs.archlinux.org/viewtopic.php?id=304828)

sudo pacman -Scc<<<y

I played 2 levels, then uninstall

sudo pacman -Rs zaz

But:

[a@archlinux ~]$ sudo find / -iname *zaz*
find: ‘/run/user/1000/doc’: Permission denied
/usr/share/swcatalog/icons/archlinux-arch-extra/64x64/zaz_zaz.png
/home/a/.local/share/Steam/steamapps/common/Half-Life/valve_downloads/sound/syowa_japan/zazabeat.wav
/home/a/.zaz
[a@archlinux ~]$ ls /home/a/.zaz
a.profile  hiscores  settings

So the idea:
1. Establish the good practice a software package, e.g. Zaz, lists in a log file, e.g. /var/log/pacman-created.log or /var/log/pacman-created/zaz.log, its created files & folders during use, or at least a list of the potential created files & folders at install.
2. A new agrument of pacman, e.g. -f, to remove the created files & folders.

So e.g.

sudo pacman -Rsf zaz
sudo find / -iname *zaz*

nothing about Zaz.

In fact I want: the software created files & folders must be removed, even if a user created file or folder is in a software created folder, so back up your savegames, screenshots...

I'm surprised to be the 1st to propose this...

EDIT
Well I'm still noob, no need pacman:

So the idea:
1. Establish the good practice a software package, e.g. Zaz, lists in a log file, e.g. /var/log/zaz.log or /var/log/softwares.log, its created files & folders during use, or at least a list of the potential created files & folders at install.
E.g. in /var/log/zaz.log

/home/a/.config/zaz
/home/a/zaz.txt
/var/lib/zaz

2. If you wanna remove these files & folders then the log e.g.:

sudo xargs -a /var/log/zaz.log rm -r
sudo rm /var/log/zaz.log

Last edited by jebez (2025-08-01 06:40:19)

Offline

#2 2025-07-31 10:13:23

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,565

Re: Feature request: remove the created files & folders of a package

Feature Requests for pacman need to be submitted upstream at https://gitlab.archlinux.org/pacman/pacman/-/issues

Packages are forbidden to touch user folders, so anything under $HOME will never be removed by pacman.

The only file in your output that is under pacman control is /usr/share/swcatalog/icons/archlinux-arch-extra/64x64/zaz_zaz.png

However

$ pacman -F zaz_zaz.png
extra/archlinux-appstream-data 20250730-1
    usr/share/swcatalog/icons/archlinux-arch-extra/64x64/zaz_zaz.png
[panoramix@silverbolt ~]$ 

That file belongs to extra/archlinux-appstream-data package not to zaz.

For managing user dotfiles look at https://wiki.archlinux.org/title/Dotfiles


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#3 2025-07-31 10:40:13

jebez
Banned
From: Alpes mountains, France
Registered: 2025-01-15
Posts: 204

Re: Feature request: remove the created files & folders of a package

Lone_Wolf wrote:

Packages are forbidden to touch user folders, so anything under $HOME will never be removed by pacman.

Why? Why not?

Zaz is an example, also EDuke32 https://aur.archlinux.org/packages/eduke32 there's /home/a/.config/eduke32/

[a@archlinux ~]$ ls /home/a/.config/eduke32
duke3d.grp   eduke32.log     save0000.esv  texturecache
eduke32.cfg  grpfiles.cache  settings.cfg  texturecache.index

, not necessarily a dot folder...

I'll try https://gitlab.archlinux.org/pacman/pacman/-/issues (off topic but why gitlab? Not github?).

Offline

#4 2025-07-31 10:42:26

SimonJ
Member
From: Alicante, Spain
Registered: 2021-05-11
Posts: 293
Website

Re: Feature request: remove the created files & folders of a package

The first thing that comes to mind is if I change from package to package-git I do not want package removing all my settings. I am quite capable of checking now and then for old config files and deciding myself.


Rlu: 222126

Offline

#5 2025-07-31 11:16:56

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,619
Website

Re: Feature request: remove the created files & folders of a package

jebez wrote:
Lone_Wolf wrote:

Packages are forbidden to touch user folders, so anything under $HOME will never be removed by pacman.

Why? Why not?

Zaz is an example, also EDuke32 https://aur.archlinux.org/packages/eduke32 there's /home/a/.config/eduke32/

[a@archlinux ~]$ ls /home/a/.config/eduke32
duke3d.grp   eduke32.log     save0000.esv  texturecache
eduke32.cfg  grpfiles.cache  settings.cfg  texturecache.index

, not necessarily a dot folder...

I'll try https://gitlab.archlinux.org/pacman/pacman/-/issues (off topic but why gitlab? Not github?).


No point opening a bug report - I will just immediately close it.   Pacman manages system files, and not files under a users home directory.

Offline

#6 2025-07-31 14:13:12

jebez
Banned
From: Alpes mountains, France
Registered: 2025-01-15
Posts: 204

Re: Feature request: remove the created files & folders of a package

Allan why? https://ko-fi.com/allanmcrae yes if you change your mind...

If no well an other software than pacman, there's that stupid distinction between repo & AUR https://bbs.archlinux.org/viewtopic.php … 6#p2227926 so I use paru, why not

rmcreated zaz

or something... Any developer?

An other example is Waydroid https://aur.archlinux.org/packages/waydroid , it downloaded a huge LineageOS .img, created a lot of files & folders, to completely uninstall Waydroid I asked ChatGPT:

sudo find / -iname *waydroid*

, checked everything is fine then

sudo find / -iname *waydroid* -exec rm -rf {} +

...

Last edited by jebez (2025-08-09 16:48:17)

Offline

#7 2025-07-31 14:47:52

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 24,960

Re: Feature request: remove the created files & folders of a package

This is a gargantuan task that will have lots of false positives and is more than likely going to screw you over at some point.

You'd have to manually maintain a list of every file a program creates by reading the source code, keep that up to date, somehow try to make a distinction between "this is program generated and can go" and "maybe the user actually created that file". Or alternatively as your original proposal goes, try to bring up a standard that every software ever gets adjusted to so you have a list of files you can remove, but you'd have to come up with something sane (and ideally not limited to just pacman) that everyone agrees on and propose that to every single upstream project that has ever existed, which is simply unfeasable.

If you spin this proposal to the extreme, should every document you ever created in a text editor/libreoffice be removed when you pass the "created files and folders" deletion flag? No? But you wanted "created by program". Where do we put the limit? .config? .cache? What if a a tool doesn't honor these? What if a user redefines XDG_DATA_DIRS lor similar, should we follow that? No? Why not? Yes, why?

This isn't at all a trivial problem to solve programatically, but it's comparatively easy for you to figure out which things you don't need and removing them.

Last edited by V1del (2025-07-31 14:52:50)

Offline

#8 2025-07-31 15:16:16

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 71,584

Re: Feature request: remove the created files & folders of a package

creates by reading the source code

That's not gonna cut it, a lot of them will be dynamic, so you actually need to *know* the source code.
It's be easier to audit writing filesystem access and maintain a whitelist of text editors- except for the massive audit lists…

Periodically

find  ~/.{config,local,cache} -atime '+30'

to get an idea what files haven't been accessed in a month or so.
You'll still have to manually review that and it won't work if you mount noatime (relatime should™ be fine since it's supposed to be updated once a day - no guarantee)

Offline

#9 2025-07-31 16:01:22

jebez
Banned
From: Alpes mountains, France
Registered: 2025-01-15
Posts: 204

Re: Feature request: remove the created files & folders of a package

Well on Window$ I not remember the video game (I rarely use that "OS" now , thanks Arch Linux) if I uninstall it (like uninstall.exe), there's "Do you want to remove the config, the savegames" or something, why not on Arch Linux also?

About the distinction between user or software created files & folders:
The software created files & folders are if you use the software without creating anything (e.g. play Zaz)
The user created files & folders are if you create something with the software (e.g. there aren't but a built-in screenshot, a savegame, a level editor in Zaz).

Also my created files & folders are in a data partition, separate to the OS partition.

In fact I want: the software created files & folders must be removed, even if a user created file or folder is in a software created folder, so back up your savegames, screenshots...

Last edited by jebez (2025-07-31 16:32:29)

Offline

#10 2025-07-31 16:09:36

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,354

Re: Feature request: remove the created files & folders of a package

jebez wrote:

In fact I want: the software created files & folders must be removed, even if a user created file or folder is in a software created folder, so back up your savegames, screenshots...

You can 'want' whatever, the simple fact is that you have absolutely NO CLUE of the complexity of what you're asking for, no idea how it could be implemented, and no ability to do the actual work. When the people that actually understand these things and have the ability tell you it's not happening, maybe listen to them.

The alternative is to do it yourself. If you think this is so important, start learning how to actually do it.

Last edited by Scimmia (2025-07-31 16:13:02)

Offline

#11 2025-07-31 16:24:28

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 24,960

Re: Feature request: remove the created files & folders of a package

The uninstall exe is provided by the application developer for that specific application and thus has the relevant context (... and many of them will still not clear out runtime generated files, similar to Arch), Arch packages are built by a "third party" - the Arch packagers (... and those uninstallers will in many/most cases, not clear stuff in your "My files" or "My documents" folder which you can think of as similar to $HOME/.config and .cache, and did you look into windows hidden folders like AppRoot and so as well?)

Yes what you're describing makes of course sense in plain english, but from a software standpoint, a file is created by the program as your user -- whether you "saved as" or the program did so in the background is not distincted in any generic fashion.

We could of course just assume that we only need to look into .config, this would make this fundamentally simpler, but still not trivial, but yes in that case the easiest would be to do an auditing tool that writes the program and the relevantly corresponding file into some kind of database. You still can't really deal with the "outliers" that don't write there.

If you want to try this, here are some hints: https://wiki.archlinux.org/title/Audit_framework https://archlinux.org/packages/extra/x8 … ify-tools/

Last edited by V1del (2025-07-31 16:26:15)

Offline

#12 2025-07-31 16:30:18

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 71,584

Re: Feature request: remove the created files & folders of a package

Ftr, there's still another problem:
On windows you might or not have installed the game into a user path, for your user only
But packages are installed for *all* the users and even if you *want* some software to remove every runtime file it might or not have created - other users using the same system might have a completely different opinion on that.

Offline

#13 2025-08-01 06:42:57

jebez
Banned
From: Alpes mountains, France
Registered: 2025-01-15
Posts: 204

Re: Feature request: remove the created files & folders of a package

Well see my EDIT in my 1st post, just needs the developer of a software package lists in a log file its created files & folders.

Offline

#14 2025-08-01 06:54:48

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 71,584

Re: Feature request: remove the created files & folders of a package

Yes, I can easily establish world peace: just needs every other human to stop being assholes.

Mandatory video: https://www.youtube.com/watch?v=5RyYrs5tu60

Offline

#15 2025-08-01 13:17:40

jebez
Banned
From: Alpes mountains, France
Registered: 2025-01-15
Posts: 204

Re: Feature request: remove the created files & folders of a package

Offline

Board footer

Powered by FluxBB