Pacman installs by me vs by Manjaro


#1

Hi,

Doing a:

pacman -Q | sort |less

gives me a list of all the packages installed.

How do I get a list without the packages that were installed by Manjaro in the 1st install. Basically the packages I did a:

pacman -S ...

I want to create a second computer with the same software for my wife to use, but then she says:

It doesn’t work!

It’s because I’m missing X that I have on my computer.

Thanks

Syv


#2

man pacman
https://wiki.archlinux.org/index.php/Pacman/Tips_and_tricks

pacman -Qe


#3

That will return the packages installed by default, won’t it? Everything not marked as a dependency?


#4

OK FINE … use this:

echo "Desktop Environment? Possible: gnome kde xfce"; read DE; (comm -23 <(pacman -Qeq | sort) <( (curl https://gitlab.manjaro.org/profiles-and-settings/iso-profiles/raw/master/manjaro/$DE/Packages-Desktop && curl https://gitlab.manjaro.org/profiles-and-settings/iso-profiles/blob/master/shared/Packages-Desktop && curl https://gitlab.manjaro.org/profiles-and-settings/iso-profiles/blob/master/shared/Packages-Live && curl https://gitlab.manjaro.org/profiles-and-settings/iso-profiles/blob/master/shared/Packages-Live-Xorg && curl https://gitlab.manjaro.org/profiles-and-settings/iso-profiles/blob/master/shared/Packages-Mhwd && curl https://gitlab.manjaro.org/profiles-and-settings/iso-profiles/blob/master/shared/Packages-Root && curl https://gitlab.manjaro.org/profiles-and-settings/iso-profiles/blob/master/shared/Packages-Root-dbus-x11 && curl https://gitlab.manjaro.org/profiles-and-settings/iso-profiles/raw/master/manjaro/grub/Packages-Live && curl https://gitlab.manjaro.org/profiles-and-settings/iso-profiles/raw/master/manjaro/grub/Packages-Root && curl https://gitlab.manjaro.org/profiles-and-settings/iso-profiles/raw/master/manjaro/architect/Packages-Live && pacman -Sqg base base-devel) | sort)) > MyPackageList.txt && echo "Your personalized package list is now at '~/MyPackageList.txt'"

whipped up special, just for you. One long ugly line.
[I tried really hard not to make it a script :bowing_man: ]


Save all settings / restore all settings
#5

Nice - :1st_place_medal: - that must have been hard - not making a script of it - so many options :laughing:


#6

I looked around and:

pacman -Qm

kind of does it, but it doesn’t list everything that I installed manually. At least wine is missing from that list and it lists some packages that I have not installed manually like gksu.

Thanks

Syv


#7

That lists foreign packages so it really should’t be a list of packages you have installed yourself unless you install all your packages by manually pointing pacman at a package file.


#8

I think that’s what I want.

I first did the manjaro xfce install, then I added some packages with

pacman -S xxx

Or maybe I should ask:

What the difference between a foreign package and a manual install of pacman -S

Thanks

Syv


#9

A foreign package is one that was not installed via the repositories. The most common cause of this is AUR packages.


#10

The line I gave above should give everything (including in and outside of AUR) that you installed using a pkgbuild… but theres a typo in there or something because some of the mhwd/architect stuff is still showing.


#11

You can always grep /var/log/pacman.log:

To list packages installed after base system although may be removed by now, use this:

grep -Poe '\[ALPM\] installed \K\S*' /var/log/pacman.log

If you want only the packages that are still installed, pipe the previous command to:

pacman -Q >/tmp/pkgs; while read pkg; do if grep -e $pkg /tmp/pkgs >/dev/null; then echo $pkg; fi; done

#12

Won’t that include everything installed as dependencies?

I think tweaking @cscs solution above to meet your needs is probably the best option.

This would be a cool feature for pacui @excalibur1234 . “Backup package list of explicitly installed, non-system packages”


#13

What about community editions?

EDIT: I added them:

echo "Desktop Environment? Possible: gnome kde xfce awesome bspwm bspwm-mate budgie cinnamon deepin i3 kde-minimal lxde lxqt mate openbox webdad"; read DE; (comm -23 <(pacman -Qeq | sort) <( (curl https://gitlab.manjaro.org/profiles-and-settings/iso-profiles/raw/master/manjaro/$DE/Packages-Desktop && curl https://gitlab.manjaro.org/profiles-and-settings/iso-profiles/raw/master/community/$DE/Packages-Desktop && curl https://gitlab.manjaro.org/profiles-and-settings/iso-profiles/blob/master/shared/Packages-Desktop && curl https://gitlab.manjaro.org/profiles-and-settings/iso-profiles/blob/master/shared/Packages-Live && curl https://gitlab.manjaro.org/profiles-and-settings/iso-profiles/blob/master/shared/Packages-Live-Xorg && curl https://gitlab.manjaro.org/profiles-and-settings/iso-profiles/blob/master/shared/Packages-Mhwd && curl https://gitlab.manjaro.org/profiles-and-settings/iso-profiles/blob/master/shared/Packages-Root && curl https://gitlab.manjaro.org/profiles-and-settings/iso-profiles/blob/master/shared/Packages-Root-dbus-x11 && curl https://gitlab.manjaro.org/profiles-and-settings/iso-profiles/raw/master/manjaro/grub/Packages-Live && curl https://gitlab.manjaro.org/profiles-and-settings/iso-profiles/raw/master/manjaro/grub/Packages-Root && curl https://gitlab.manjaro.org/profiles-and-settings/iso-profiles/raw/master/manjaro/architect/Packages-Live && pacman -Sqg base base-devel) | sort)) > MyPackageList.txt && echo "Your personalized package list is now at '~/MyPackageList.txt'"

But…but… It would be so much easier to read that way. :sunglasses:


#14

Yeah but it was late and I was high and it just needed to be one line copy/paste. cough cough.

[ also your addition will not work as those reside in ../master/community/$DE/.. and main editions (as currently written) are at ..master/manjaro/$DE/.. ]

…and as I’m doing roughly the same thing now … sure why not make it a script…


#15

Actually…combining this with pacman -Qeq gets you fairly close I think

comm -12 <(grep -Poe '\[ALPM\] installed \K\S*' /var/log/pacman.log | sort | uniq) <(pacman -Qeq)

#16

Yes it will, it’s there. :wink:


#17

oic - doh.


#18

Thank you, exactly what I was looking for, now it’s something manageable that I can tweak easily.

Thanks

Syv


#19

this is less helpful than you might think.

basically all packages, which get installed during system installation are marked as “explicitly installed”. you can get a list of all of them with “pacman -Qqe”.

such a list would really be useful, if you want to backup your current system (which requires to backup your home folder and many files in /etc/, too) (attention: such a list also contains AUR packages).
such a backup utility would need to read the list again and install all packages in it (if those packages still exist in system repository or AUR). before doing that, a check for existing AUR helpers is required in order to install AUR packages (if such an AUR helper is not found, a good one should be installed).
in addition, you should not keep installing the same packages on your system for years, because packages might reach their end of life (and/or have security vulnerabilities) or there are better packages. dependencies of DEs or other system packages can change. you would need to maintain such a list of packages similar to maintaining a manjaro spin.

in summary, writing such a backup utility is possible (within the roams of manjaro - do not expect arch linux / AUR maintainers to accept such an utility!), but it is more work than you might think. i think it is easier to keep a backup of your home directory and reinstall your system from an ISO.


closed #20

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.