Uninstalling a Linux Package Installed via a .deb File

When you install an application on Linux using a .deb file and later need to uninstall it without the .deb file, the process can be a bit tricky. Here’s a comprehensive guide based on our experience to help you through the uninstallation process.

Steps to Uninstall the Application

  1. List Installed Packages: Start by listing all installed packages to locate the one you need to remove.
    dpkg --list
  2. Search for the Package: If you know part of the app’s name, use the grep command to narrow down the list.
    dpkg --list | grep [app_name]
  3. Uninstall the Package: Once you identify the package name, you can remove it using the following command:
    sudo apt remove [package_name]
    To remove configuration files as well, use:
    sudo apt purge [package_name]
  4. Remove Unused Dependencies: Optionally, you can clean up any unnecessary dependencies.
    sudo apt autoremove

Troubleshooting

  1. Using Synaptic Package Manager: If the package name search doesn't yield results, you can use a graphical package manager like Synaptic.
    sudo apt install synaptic
    sudo synaptic
    Search for the application in Synaptic and uninstall it from there.
  2. Checking Desktop Entries: Sometimes the package name might not be obvious. You can check for .desktop files in the applications directories.
    grep -i "[app_name]" /usr/share/applications/*.desktop
    grep -i "[app_name]" ~/.local/share/applications/*.desktop
  3. Finding Executable Files: You can also search for the executable files directly.
    sudo find / -iname "*[app_name]*"
  4. Searching User Directory: If you have permission issues or want to search only within your home directory, you can use:
    find ~/ -name "*[app_name]*"

When the App is a Windows Application

If after all these steps you realize that the app was actually a Windows application mistakenly thought to be a .deb file, here’s how to proceed:

  1. Using Wine Uninstaller: Open Wine’s uninstaller to remove the application.
    wine uninstaller
    This opens a GUI similar to Windows' Add/Remove Programs. Find the application and remove it from there.
  2. Manual Removal:
    • Navigate to the Wine Directory:
      cd ~/.wine/drive_c/Program\ Files/ (or Program Files (x86) for 32-bit applications)
    • Delete the Application Folder:
      rm -rf "[app_name]"
  3. Clean Up Registry Entries: Optionally, remove any registry entries related to the app.
    nano ~/.wine/system.reg
    Search for entries related to the app and delete them.

Example: Uninstalling "FULLSTACK"

Let's use an app named "FULLSTACK" as our example and apply it to each step.

Steps to Uninstall "FULLSTACK"

  1. List Installed Packages: Start by listing all installed packages to locate "FULLSTACK".
    dpkg --list
  2. Search for the Package: Use the grep command to narrow down the list.
    dpkg --list | grep fullstack
  3. Uninstall the Package: Once you identify the package name, you can remove it using:
    sudo apt remove fullstack
    To remove configuration files as well, use:
    sudo apt purge fullstack
  4. Remove Unused Dependencies: Optionally, you can clean up any unnecessary dependencies.
    sudo apt autoremove

Troubleshooting for "FULLSTACK"

  1. Using Synaptic Package Manager: If the package name search doesn't yield results, use Synaptic.
    sudo apt install synaptic
    sudo synaptic
    Search for "FULLSTACK" in Synaptic and uninstall it from there.
  2. Checking Desktop Entries: Check for .desktop files in the applications directories.
    grep -i "fullstack" /usr/share/applications/*.desktop
    grep -i "fullstack" ~/.local/share/applications/*.desktop
  3. Finding Executable Files: Search for the executable files directly.
    sudo find / -iname "*fullstack*"
  4. Searching User Directory: If you have permission issues or want to search only within your home directory:
    find ~/ -name "*fullstack*"

When "FULLSTACK" is a Windows Application

If "FULLSTACK" is actually a Windows application:

  1. Using Wine Uninstaller: Open Wine’s uninstaller to remove "FULLSTACK".
    wine uninstaller
  2. Manual Removal:
    • Navigate to the Wine Directory:
      cd ~/.wine/drive_c/Program\ Files/ (or Program Files (x86) for 32-bit applications)
    • Delete the Application Folder:
      rm -rf "FULLSTACK"
  3. Clean Up Registry Entries: Optionally, remove any registry entries related to "FULLSTACK".
    nano ~/.wine/system.reg
    Search for entries related to "FULLSTACK" and delete them.

Removing Lingering Icons from the App Panel

If you have uninstalled an application but its icon is still visible in the app panel, follow these steps to remove any leftover .desktop files and clear the system cache to get rid of the lingering icon.

Remove .desktop Files

  1. Open Terminal: Press Ctrl+Alt+T.
  2. Search for .desktop Files: Run the following command to search for .desktop files related to the app:
    sudo find / -name "*fullstack*.desktop"
  3. Delete the .desktop File: Once you find the .desktop file, delete it. For example:
    sudo rm /usr/share/applications/fullstack.desktop
    sudo rm ~/.local/share/applications/fullstack.desktop

Clear System Cache

  1. Clear Icon Cache: Run the following command to clear the system icon cache:
    sudo gtk-update-icon-cache /usr/share/icons/hicolor
  2. Reboot System: Restart your computer to ensure all changes take effect:
    sudo reboot

Finally ! The File Manager Sudo Approach to delete app icons

If you've uninstalled an application in Ubuntu but still see its icon lingering in your app tray, here's a handy file explorer approach to clean it up using the Nautilus file manager:

  1. Open a terminal and type:
    sudo nautilus
    This will open the file manager with root permissions.
  2. Navigate to the filesystem root folder.
  3. Search for the uninstalled app's name, package name, or identifier (eg. FULLSTACK) . This might take a few minutes.
  4. Once you locate the relevant files, you should find:
    • .menu
    • .Ink
    • .desktop files
  5. Delete these files to remove the unwanted icons.

Hurray! Now your app tray is clutter-free.

Conclusion

Uninstalling a Linux package installed via a .deb file can sometimes be challenging, especially when you no longer have the .deb file. This guide has provided a comprehensive set of steps and troubleshooting methods to help you remove such applications effectively. From listing and searching installed packages to using graphical tools like Synaptic, and even dealing with mistaken Windows applications, we’ve covered a wide range of scenarios.

Using the example of "FULLSTACK," we demonstrated how to apply these methods in practice, ensuring that you have the tools and knowledge needed to tackle similar issues in the future. Additionally, we provided steps to remove lingering icons from the app panel, ensuring a thorough clean-up of any residual files.

We hope this guide has been helpful. If you have any further questions or need more assistance, feel free to reach out. Remember, the world of Linux offers a lot of flexibility and control, and with the right approach, you can manage your system efficiently.

0 Comment

Leave a Reply

Your email address will not be published. Required fields are marked *


You may like to read


Follow Us

Sponsored Ads

GranNino Ads

Newsletter

Subscribe to our Newsletter to read our latest posts at first

We would not spam your inbox! Promise
Get In Touch

© Fullstack Coding Tips. All Rights Reserved.