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
Archisman Panigrahi
  • 309
  • 1
  • 3
  • 15
  • 2
    You probably only need to show the first 5 lines or so... that’s a lot of scrolling. – SethMMorton May 19 '20 at 14:26
  • What is the command used to generate that list? – DK Bose Jun 12 '20 at 02: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 '20 at 04:43
  • @DKBose I don't know how the list was generated. I got the list from https://osdn.net/projects/manjaro-community/storage/cinnamon/20.0.1/manjaro-cinnamon-20.0.1-200511-linux56-pkgs.txt/ – Archisman Panigrahi Jun 12 '20 at 05:13
  • Hmmm. That's an interesting list. They've got `flatpak` and `kvantum` and `snapd` as well. – DK Bose Jun 12 '20 at 07:53
  • 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 https://askubuntu.com/questions/1233429/qt-apps-are-very-slow-to-load-in-xubuntu-20-04-when-export-qt-qpa-platformtheme) . However I don't see why flatpak and snaps are there in the default packages, as Manjaro is already a rolling release. – Archisman Panigrahi Jun 12 '20 at 09:24
  • Good point, I forgot about kvantum. I don't know how different Manjaro is from Arch, but on Arch, `pacman -Ss cinnamon` gives you a list to pick from. I guess if you install enough of those, you'll have a complete cinnamon. – DK Bose Jun 12 '20 at 09:47
  • @DKBose Thanks, I'll see – Archisman Panigrahi Jun 12 '20 at 11:17

2 Answers2

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.

Cestarian
  • 1,991
  • 5
  • 26
  • 45
  • What would the `cut -d` do? Will it remove the version numbers? – Archisman Panigrahi May 19 '20 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: https://unix.stackexchange.com/questions/103859/arch-linux-pacman-specifying-package-version in case you're wondering, it should not matter for your purposes. – Cestarian May 19 '20 at 14:55
  • @ArchismanPanigrahi yes it removes the version numbers. – Cestarian Mar 11 '23 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.

Cbhihe
  • 2,549
  • 2
  • 21
  • 30