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

I have been using Arch Linux for more than two years, and I don’t want to switch to other Linux distribution anytime soon. Because, I love Pacman and AUR. Believe it or not, Pacman has a lot of handy features compared to other package managers to get things done easily. Say for example, 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 it, I’ll have to manually tick off the parts which I 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 derivatives like Antergos and Manjaro Linux. Read on.

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:


And, that’s all for now. Hope this was useful. More good stuffs to come. Stay tuned!

Cheers!

Thanks for stopping by!

Help us to help you:

Have a Good day!!

You may also like...

Leave a Reply

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

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