Sudo issues and invalid or corrupt package

Edit: As I needed a quick “solution” to get work done, I took the L and just started fresh on a new Manjaro installation. This time making backups and trying to do everything right.

Hi guys, I had issues with my kernel update and once I figured out a fix for that I now have this issue shown below:

sudo: error in /etc/sudo.conf, line 0 while loading plugin "sudoers_policy"
sudo: unable to load /usr/lib/sudo/sudoers.so: libldap-2.4.so.2: cannot open shared object file: No such file or directory
sudo: fatal error, unable to load plugins

Anytime I try to use sudo to install anything I get this error. I tried the following which I saw on another post:
su
and enter the root password you set at install, then run:
pacman -Syyu sudo libsasl
then reboot the system
systemctl reboot

However when I run the below command, I get an error regarding an invalid or corrupted package.

pacman -Syyu sudo libsasl
:: Synchronizing package databases...
 core                                                                                                             168.9 KiB   207 KiB/s 00:01 [#######################################################################################] 100%
 extra                                                                                                           1901.2 KiB  1621 KiB/s 00:01 [#######################################################################################] 100%
 community                                                                                                          7.0 MiB  1914 KiB/s 00:04 [#######################################################################################] 100%
 multilib                                                                                                         174.0 KiB   352 KiB/s 00:00 [#######################################################################################] 100%
warning: libsasl-2.1.27-3 is up to date -- reinstalling
:: Starting full system upgrade...
resolving dependencies...
error: could not open file /var/lib/pacman/local/lib32-mesa-21.3.5-1/desc: No such file or directory
looking for conflicting packages...
warning: could not fully load metadata for package lib32-mesa-21.3.5-1
error: failed to prepare transaction (invalid or corrupted package)

Edit: I now also tried to fix this by using su and then running the following commands but still no luck.

pacman-mirrors -f && pacman -Syyu
::INFO Downloading mirrors from Manjaro
::INFO => Mirror pool: https://repo.manjaro.org/mirrors.json
::INFO => Mirror status: https://repo.manjaro.org/status.json
::INFO Using custom mirror file
::INFO Querying mirrors - This may take some time
  0.592 United_States  : https://mirrors.gigenet.com/manjaro/
  1.533 United_States  : https://mirror.arvancloud.com/manjaro/
  0.410 Canada         : https://mirror.csclub.uwaterloo.ca/manjaro/
  0.658 Canada         : https://muug.ca/mirror/manjaro/
  0.934 Costa_Rica     : https://mirrors.ucr.ac.cr/manjaro/
  0.489 United_States  : https://mirror.math.princeton.edu/pub/manjaro/
  1.714 United_States  : https://mirrors.ocf.berkeley.edu/manjaro/
  0.467 Canada         : https://mirror.0xem.ma/manjaro/
  0.554 United_States  : https://repo.ialab.dsu.edu/manjaro/
  0.407 Canada         : https://osmirror.org/manjaro/
  0.899 United_States  : https://mirrors.sonic.net/manjaro/
::INFO Writing mirror list
::Canada          : https://osmirror.org/manjaro/stable/$repo/$arch
::Canada          : https://mirror.csclub.uwaterloo.ca/manjaro/stable/$repo/$arch
::Canada          : https://mirror.0xem.ma/manjaro/stable/$repo/$arch
::United_States   : https://mirror.math.princeton.edu/pub/manjaro/stable/$repo/$arch
::United_States   : https://repo.ialab.dsu.edu/manjaro/stable/$repo/$arch
::United_States   : https://mirrors.gigenet.com/manjaro/stable/$repo/$arch
::Canada          : https://muug.ca/mirror/manjaro/stable/$repo/$arch
::United_States   : https://mirrors.sonic.net/manjaro/stable/$repo/$arch
::Costa_Rica      : https://mirrors.ucr.ac.cr/manjaro/stable/$repo/$arch
::United_States   : https://mirror.arvancloud.com/manjaro/stable/$repo/$arch
::United_States   : https://mirrors.ocf.berkeley.edu/manjaro/stable/$repo/$arch
::INFO Mirror list generated and saved to: /etc/pacman.d/mirrorlist
:: Synchronizing package databases...
 core                                     168.9 KiB   406 KiB/s 00:00 [#######################################] 100%
 extra                                   1901.2 KiB  5.58 MiB/s 00:00 [#######################################] 100%
 community                                  7.0 MiB  10.6 MiB/s 00:01 [#######################################] 100%
 multilib                                 174.0 KiB  2.98 MiB/s 00:00 [#######################################] 100%
:: Starting full system upgrade...
resolving dependencies...
error: could not open file /var/lib/pacman/local/lib32-mesa-21.3.5-1/desc: No such file or directory
looking for conflicting packages...
warning: could not fully load metadata for package lib32-mesa-21.3.5-1
error: failed to prepare transaction (invalid or corrupted package)

I’m relatively new to manjaro and linux as a whole, any help would be greatly appreciated, if you need any further information please let me know.

Thanks in advance.

See:

As well as:

Please edit your post accordingly. :point_up:

Hi, thanks for the advice with formatting, however the solution to my actual problem doesn’t seem to work for me as I am having issues with sudo so I can’t use the commands recommended to fix the second issue. I guess these are 2 issues in one and maybe I should have made 2 separate posts.

I need to get sudo working again before I can fix/do anything else.

may you explain what’s the problem ?

Whenever I try to use sudo to install anything I get:

sudo: error in /etc/sudo.conf, line 0 while loading plugin "sudoers_policy"
sudo: unable to load /usr/lib/sudo/sudoers.so: libldap-2.4.so.2: cannot open shared object file: No such file or directory
sudo: fatal error, unable to load plugins

I know I can use “su” to get into root and run commands but I’d rather not have to do that every time I wish to install something.

And when i try to run

pacman -Syyu

I also get errors.
Like I said, I am new to Linux and I am just stuck right now as I can’t seem to get anything to work.

please post the output of `groups’

Can you explain the issue and how you fixed it in more detail?

You can switch to root to fix this issue first. Then just update your mirrors and do a full system upgrade.

Links

Update or package installation returns “error: failed to commit transaction (invalid or corrupted package)”

Error when I try installing things via pacman - #13 by linux-aarhus

Also for the sudo issue, maybe try reinstalling sudo (as root, with su command.

2 Likes

when I run ‘groups’ as my user it outputs:

sys network power lp wheel autologin jkharris

and when I run it under ‘su’:

root

So when I updated my kernel I used this interface to update to a newer version:
Edit: The image doesnt seem to upload, I simply used the “Kernel - System Settings Module” to update to a new kernel. I currently have 5.10.98-1 installed but also have 5.9.16-1 installed, this is the one that is running and it also shows that it is unsupported. Should I try using a different kernel again or should I try to solve this issue first?

![kernel|593x500](upload://bPpG4SCB5YLwtAZEMiq8VizCY7P.png)

and I didn’t delete or remove my old kernel version. So to get it to work again I simply removed the new version I installed and now I am here.

I tried to fix that issue first, the only thing I didn’t try was to clear my entire cache as they mentioned that is undesirable but if I need to do that then that is fine.