Remove applications
You can remove an app or container from a Pantavisor-enabled device using the pvr command-line interface (CLI). The process involves cloning the device’s current state, removing the app’s directory locally, and then posting the new revision back to the device.
Step 1: Clone the Device State
First, if you haven’t already, clone the device’s configuration to your local machine. This creates a directory that mirrors the device’s software components.
Run the pvr clone command, replacing <device-ip> with your device’s address and my-device with your preferred local directory name.
pvr clone <device-ip> my-deviceNavigate into the newly created directory:
cd my-deviceInside, you will find a file structure representing your device’s components, which should look similar to this:
.
├── bsp/
├── _config/
├── device.json
├── os/
├── pvr-sdk/
├── pvwificonnect/
└── _sigs/Step 2: Remove the App’s Directory
To remove an app, simply use pvr app utility. For this example, we’ll remove the pvwificonnect app.
pvr app rm pvwificonnect
This action tells Pantavisor that this component should no longer be part of the device’s state.
Step 3: Commit and Post the New Revision
Next, you need to stage and commit this change. This process is similar to using Git.
- Stage the change (the deletion of the directory):
pvr add .- Commit the change with a descriptive message:
pvr commit -m "Removed the pvwificonnect app"- Finally, post the new revision to the device. This uploads your local changes and instructs the device to update itself.
pvr postStep 4: Finalizing the Update
After you run pvr post, the Pantavisor agent on the device will download and apply the new revision. It will stop and remove the container you deleted. Once the update is successfully applied, the device will reboot with the new configuration, and the app will be gone.