I am running Ubuntu 16.04 and I am trying to install libsdl2-dev unsuccessfully. I have searched Google and followed several answers on this site and more. I tried to reduce my repositories to just safe ones, have run apt-get update, apt-get upgrade.. and so many other things I cant exactly remember now. I've tried all I could find on Google. Here is the output I am getting from
sudo apt-get -f install libsdl2-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:
libsdl2-dev : Depends: libudev-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
and
cat /etc/apt/sources.list
deb http://ftp.belnet.be/ubuntu.com/ubuntu/ xenial multiverse restricted universe main
deb-src http://ftp.belnet.be/ubuntu.com/ubuntu/ xenial multiverse restricted universe main #Added by software-properties
and
cat /etc/apt/sources.list.d/*
# deb http://ppa.launchpad.net/flexiondotorg/youtube-dl-gui/ubuntu xenial main
# deb-src http://ppa.launchpad.net/flexiondotorg/youtube-dl-gui/ubuntu xenial main
# deb http://ppa.launchpad.net/flexiondotorg/youtube-dl-gui/ubuntu xenial main
# deb-src http://ppa.launchpad.net/flexiondotorg/youtube-dl-gui/ubuntu xenial main
# deb http://deb.playonlinux.com/ trusty main
# deb http://deb.playonlinux.com/ trusty main
deb http://packages.ros.org/ros/ubuntu xenial main
# deb http://packages.ros.org/ros/ubuntu xenial main
# deb http://ppa.launchpad.net/v-launchpad-jochen-sprickerhof-de/pcl/ubuntu xenial main
# deb-src http://ppa.launchpad.net/v-launchpad-jochen-sprickerhof-de/pcl/ubuntu xenial main
# deb-src http://ppa.launchpad.net/v-launchpad-jochen-sprickerhof-de/pcl/ubuntu xenial main
# deb-src http://ppa.launchpad.net/v-launchpad-jochen-sprickerhof-de/pcl/ubuntu xenial main
# deb-src http://ppa.launchpad.net/v-launchpad-jochen-sprickerhof-de/pcl/ubuntu xenial main
# deb-src http://ppa.launchpad.net/v-launchpad-jochen-sprickerhof-de/pcl/ubuntu xenial main
# deb http://ppa.launchpad.net/v-launchpad-jochen-sprickerhof-de/pcl/ubuntu xenial main
# deb-src http://ppa.launchpad.net/v-launchpad-jochen-sprickerhof-de/pcl/ubuntu xenial main
# deb-src http://ppa.launchpad.net/v-launchpad-jochen-sprickerhof-de/pcl/ubuntu xenial main
# deb-src http://ppa.launchpad.net/v-launchpad-jochen-sprickerhof-de/pcl/ubuntu xenial main
# deb-src http://ppa.launchpad.net/v-launchpad-jochen-sprickerhof-de/pcl/ubuntu xenial main
# deb-src http://ppa.launchpad.net/v-launchpad-jochen-sprickerhof-de/pcl/ubuntu xenial main
# deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main
# deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main
# deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main
# deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main
deb http://ppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu xenial main
# deb-src http://ppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu xenial main
deb http://ppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu xenial main
# deb-src http://ppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu xenial main
I have also tried
y-ppa-manager
and
synaptic
When I try to install libsdl2-dev using synaptic, first there are no broken packages, but then when I mark libsdl2-dev for installation, it says that I have to first remove broken packages. I have tried to apt-get remove –purge libsdl2-dev but since it is not installed it cannot be removed.
I appreciate any and all help. Thank you. I am post output for commands you give me and will remain active on this question until it can be resolved. Thank you again
EDIT 1:
sudo apt-get install libudev-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:
libudev-dev : Depends: libudev1 (= 229-4ubuntu4) but 229-4ubuntu6 is to be installed
E: Unable to correct problems, you have held broken packages.
and
sudo apt-get install 229-4ubuntu6
E: Unable to locate package 229-4ubuntu6
and
sudo apt-get install libudev1
libudev1 is already the newest version (229-4ubuntu6).
EDIT 2:
for the commands
sudo add-apt-repository XXXXX
i always got
XXXXX distribution component is already enabled for all sources.
the rest as follows
sudo apt update
Hit:1 http://ppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu xenial InRelease
Hit:2 http://packages.ros.org/ros/ubuntu xenial InRelease
Hit:3 http://ftp.belnet.be/ubuntu.com/ubuntu xenial InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
sudo apt -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
sudo apt install libsdl2-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:
libsdl2-dev : Depends: libudev-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
FINAL EDIT:
This problem is now resolved. The finals steps to my solution were to enable the xenial-security and xenial-update repo's. After I did that and tried sudo apt-get update and sudo apt-get upgrade I had soem errors downloading some updates. After this I changed my download server to the Main server and re-ran update & upgrade, which completed successfully. After this I was ale to successfully install libsdl2-dev. Thank you to doug and ali76 for their help!
Best Answer
Don't try this command:
Because there isn't any package with
229-4ubuntu6
name in repositories.The apt output says
That means , the
229-4ubuntu6
version oflibudev1
has been installed yet but the229-4ubuntu4
version is required.And the other things is that, the last version of
libudev1
forxenial
is229-4ubuntu17
but your apt returns the last version is229-4ubuntu6
. This issue is happened because of that, many Ubuntu's repositories is disabled on your system and your repositories is not updated.So as the first step we try to enable all of your Ubuntu repositories with this commands:
Then update your repositories and your packages:
Then try to fix broken packages:
And as the last step try to install
libsdl2-dev
package:Update: Please add this lines to your
/etc/apt/sources.list
file:And comment this lines:
And then try this commands to update repositories and packages:
Then try to install it again: