How to remove packages?

QuestionsQuestions8 SkillsProYour First Linux LabAug, 28 2025
0131

To remove packages on a Debian-based Linux system (like Ubuntu), you can use the apt package manager. Here are the steps:

Step 1: Remove a Package

To remove a package while keeping its configuration files, use:

sudo apt remove package-name

Replace package-name with the name of the package you want to remove.

Example:

To remove the curl package, you would run:

sudo apt remove curl

Step 2: Complete Removal (Optional)

If you want to completely remove a package along with its configuration files, use:

sudo apt purge package-name

Step 3: Clean Up Unnecessary Packages

After removing packages, it's good practice to clean up any unused dependencies:

sudo apt autoremove

Verify Removal

To confirm that the package has been removed, you can try running it. If it’s successfully removed, you should see a message indicating that the command is not found.

If you have any more questions or need further assistance, feel free to ask!

0 Comments

no data
Be the first to share your comment!