4

EDIT 3 :

This is after command sudo apt-get purge libpciaccess*

laur@laur-System-Product-Name:~$ sudo apt-get purge
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
libpciaccess0 : Breaks: libpciaccess0:i386 (!= 0.14-1) but 0.16- 
0ubuntu1 is installed
libpciaccess0:i386 : Breaks: libpciaccess0 (!= 0.16-0ubuntu1) but 
0.14-1 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages 
(or specify a solution).



laur@laur-System-Product-Name:~$ sudo apt-get purge libpciaccess*
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libpciaccess0' for glob 'libpciaccess*'
Note, selecting 'libpciaccess-dev' for glob 'libpciaccess*'
Package 'libpciaccess-dev' is not installed, so not removed
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
intel-media-va-driver : Depends: libpciaccess0 but it is not going to 
be installed
libdrm-intel1 : Depends: libpciaccess0 but it is not going to be 
installed
spice-vdagent : Depends: libpciaccess0 but it is not going to be 
installed
ubuntu-drivers-common : Depends: libpciaccess0 (>= 0.10.7) but it is 
not going to be installed
xserver-xorg-core : Depends: libpciaccess0 (>= 0.12.902) but it is not 
going to be installed
xserver-xorg-video-ati : Depends: libpciaccess0 but it is not going to 
be installed
xserver-xorg-video-intel : Depends: libpciaccess0 (>= 
0.8.0+git20071002) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages 
(or specify a solution).

More of them are appearing... I tried installing Intel Graphics For Linux also, but unfortunatelly its instalation didn't worked.

EDIT 2 :

laur@laur-System-Product-Name:~$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
libpciaccess0
The following packages will be upgraded:
libpciaccess0
1 upgraded, 0 newly installed, 0 to remove and 94 not upgraded.
13 not fully installed or removed.
Need to get 0 B/17,9 kB of archives.
After this operation, 33,8 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 232583 files and directories currently 
installed.)
Preparing to unpack .../libpciaccess0_0.16-0ubuntu1_amd64.deb ...
Unpacking libpciaccess0:amd64 (0.16-0ubuntu1) over (0.14-1) ...
dpkg: error processing archive 
/var/cache/apt/archives/libpciaccess0_0.16-0ubuntu1_amd64.deb (-- 
unpack):
trying to overwrite shared 
'/usr/share/doc/libpciaccess0/changelog.Debian.gz', which is different 
 from other instances of package libpciaccess0:amd64
 Errors were encountered while processing:
 /var/cache/apt/archives/libpciaccess0_0.16-0ubuntu1_amd64.deb

 **E: Sub-process /usr/bin/dpkg returned an error code (1)**

I recieve the error above ^

EDIT :

I restored the default repositories through method provided by @karel and still I get the same output:

laur@laur-System-Product-Name:~$ sudo apt-get upgrade
[sudo] password for laur: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
libpciaccess-dev : Depends: libpciaccess0 (= 0.16-0ubuntu1) but 0.14-1 
is installed
libpciaccess0 : Breaks: libpciaccess0:i386 (!= 0.14-1) but 0.16- 
0ubuntu1 is installed
libpciaccess0:i386 : Breaks: libpciaccess0 (!= 0.16-0ubuntu1) but 
0.14-1 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages 
(or specify a solution).

Good afternoon! I am facing a really annoying problem with Ubuntu 20.04, I have those packages that have unmet dependencies, I tried using all the methods found by me on Internet to remove them, but none of them worked as expected.

I want to just fix this error in order to install some required upgrades for Linux

I tried sudo apt --fix-broken install but didn't worked.

I am new to Linux distribution and I want just to learn how to use it better.

Thank you for any kind of help!

