Home Linux The Easy Way To Install And Remove A Package Group In Arch Linux

The Easy Way To Install And Remove A Package Group In Arch Linux

By sk
Published: Last Updated on 8.2K views

The other day I wanted to test Deepin DE in my Arch Linux. However, I already have installed some of the Deepin DE's components, such as Deepin screenshot and Deepin Terminal utilities. The problem is when I want to remove the Deepin DE after testing is complete, I'll have to manually tick off the parts which I want to keep in my Arch Linux. It is time consuming and quite annoying. I was looking for an easy and reliable way to install and remove a package group without affecting the existing packages. Thankfully, someone on Reddit has asked the same question and got the right solution. In this brief guide, we will see how to install a package group and uninstall it later without removing some of the packages that you already had before in Arch Linux and its variants.

The Easy Way To Install And Remove A Package Group In Arch Linux

First, create a list of packages that belongs to the package group you want to install by using the following command:

$ pacman -Sp deepin --print-format '%n' --needed > install.txt

The above command will add all packages belongs to the package group deepin in a file named "install.txt" in your current directory. Please note that It will simply add the package names in the file, not install them.

Next, install the package group as usual.

$ sudo pacman -S deepin

When you want to remove the package group, simply do:

$ sudo pacman -R - < install.txt

The above command will only remove the packages mentioned in the install.txt file.

For more details, refer Pacman man pages.

$ man pacman

Suggested read:


Thanks for stopping by!

Help us to help you:

Have a Good day!!

You May Also Like

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. By using this site, we will assume that you're OK with it. Accept Read More