You are not logged in.

#1 2023-11-22 14:39:43

andreaschar15
Member
Registered: 2023-11-22
Posts: 7

pacman -Qdtq lists A LOT OF PACKAGES

I have been running pacman -Qdtq every once in a while to clear out some packages I don't need. I am careful to remove only what I don't need. Ran this command today and got a list of basically every package I installed. I know it is not normal. Any idea how this happened and how can I fix this?

Offline

#2 2023-11-22 14:54:10

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,727

Re: pacman -Qdtq lists A LOT OF PACKAGES

What does "basically every package I installed" actually mean?

Offline

#3 2023-11-22 15:07:14

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: pacman -Qdtq lists A LOT OF PACKAGES

This can be fixed by identifying the packages that you explicitly want installed and using pacman -D --asexplicit.

Things like that happen, when you have rather complicated command chains with an --asdeps switch somewhere or if you uninstall a meta-package without uninstalling what's behind.

Scimmia wrote:

What does "basically every package I installed" actually mean?

More specifically, give us numbers:
pacman -Qq | wc -l
pacman -Qqdt | wc -l

Depending on how much that is, consider posting the whole -Qqdt list (use code tags) and any non-standard repositories, if there are any.

Offline

#4 2023-11-22 15:10:07

andreaschar15
Member
Registered: 2023-11-22
Posts: 7

Re: pacman -Qdtq lists A LOT OF PACKAGES

Scimmia wrote:

What does "basically every package I installed" actually mean?

Every package that I explicitly installed

Offline

#5 2023-11-22 15:13:35

andreaschar15
Member
Registered: 2023-11-22
Posts: 7

Re: pacman -Qdtq lists A LOT OF PACKAGES

Awebb wrote:

This can be fixed by identifying the packages that you explicitly want installed and using pacman -D --asexplicit.

Things like that happen, when you have rather complicated command chains with an --asdeps switch somewhere or if you uninstall a meta-package without uninstalling what's behind.

Scimmia wrote:

What does "basically every package I installed" actually mean?

More specifically, give us numbers:
pacman -Qq | wc -l
pacman -Qqdt | wc -l

Depending on how much that is, consider posting the whole -Qqdt list (use code tags) and any non-standard repositories, if there are any.


pacman -Qq | wc : 914

pacman -Qqdt | wc -l : 73

I don't think it's a great idea to post 73 packages  smile

Offline

#6 2023-11-22 15:42:36

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: pacman -Qdtq lists A LOT OF PACKAGES

If you want us to help get to the roor cause, post them in code tags. People have been writing posts with way more than 73 words consisting of nothing but nonsense, so the board will hold your useful data just fine.

Offline

#7 2023-11-22 15:45:44

andreaschar15
Member
Registered: 2023-11-22
Posts: 7

Re: pacman -Qdtq lists A LOT OF PACKAGES

Awebb wrote:

If you want us to help get to the roor cause, post them in code tags. People have been writing posts with way more than 73 words consisting of nothing but nonsense, so the board will hold your useful data just fine.

 [ac@atom ~]$ pacman -Qdtq
alacritty
amd-ucode
amdgpu_top
arandr
baobab
base
base-devel
bind
blueman
bluez-utils
chromium
clamav
cmatrix
cowsay
discord
firefox
flatpak
freetube-bin
gdm
glycin
gnome-backgrounds
gnome-browser-connector
gnome-calculator
gnome-clocks
gnome-connections
gnome-console
gnome-font-viewer
gnome-logs
gnome-shell-extension-pop-shell
gnome-system-monitor
gnome-tweaks
gnome-user-docs
gparted
grub
htop
hugo
i3blocks
kdeconnect
librsync
linux-lts
linux-zen
lxappearance
mesa-utils
mpv
nano
nautilus
neofetch
neovim
networkmanager-openconnect
obsidian
pavucontrol
picom
powertop
qbittorrent
qemu-base
reflector
simple-scan
sof-firmware
spotify-launcher
sushi
swaybg
thunar
tlp
variety
vi
vim
virt-manager
vscodium
wlroots
xdg-user-dirs-gtk
yay
zip
zram-generator

Offline

#8 2023-11-22 15:49:25

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,727

Re: pacman -Qdtq lists A LOT OF PACKAGES

hmm, that is a problem. What does pacman -Qi base show? We might need to see the pacman log.

Offline

#9 2023-11-22 18:40:40

andreaschar15
Member
Registered: 2023-11-22
Posts: 7

Re: pacman -Qdtq lists A LOT OF PACKAGES

ac@atom ~]$ pacman -Qi base
Name            : base
Version         : 3-2
Description     : Minimal package set to define a basic Arch Linux installation
Architecture    : any
URL             : https://www.archlinux.org
Licenses        : GPL
Groups          : None
Provides        : None
Depends On      : filesystem  gcc-libs  glibc  bash  coreutils  file  findutils  gawk  grep
                  procps-ng  sed  tar  gettext  pciutils  psmisc  shadow  util-linux  bzip2  gzip
                  xz  licenses  pacman  archlinux-keyring  systemd  systemd-sysvcompat  iputils
                  iproute2
Optional Deps   : linux: bare metal support [installed]
Required By     : None
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 0.00 B
Packager        : Jan Alexander Steffens (heftig) <heftig@archlinux.org>
Build Date      : Sun 08 Oct 2023 04:15:41 AM EEST
Install Date    : Thu 02 Nov 2023 01:24:33 PM EET
Install Reason  : Installed as a dependency for another package
Install Script  : No
Validated By    : Signature

Offline

#10 2023-11-22 18:48:25

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,727

Re: pacman -Qdtq lists A LOT OF PACKAGES

That all looks fine, except it being installed as a dependency. We'll definitely need to see the pacman log.

Offline

#11 2024-02-01 07:44:35

mountaintrek
Member
Registered: 2024-02-01
Posts: 60

Re: pacman -Qdtq lists A LOT OF PACKAGES

andreaschar15 wrote:

I have been running pacman -Qdtq every once in a while to clear out some packages I don't need. I am careful to remove only what I don't need. Ran this command today and got a list of basically every package I installed. I know it is not normal. Any idea how this happened and how can I fix this?

OP did you ever find out what happened?  I'm curious.

One suggestion, execute the following on the command line:

grep asdep /var/log/pacman.log

View your pacman log for potential clues.  Taking the output from one command and using it as the input for another either via piping, command or process substitution should always be proceeded with a dry-run/print, careful review, and backup.  I only mention it because I've seen users do it without understaning and then have issues.

To fix,  do you have a backup of your local database before you noticed the issue.

If you do, and I'm not sure about this, you could find out which packages were explicitly installed and which were installed as a dependency. For example,

find /var/lib/pacman/local -type f -name desc -exec grep -HA1  '%REASON%' '{}' ';'  # installed as a dependency
find /var/lib/pacman/local -type f -name desc -exec grep -L  '%REASON%' '{}' ';'       # installed explicitly

pacman -Qi <pkg>  # to confirm
pacman -D --asdeps|--asexplicit <pkg> # to change

pacman -Dkk # for further diagnostics

# I also like to use
pacman -Sii <pkg>
pactree -r  <pkg> # check options

imho, only use asdep or asexplicit on a package and never on an update/upgrade. There might be a case for it, but it definitely would be an advanced case.  archwiki pages seem to go both ways, one page using it, another page warning about it.

Good luck. Let us know how it's going.

source: lib/libalpm/alpm.h

/** Package install reasons. */
typedef enum _alpm_pkgreason_t {
          /** Explicitly requested by the user. */
          ALPM_PKG_REASON_EXPLICIT = 0,
          /** Installed as a dependency for another package. */
          ALPM_PKG_REASON_DEPEND = 1
} alpm_pkgreason_t;

Last edited by mountaintrek (2024-02-01 07:46:52)

Offline

Board footer

Powered by FluxBB