Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»General Articles»How to List Manually Installed Packages in Ubuntu & Debian

    How to List Manually Installed Packages in Ubuntu & Debian

    By RahulMarch 28, 20233 Mins Read

    Keeping track of the packages you have manually installed on your Ubuntu system is essential for managing your software and maintaining a clean system. This article will guide you through the process of listing manually installed packages in Ubuntu using various command-line tools, such as apt, dpkg, and apt-mark. Additionally, we will demonstrate how to remove unwanted packages to declutter your system.

    Advertisement

    Table of Contents:

    1. Overview of Package Management in Ubuntu
    2. Using apt to List Manually Installed Packages
    3. Using dpkg and apt-mark to List Manually Installed Packages
    4. Removing Unwanted Packages
    5. Conclusion

    Overview of Package Management

    Package management in Ubuntu is primarily handled by the Advanced Package Tool (APT) and its associated command-line utilities, such as apt, apt-get, and apt-cache. These tools interact with the Debian Package (.deb) files and repositories to install, update, and remove packages on your system. Another important tool is dpkg, which deals with individual package files and can also be used to query package information.

    Using apt to List Manually Installed Packages:

    One simple way to list manually installed packages is to use the apt command. Run the following command in your terminal:

    apt list --manual-installed 
    

    This command will display a list of packages that have been installed manually, excluding those installed as dependencies or part of the base system. Keep in mind that this list might include packages that were installed during the initial system setup or as part of a meta-package.

    Using dpkg and apt-mark to List Manually Installed Packages:

    For a more refined list of manually installed packages, you can use a combination of dpkg and apt-mark commands. First, create a list of all installed packages on your system using dpkg:

    dpkg-query -W -f='${Status} ${Package}\n' | grep "install ok installed" | awk '{print $4}' > installed_packages.txt 
    

    This command will create a file called “installed_packages.txt”, which contains the names of all installed packages on your system.

    Next, use the apt-mark command to create a list of automatically installed packages:

    apt-mark showauto > auto_installed_packages.txt 
    

    This command will create a file called “auto_installed_packages.txt” containing the names of all automatically installed packages on your system.

    Now, to find the difference between the two lists and obtain the list of manually installed packages, use the following command:

    comm -23 installed_packages.txt auto_installed_packages.txt > manually_installed_packages.txt 
    

    This command will create a file called “manually_installed_packages.txt” containing the names of all manually installed packages on your system. You can view the list using a text editor or by running:

    cat manually_installed_packages.txt 
    

    Removing Unwanted Packages:

    If you discover any unwanted packages in the list of manually installed packages, you can remove them using the apt command. To remove a package, run the following command:

    sudo apt remove package_name 
    

    Replace package_name with the name of the package you wish to remove. This command will uninstall the package and its unused dependencies. To remove the package along with its configuration files, use thepurge` option:

    sudo apt purge package_name 
    

    After removing unwanted packages, it is a good idea to clean up any residual package files using the autoremove and clean commands:

    sudo apt autoremove 
    sudo apt clean 
    

    These commands will remove any unused dependencies and clear the package cache, freeing up disk space.

    Conclusion

    In this article, we discussed how to list manually installed packages in Ubuntu using various command-line tools, such as apt, dpkg, and apt-mark. We also demonstrated how to remove unwanted packages to maintain a clean system. Regularly monitoring your manually installed packages allows you to keep track of the software installed on your system, prevent potential conflicts, and optimize system performance.

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    How To Block Specific Keywords Using Squid Proxy Server

    How To Block Specific Domains Using Squid Proxy Server

    A Comprehensive Look at the Simple Mail Transfer Protocol (SMTP)

    Add A Comment

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Setting Up Angular on Ubuntu: Step-by-Step Guide
    • Converting UTC Date and Time to Local Time in Linux
    • Git Restore: Functionality and Practical Examples
    • Git Switch: Functionality and Practical Examples
    • Git Switch vs. Checkout: A Detailed Comparison with Examples
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.