1

Last night I tried to upgrade from Ubuntu 18.04.5 to 20.04 by using the command

sudo do-release-upgrade.

When it gave me the prompt to start downloading the new packages, and gave me the warning that once downloaded, you couldn't stop it, I hit details to check the packages that would be deleted. Once on the details screen, I didn't know how to back out to confirm the download, so I ctrl+c out, and typed sudo do-release-upgrade again. But it gave me an error saying that I have to update all current packages before doing the release upgrade. I ran

sudo apt update 
sudo apt upgrade

and it showed thousands of packages that needed to be upgraded. Assuming that's what would do the upgrade to 20.04, I confirmed the upgrade, and it started downloading and upgrading the packages.

Halfway through, I got an error, and it stopped upgrading.

I retried doing

sudo apt upgrade

but the same error would pop up.

After a few minutes, i got automatically logged out while trying to open Software & Updates and I couldn't log back in, as it would kick me back to the login screen.

Now I started googling the problem and followed this guide. When doing

sudo dpkg --configure -a

this shows up:

pkg: dependency problems prevent configuration of libgles-dev:amd64:
 libgles-dev:amd64 depends on libgl-dev; however:
  Package libgl-dev:amd64 is not installed.

dpkg: error processing package libgles-dev:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libglvnd-dev:amd64:
 libglvnd-dev:amd64 depends on libgl-dev (>= 1.3.0-1); however:
  Package libgl-dev:amd64 is not installed.
 libglvnd-dev:amd64 depends on libgles-dev (>= 1.3.0-1); however:
  Package libgles-dev:amd64 is not configured yet.
 libglvnd-dev:amd64 depends on libglx-dev (>= 1.3.0-1); however:
  Package libglx-dev:amd64 is not installed.

dpkg: error processing package libglvnd-dev:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libgl1-mesa-dev:amd64:
 libgl1-mesa-dev:amd64 depends on libgl-dev; however:
  Package libgl-dev:amd64 is not installed.
 libgl1-mesa-dev:amd64 depends on libglvnd-dev; however:
  Package libglvnd-dev:amd64 is not configured yet.

dpkg: error processing package libgl1-mesa-dev:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libegl-dev:amd64:
 libegl-dev:amd64 depends on libgl-dev; however:
  Package libgl-dev:amd64 is not installed.

dpkg: error processing package libegl-dev:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libglvnd-core-dev:amd64:
 libglvnd-core-dev:amd64 depends on libglvnd-dev; however:
  Package libglvnd-dev:amd64 is not configured yet.

dpkg: error processing package libglvnd-core-dev:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libglu1-mesa-dev:amd64:
 libglu1-mesa-dev:amd64 depends on libgl1-mesa-dev | libgl-dev; however:
  Package libgl1-mesa-dev:amd64 is not configured yet.
  Package libgl-dev:amd64 is not installed.

dpkg: error processing package libglu1-mesa-dev:amd64 (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 libgles-dev:amd64
 libglvnd-dev:amd64
 libgl1-mesa-dev:amd64
 libegl-dev:amd64
 libglvnd-core-dev:amd64
 libglu1-mesa-dev:amd64

but it fixed the login issue, so I can now use the computer again. But now I still have the problem of not being able to upgrade to 20.04. And it seems that my dependencies are broken.

When trying

> sudo apt install -f 

I get

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  libcbor0.6 libdrm-dev libffi7:i386 libfido2-1 libglvnd-core-dev libpcre3:i386 libx11-xcb-dev
  libxcb-dri2-0-dev libxcb-dri3-dev libxcb-glx0-dev libxcb-present-dev libxcb-randr0-dev
  libxcb-render0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxdamage-dev
  libxext-dev libxfixes-dev libxshmfence-dev libxxf86vm-dev mesa-common-dev x11proto-damage-dev
  x11proto-fixes-dev x11proto-xext-dev x11proto-xf86vidmode-dev
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libgl-dev libglx-dev
The following NEW packages will be installed:
  libgl-dev libglx-dev
0 upgraded, 2 newly installed, 0 to remove and 1689 not upgraded.
6 not fully installed or removed.
Need to get 0 B/112 kB of archives.
After this operation, 1.480 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 246661 files and directories currently installed.)
Preparing to unpack .../libglx-dev_1.3.1-1_amd64.deb ...
Unpacking libglx-dev:amd64 (1.3.1-1) ...
dpkg: error processing archive /var/cache/apt/archives/libglx-dev_1.3.1-1_amd64.deb (--unpack):
 trying to overwrite '/usr/include/GL/glx.h', which is also in package mesa-common-dev:amd64 20.0.
8-0ubuntu1~18.04.1
Preparing to unpack .../libgl-dev_1.3.1-1_amd64.deb ...
Unpacking libgl-dev:amd64 (1.3.1-1) ...
dpkg: error processing archive /var/cache/apt/archives/libgl-dev_1.3.1-1_amd64.deb (--unpack):
 trying to overwrite '/usr/include/GL/gl.h', which is also in package mesa-common-dev:amd64 20.0.8
-0ubuntu1~18.04.1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/libglx-dev_1.3.1-1_amd64.deb
 /var/cache/apt/archives/libgl-dev_1.3.1-1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

I feel that it's worth mentioning that the package lists seem to be the focal ones and not bionic beaver. See sudo apt update:

Hit:1 http://us.archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease                             
Hit:3 http://security.ubuntu.com/ubuntu xenial-security InRelease                             
Hit:4 http://us.archive.ubuntu.com/ubuntu focal-backports InRelease     
Hit:5 http://it.archive.ubuntu.com/ubuntu xenial-updates InRelease      
Hit:6 http://us.archive.ubuntu.com/ubuntu focal-security InRelease
Reading package lists... Done                     
Building dependency tree       
Reading state information... Done
1689 packages can be upgraded. Run 'apt list --upgradable' to see them.

I would appreciate any help on trying to fix this issue. I'm thinking of reverting the package lists to the bionic beaver ones but I don't know how to do that.

Thank you in advance.

6
  • Package libgl-dev:amd64 is not installed. Have you tried installing that?
    – Mast
    Aug 11, 2020 at 18:16
  • I tried it, but it didn't install it. It suggested to run sudo apt --fix-broken install. When run it gives the same error as before.
    – Diatrix
    Aug 11, 2020 at 18:21
  • This one: Errors were encountered while processing: /var/cache/apt/archives/libglx-dev_1.3.1-1_amd64.deb /var/cache/apt/archives/libgl-dev_1.3.1-1_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1)
    – Diatrix
    Aug 11, 2020 at 18:21
  • This is what shows up when I try installing libgl-dev:amd64: <pre>The following packages have unmet dependencies: libgl-dev : Depends: libglx-dev but it is not going to be installed libglvnd-dev : Depends: libglx-dev (&gt;= 1.3.0-1) but it is not going to be installed E: Unmet dependencies. Try &apos;apt --fix-broken install&apos; with no packages (or specify a solution).</pre>
    – Diatrix
    Aug 11, 2020 at 18:23
  • 3
    Does this answer your question? dpkg error: "trying to overwrite file, which is also in..."
    – karel
    Aug 11, 2020 at 21:38

1 Answer 1

2

Ok, I fixed the dependency problem by reverting to the Bionic source list. To do that I ran:

sudo sed -i 's/focal/bionic/' /etc/apt/sources.list /etc/apt/sources.list.d/*list

I then did:

sudo apt update
sudo apt --fix-broken install
sudo apt full-upgrade

This fixed the dependency problem. Now I can retry sudo do-release-upgrade.

Update: The upgrade went without issues. 20.04 successfully installed.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .