Got error while running sudo apt upgrade

Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following package was automatically installed and is no longer required:
libfuse3-3
Use 'sudo apt autoremove' to remove it.
The following packages have been kept back:
xdg-desktop-portal
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
3 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up grub-common (2.04-1ubuntu26.17+zorin1) ...
Job for grub-initrd-fallback.service failed because the control process exited w
ith error code.
See "systemctl status grub-initrd-fallback.service" and "journalctl -xe" for det
ails.
update-rc.d: warning: start and stop actions are no longer supported; falling ba
ck to defaults
Job for grub-common.service failed because the control process exited with error
code.
See "systemctl status grub-common.service" and "journalctl -xe" for details.
invoke-rc.d: initscript grub-common, action "restart" failed.
● grub-common.service - Record successful boot for GRUB
Loaded: loaded (/lib/systemd/system/grub-common.service; enabled; vendor pr
eset: enabled)
Active: failed (Result: exit-code) since Thu 2023-07-06 01:00:05 IST; 8ms a
go
Process: 8203 ExecStartPre=/bin/sh -c [ -s /boot/grub/grubenv ] || rm -f /bo
ot/grub/grubenv; mkdir -p /boot/grub (code=exited, status=0/SUCCESS)
Process: 8205 ExecStart=/usr/bin/grub-editenv /boot/grub/grubenv unset recor
dfail (code=exited, status=1/FAILURE)
Main PID: 8205 (code=exited, status=1/FAILURE)

Jul 06 01:00:05 akash-Inspiron-14-3467 systemd[1]: Starting Record successful bo
ot for GRUB...
Jul 06 01:00:05 akash-Inspiron-14-3467 grub-editenv[8205]: /usr/bin/grub-editenv
: error: invalid environment block.
Jul 06 01:00:05 akash-Inspiron-14-3467 systemd[1]: grub-common.service: Main pro
cess exited, code=exited, status=1/FAILURE
Jul 06 01:00:05 akash-Inspiron-14-3467 systemd[1]: grub-common.service: Failed w
ith result 'exit-code'.
Jul 06 01:00:05 akash-Inspiron-14-3467 systemd[1]: Failed to start Record succes
sful boot for GRUB.
dpkg: error processing package grub-common (--configure):
installed grub-common package post-installation script subprocess returned erro
r exit status 1
dpkg: dependency problems prevent configuration of grub-efi:
grub-efi depends on grub-common (= 2.04-1ubuntu26.17+zorin1); however:
Package grub-common is not configured yet.

dpkg: error processing package grub-efi (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of grub2-common:
grub2-common depends on grub-common (= 2.04-1ubuntu26.17+zorin1); however:
Package grub-common is not configured yet.

dpkg: error processing package grub2-common (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
grub-common
grub-efi
grub2-common
E: Sub-process /usr/bin/dpkg returned an error code (1)

What command did you run just before this? sudo apt update never results in a y/n prompt.

sudo apt upgrade
and on sudo apt update I am getting 1 upgradable package is ready for upgrade something like this

Please try:

sudo rm /var/lib/dpkg/info/grub*

sudo dpkg --configure -a

sudo apt update

Relay what you see at this point...

On first command I got
rm: cannot remove '/var/lib/dpkg/info/grub*': No such file or directory
And on last command I got
Hit:1 https://dl.google.com/linux/chrome/deb stable InRelease
Hit:2 Index of /yannubuntu/boot-repair/ubuntu focal InRelease
Hit:3 Index of /ubuntu focal-security InRelease
Hit:4 Index of /zorinos/apps/ubuntu focal InRelease
Hit:5 Index of /ubuntu focal InRelease
Hit:6 Index of /zorinos/drivers/ubuntu focal InRelease
Hit:7 Index of /ubuntu focal-updates InRelease
Hit:8 Index of /stable/ focal InRelease
Hit:9 Index of /zorinos/patches/ubuntu focal InRelease
Hit:10 Index of /patches/ focal InRelease
Hit:11 Index of /ubuntu focal-backports InRelease
Hit:12 Index of /zorinos/stable/ubuntu focal InRelease
Hit:13 Index of /apps/ focal InRelease
Hit:14 Index of /drivers/ focal InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
1 package can be upgraded. Run 'apt list --upgradable' to see it.

No problems there...

Let me guess: apt list -u in terminal shows xdg-desktop-portal as upgradeable, correct?
If so, I would advise ignoring that for now...

Listing... Done
xdg-desktop-portal/focal 1.14.3-1~flatpak1~20.04 amd64 [upgradable from: 1.8.1-1~flatpak1~20.04]
N: There are 3 additional versions. Please use the '-a' switch to see them.
I got this.

I would suggest just leaving that be, for now. Though most users report no trouble, some have run into difficulties with version conflicts when trying to upgrade that package.
You can safely run your usual upgrades, including the terminal commands to upgrade. That package may be held back if there are conflicts. But if that happens, it is better to not try to resolve the conflicts by forcing the upgrade of xdg-portal-desktop.

Ok thanks bro @Aravisian

1 Like

In fact, I see this update under Zorin OS Basic Components but it isn't selectable, and so impossible to download :person_shrugging:.

You can safely run

sudo apt install xdg-desktop-portal

in terminal in order to install / upgrade the package.

Why doesn't Software Updater allow me to simply install it from its GUI? This is the first time I've seen this behavior. Then I suppose that's the service that allows software to access my files, right? For example, when I want to upload a screenshot on Discord (.deb) a Portal notification appears on top screen.

I am not sure on this one, either.

I am reasonably sure that the issue lies with the dependency of fuse and fuse3.
This relates to why the package can show as 'held back' rather than it just installing with the other upgrades.

The difference between upgrade / dist-upgrade and full-upgrade is that a dist-upgrade will upgrade a package as long as removal or file deletion is not necessary. With full-upgrade, the package will be upgraded even including removal or file deletion as necessary.

Since fuse must be removed in order to install fuse3 and fuse is a dependency for many packages, this probably means any upgrade option other than full-upgrade will hold back the package that depends upon fuse3.

1 Like

Same. I used the sudo apt install xdg-desktop-portal command that AZorin recommended to resolve it.

And I have had no issues with it.
But it is abnormal that the package is not passing through the upgrader. It can be undesirable to force a package to be switched to Manually Installed, sometimes.
This is not a Zorin OS issue; it is up the Package Maintainer (arrowd@FreeBSD.org) to fix this.

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