2

I installed a minimal version of Manjaro Cinnamon edition, and now want to upgrade it to the full edition. The list of packages are available in this text file.

How to install them with Pacman without painfully typing the name of the hundreds of packages? I am attaching the first 5 lines of the file, for convenience.

a52dec 0.7.4-10
aalib 1.4rc5-13
accountsservice 0.6.55-2
acl 2.2.53-3
acpi 1.7-3
8
  • 2
    You probably only need to show the first 5 lines or so... that’s a lot of scrolling. May 19, 2020 at 14:26
  • What is the command used to generate that list?
    – DK Bose
    Jun 12, 2020 at 2:59
  • Reason I'm asking is that apparmor would be installed according to the list. I have KDE Plasma on Arch Linux (in a VM) without apparmor.
    – DK Bose
    Jun 12, 2020 at 4:43
  • @DKBose I don't know how the list was generated. I got the list from osdn.net/projects/manjaro-community/storage/cinnamon/20.0.1/… Jun 12, 2020 at 5:13
  • 1
    @DKBose Nowadays Kvantum is required to properly theme Qt apps in gtk based DEs because the default gtk theme in qt5ct has a major bug. (You answered this in askubuntu.com/questions/1233429/…) . However I don't see why flatpak and snaps are there in the default packages, as Manjaro is already a rolling release. Jun 12, 2020 at 9:24

2 Answers 2

5

I'm not on linux right now so I can't test it, but this should work...

pacman -S $(cat yourfilename | cut -d' ' -f1)

If that doesn't work, then this should

pacman -S $(echo $(cat yourfilename | cut -d' ' -f1))

The goal here is to give pacman the output of the file as one line, without the version numbering, and each line separated by a space.

3
  • What would the cut -d do? Will it remove the version numbers? May 19, 2020 at 14:53
  • @ArchismanPanigrahi yes, it has to, as far as I'm aware pacman does not accept version numbering as an argument, at least not such a simple one; and your question didn't ask for fetching the specific versions of the programs either. Edit: See here: unix.stackexchange.com/questions/103859/… in case you're wondering, it should not matter for your purposes.
    – Cestarian
    May 19, 2020 at 14:55
  • @ArchismanPanigrahi yes it removes the version numbers.
    – Cestarian
    Mar 11 at 10:26
3

Just do:

$ sudo sh -c 'cat input_file | cut "-d " -f1 |  xargs pacman -S'

or a simpler version:

$ awk '{print $1}'  input_file |  xargs pacman -S

or

$ sudo pacman -S $(awk '{print $1}'  input_file)

Where input_file contains all your packages to be installed, one to a line.

Word of caution:
As you undoubtedly know, Archlinux is a rolling release package, so specifying version to be installed is not recommended and means you could actually break dependencies and, ultimately, your system overall. For that reason alone I cut away the version info in your package records in input_file...

If you insists on a rolled back (i.e. "old") version of some package, you can roll back on Arch Linux, but I recommend you do that by hand, not in an automated way, only if you know exactly what you are getting into.

HTH.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .