This repository contains a PowerShell script to completely uninstall Podman from a Windows machine, including cleaning up related configurations and WSL instances. After running this script, you can reinitialize Podman using podman machine init.
- Unregisters the
podman-machine-defaultinstance from WSL. - Deletes residual configuration files and folders associated with Podman.
- Prepares the system for a clean reinstallation of Podman.
- Windows operating system.
- PowerShell (Administrator privileges required).
- WSL (Windows Subsystem for Linux).
-
Clone this repository to your local machine:
git clone https://github.com/<your-username>/podman-uninstall-script.git cd podman-uninstall-script
-
Open PowerShell as an Administrator.
-
Run the script:
.\UninstallPodman.ps1
-
Lists all WSL distributions to verify the existence of the
podman-machine-default. -
Unregisters
podman-machine-defaultfrom WSL. -
Deletes the following directories and file from your home folder:
C:\Users\<YourUsername>\.local\share\containers\podman\machine\wslC:\Users\<YourUsername>\.config\containers\podman\machineC:\Users\<YourUsername>\AppData\Roaming\containersC:\Users\<YourUsername>\.ssh\podman-machine-default.pub
-
Verifies successful uninstallation and provides a message confirming readiness for reinitialization.
After running the script, you can reinitialize Podman by executing:
podman machine initContributions, bug reports, and feature requests are welcome! Please follow these steps:
- Fork the repository.
- Create a feature branch (
git checkout -b feature/your-feature). - Commit your changes (
git commit -m 'Add your feature'). - Push to the branch (
git push origin feature/your-feature). - Open a pull request.
This project is licensed under the MIT License.
This script is provided as-is and assumes that Podman is installed in a default configuration. Use at your own risk. Ensure you have backups of important data before running this script.