Deb updating an existing package causes not found error when trying to remove? #27

Closed
opened 2026-01-29 16:27:35 +00:00 by claunia · 3 comments
Owner

Originally created by @danielmoncada on GitHub (May 3, 2018).

When updating an existing deb package on Ubuntu 16.04 server LTS, the following error is shown:

(Reading database ... 58911 files and directories currently installed.)
Preparing to unpack test.0.0.1.linux-x64.deb ...
Unpacking test (0.0.1) over (0.0.1) ...
/var/lib/dpkg/info/test.postrm: 2: /var/lib/dpkg/info/test.postrm: /usr/bin/rm: not found
/var/lib/dpkg/info/test.postrm: 3: /var/lib/dpkg/info/test.postrm: /usr/bin/rm: not found

Looks like it might be a PATH issue? Note that rm is indeed available in /usr/bin/rm.

Update: Appears this happens only when RemoveOnUninstall is set.

Originally created by @danielmoncada on GitHub (May 3, 2018). When updating an existing deb package on Ubuntu 16.04 server LTS, the following error is shown: ``` (Reading database ... 58911 files and directories currently installed.) Preparing to unpack test.0.0.1.linux-x64.deb ... Unpacking test (0.0.1) over (0.0.1) ... /var/lib/dpkg/info/test.postrm: 2: /var/lib/dpkg/info/test.postrm: /usr/bin/rm: not found /var/lib/dpkg/info/test.postrm: 3: /var/lib/dpkg/info/test.postrm: /usr/bin/rm: not found ``` Looks like it might be a PATH issue? Note that rm is indeed available in /usr/bin/rm. Update: Appears this happens only when **RemoveOnUninstall** is set.
Author
Owner

@qmfrederik commented on GitHub (May 4, 2018):

That's odd... The call to /usr/bin/rm is added in DebPackageCreator.cs, can you try using /bin/rm instead of /usr/bin/rm?

@qmfrederik commented on GitHub (May 4, 2018): That's odd... The call to `/usr/bin/rm` is added in [DebPackageCreator.cs](https://github.com/qmfrederik/dotnet-packaging/blob/9e56efbf325dacf9e83d9fbfe5b27d31c3928dca/Packaging.Targets/Deb/DebPackageCreator.cs#L90), can you try using `/bin/rm` instead of `/usr/bin/rm`?
Author
Owner

@danielmoncada commented on GitHub (May 4, 2018):

@qmfrederik how can I allow the deb creator to use /bin/rm instead?

Note that "rm" works perfectly outside of the Deb package.

@danielmoncada commented on GitHub (May 4, 2018): @qmfrederik how can I allow the deb creator to use `/bin/rm` instead? Note that "`rm`" works perfectly outside of the Deb package.
Author
Owner

@Odirb commented on GitHub (May 16, 2018):

I had the same problem : /usr/bin/rm exists on CentOS but not on Ubuntu. Is it possible to replace the command with /bin/rm or maybe just rm in a future release?

@Odirb commented on GitHub (May 16, 2018): I had the same problem : /usr/bin/rm exists on CentOS but not on Ubuntu. Is it possible to replace the command with /bin/rm or maybe just rm in a future release?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/dotnet-packaging#27