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
- How To List Installed Packages That Belong To A Particular Group In Linux
- How To Find Installed Applications With Installed Size In Linux
- How To Remove Everything Except The Base System In Arch Linux
- Create A List Of Installed Packages And Install Them Later From The List In Arch Linux
- Create A List Of Installed Packages And Install Them Later From The List In CentOS And Ubuntu