laur@laur-System-Product-Name:~$ sudo apt update
[sudo] password for laur: 
Hit:1 http://ro.archive.ubuntu.com/ubuntu focal InRelease
Hit:2 https://repo.steampowered.com/steam stable InRelease                     
Hit:3 http://ro.archive.ubuntu.com/ubuntu focal-updates InRelease              
Hit:4 https://deb.nodesource.com/node_14.x focal InRelease                     
Hit:5 https://brave-browser-apt-release.s3.brave.com stable InRelease          
Hit:6 http://ro.archive.ubuntu.com/ubuntu focal-backports InRelease            
Get:7 http://security.ubuntu.com/ubuntu focal-security InRelease [107 
kB]      
Hit:8 https://packages.microsoft.com/repos/ms-teams stable InRelease           
Fetched 107 kB in 1s (112 kB/s)                          
Reading package lists... Done
Building dependency tree       
Reading state information... Done
7 packages can be upgraded. Run 'apt list --upgradable' to see them.
laur@laur-System-Product-Name:~$ sudo apt list --upgradable
Listing... Done
aptdaemon-data/focal-updates,focal-updates,focal-security,focal- 
security 1.1.1+bzr982-0ubuntu32.2 all [upgradable from: 1.1.1+bzr982- 
0ubuntu32]
aptdaemon/focal-updates,focal-updates,focal-security,focal-security 
1.1.1+bzr982-0ubuntu32.2 all [upgradable from: 1.1.1+bzr982-0ubuntu32]
gdebi-core/focal,focal 0.9.5.7+nmu3 all [upgradable from: 
0.9.5.7+nmu3]
libpciaccess0/focal 0.16-0ubuntu1 amd64 [upgradable from: 0.14-1]
python3-aptdaemon.gtk3widgets/focal-updates,focal-updates,focal- 
security,focal-security 1.1.1+bzr982-0ubuntu32.2 all [upgradable from: 
1.1.1+bzr982-0ubuntu32]
python3-aptdaemon/focal-updates,focal-updates,focal-security,focal- 
security 1.1.1+bzr982-0ubuntu32.2 all [upgradable from: 1.1.1+bzr982- 
0ubuntu32]
secureboot-db/focal-updates 1.6~20.04.1 amd64 [upgradable from: 1.5]

laur@laur-System-Product-Name:~$ sudo apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.

The following packages have unmet dependencies:
libpciaccess-dev : Depends: libpciaccess0 (= 0.16-0ubuntu1) but 0.14-1 
is installed
libpciaccess0 : Breaks: libpciaccess0:i386 (!= 0.14-1) but 0.16- 
0ubuntu1 is installed
libpciaccess0:i386 : Breaks: libpciaccess0 (!= 0.16-0ubuntu1) but 
0.14-1 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages 
(or specify a solution).
18
  • 1
    Did you download any packages manually? What instructions were you following that told you to install libpciaccess-dev?
    – user535733
    Oct 2, 2020 at 15:40
  • 1
    I am coming from Windows and there things are different..
    – user1132587
    Oct 2, 2020 at 16:06
  • 1
    Let's assume that you tried them all because that's what you said. In that case the next logical step would be to restore the default repositories. Make sure that you really did try them all before you descend into chaos needlessly.
    – karel
    Oct 2, 2020 at 16:16
  • 1
    I reset the sources.list, still the same output. See the edited question.
    – user1132587
    Oct 2, 2020 at 16:56
  • 2
    I also tried sudo apt-get -f install and sudo apt-get purge but none of them seem to work, I will post also the output of sudo apt-get purge in a few minutes. Already done for sudo apt-get -f install ( see edited question )
    – user1132587
    Oct 2, 2020 at 17:35

4 Answers 4

4

Firstly try, sudo dpkg --configure -a

If that didn't work use aptitude instead of apt-get

sudo aptitude install package_name_here

It will suggest dependencies solutions. Try them. If everything else fails, you need to manually edit dpkg status file

sudo gedit /var/lib/dpkg/status

Then look for the problematic package name. Remove those packages and save the file. Then update and upgrade.

sudo apt-get update && upgrade

Then it will install required packages during update. Let me know if this doesn't work out.

2

After some digging around with different solutions I came to one that helped me.

  1. I restored the sources.list file using solution provided in this answer

  2. I restored the status file using these commands found here:

mv /var/lib/dpkg/status /var/lib/dpkg/status.old
ls -l /var/backups/dpkg.status*
cp /var/backups/dpkg.status.0 /var/lib/dpkg/status

  1. I had installed i386 architecture on my system when I tried installing Intel Graphics For Linux and some other programs that I didn't kept track off. I removed it using:

sudo dpkg --remove-architecture i386

  1. And finally I did the last 2 commands:

sudo apt-get update and sudo apt-get upgrade

Before I removed the package that was in my error (the libpciaccess one) using sudo dpkg -r libpciaccess* or sudo apt-get purge libpciaccess* , but I think restoring the status file was enough because when I updated and upgraded Ubuntu installed all it's needed upgrades after and my error at Software Updates was gone.

I think this answer will help others that have the same problem as me. Thank you for your awesome help!

2

Just:

sudo apt-get remove package2remove --fix-broken

Man says:

   -f, --fix-broken
       Fix; attempt to correct a system with broken dependencies in place.
       This option, when used with install/remove, can omit any packages
       to permit APT to deduce a likely solution
0
  • Go to the /usr/share/doc/.

  • Delete the two directories libpciaccess0 and libpciaccess-dev directories

  • And do sudo apt install --fix-broken and the problem will be fixed.