pkgs: Fix package file delete wrong manipulation bug