I am trying to install libpci-dev
library in Ubuntu 18.04.5 LTS since I am working on Linux driver stuff that communicates with a board over PCIe. However, using apt-get
command I get the following error:
$ sudo apt-get install libpci-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libpci-dev : Depends: libpci3 (= 1:3.5.2-1ubuntu1) but 1:3.5.2-1ubuntu1.1 is to be installed
Depends: libudev-dev (>= 196) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
I tried to run the following set of commands hoping it will fix the dependency issue, but no success:
sudo apt-get autoremove
sudo apt-get clean
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install -f
I checked the output of this command and there is no error:
sudo dpkg --configure -a
I installed synaptic and tried to install the development library from there, however, this is what I get as an error:
So how can I solve this issue? What am I missing?
Some additional output to the problem from the commands:
apt-cache policy libpci-dev libpci3 libudev-dev zlib1g-dev
libpci-dev:
Installed: (none)
Candidate: 1:3.5.2-1ubuntu1
Version table:
1:3.5.2-1ubuntu1 500
500 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages
libpci3:
Installed: 1:3.5.2-1ubuntu1.1
Candidate: 1:3.5.2-1ubuntu1.1
Version table:
*** 1:3.5.2-1ubuntu1.1 100
100 /var/lib/dpkg/status
1:3.5.2-1ubuntu1 500
500 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages
libudev-dev:
Installed: (none)
Candidate: 237-3ubuntu10
Version table:
237-3ubuntu10 500
500 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages
zlib1g-dev:
Installed: (none)
Candidate: 1:1.2.11.dfsg-0ubuntu2
Version table:
1:1.2.11.dfsg-0ubuntu2 500
500 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages
And for the following command:
grep ^deb -r /etc/apt/ --include=*.lis
/etc/apt/sources.list:deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
/etc/apt/sources.list:deb http://us.archive.ubuntu.com/ubuntu/ bionic universe
/etc/apt/sources.list:deb http://us.archive.ubuntu.com/ubuntu/ bionic multiverse
/etc/apt/sources.list:deb http://archive.ubuntu.com/ubuntu bionic main
apt-cache policy libpci-dev libpci3 libudev-dev zlib1g-dev
. It looks like you have broken repositories, please show their list bygrep ^deb -r /etc/apt/ --include=*.list
. – N0rbert Jan 12 '21 at 12:08grep ^deb -r /etc/apt/ --include=*.list
I do not see any output. – IoT Jan 12 '21 at 12:58