Unable to install libgtk2.0-dev on Raspberry Pi 2 - linux

I am trying to install libgtk2.0-dev on my Raspberry Pi 2 running on latest raspbian. When I use the command sudo apt-get install libgtk2.0-dev, I get the following dependency errors:
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:
libgtk2.0-dev : Depends: libpango1.0-dev (>= 1.20) but it is not going to be installed
Depends: libcairo2-dev (>= 1.6.4-6.1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
I tried fixing the broken packages using sudo apt-get install -f, sudo apt-get update, sudo apt-get upgrade and then sudo apt-get install libgtk2.0-dev. It still didn't work. I tried apt-get install on the dependencies and their dependencies, but the result is the same. The solutions in link1 and link2 did not help either.
My source.list contains:
deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi
deb http://archive.raspbian.org/raspbian jessie main contrib non-free rpi
Am I missing something in my source.list? How can I resolve this?

apt-cache policy libgtk2.0-dev libpango1.0-dev libcairo2-dev showed that the problem was with /etc/apt/sources.list.d/raspi.list.
raspi.list contained deb http://archive.raspberrypi.org/debian/ wheezy main. Changed wheezy to jessie, ran apt-get update and then running apt-get install libgtk2.0-dev worked.

Use aptitude instead:
sudo aptitude install libglib2.0-dev

Related

Error in installing libssl-dev and libssl1.0-dev in Ubuntu

I am trying to install libssl-dev and libssl1.0-dev in Ubuntu 18.04 via the following command:
sudo apt-get -y install build-essential openssl libssl-dev libssl1.0 libgl1-mesa-dev libqt5x11extras5
I am getting the following output:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libssl1.0-dev' for regex 'libssl1.0'
Note, selecting 'libssl1.0.0' for regex 'libssl1.0'
Note, selecting 'libssl1.0.2' for regex 'libssl1.0'
build-essential is already the newest version (12.4ubuntu1).
libqt5x11extras5 is already the newest version (5.9.5-0ubuntu1).
libqt5x11extras5 set to manually installed.
libgl1-mesa-dev is already the newest version (20.0.8-0ubuntu1~18.04.1).
libgl1-mesa-dev set to manually installed.
libssl-dev is already the newest version (1.1.1-1ubuntu2.1~18.04.20).
libssl1.0.0 is already the newest version (1.0.2n-1ubuntu5.10).
openssl is already the newest version (1.1.1-1ubuntu2.1~18.04.20).
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:
libssl-dev : Conflicts: libssl1.0-dev but 1.0.2n-1ubuntu5.10 is to be installed
libssl1.0-dev : Conflicts: libssl-dev but 1.1.1-1ubuntu2.1~18.04.20 is to be installed
E: Unable to correct problems, you have held broken packages.**
How do I solve these errors?
There are three ways to install libssl1.0-dev on Ubuntu. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.
Install libssl1.0-dev Using apt-get
sudo apt-get update
sudo apt-get -y install libssl1.0-dev
Install libssl1.0-dev Using apt
sudo apt update
sudo apt -y install libssl1.0-dev
Install libssl1.0-dev Using aptitude
sudo aptitude update
sudo aptitude -y install libssl1.0-dev
The following sequence of commands should work to resolve dependencies.
# Fix broken dependencies on your system.
sudo apt-get install -f
# Reconfigure all unpacked packages.
sudo dpkg -–configure -a
# Fix broken dependencies in your system.
sudo apt-get install -f
# Install package on the system.
sudo apt-get install <package_name>

Broken packages for installing python3-pip in Ubuntu16.04 [duplicate]

This is the command I used to install python-pip
sudo apt-get install python-pip
I get the following error
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:
python-pip : Depends: python-setuptools (>= 0.6c1) but it is not going to be installed
Recommends: python-dev-all (>= 2.6) but it is not installable
E: Unable to correct problems, you have held broken packages.
I already installed the latest version of python-dev
When i try to install python-setuptools using
sudo apt-get install python-setuptools I get the below error
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:
python-setuptools : Depends: python-pkg-resources (= 3.3-1ubuntu1) but 3.3-1ubuntu2 is to be installed
E: Unable to correct problems, you have held broken packages.
Explain me how to resolve the error and guide me the steps to get python-pip installed.
got the same error when I install python-pip, the following command solved my problem.
sudo apt-get install python-pkg-resources=3.3-1ubuntu1
sudo apt-get install python-setuptools
download pip from https://bootstrap.pypa.io/get-pip.py
Then run the following (which may require administrator access):
python get-pip.py
This should get you going.
If you get stuck again, read here: http://pip.readthedocs.org/en/stable/installing/
In addition to the solution that #seems recommended, I had to run this.
apt-get update
(OR)
sudo apt-get install python-setuptools python-dev build-essential
sudo easy_install pip
i have the same issue, and eventually i gave up by using:
sudo apt-get install python-pip
after tryings something like:
sudo apt-get install python-setuptools python-dev build-essential
but with no luck.
So all i did then was to:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
peace of mind.....
I think you should try:
sudo apt-get install python-pkg-resources=3.3-1ubuntu1
And then:
sudo apt-get install python-pip python-dev build-essential
It will definitely solve your issue.
Jut run this command :
sudo apt-get update
than install python tools :
sudo apt-get install python-pip
sudo apt-get install python-dev
sudo apt-get install build-essential
All the packages will get installed or some of them may say its already latest version, Thats fine

Unable to install update-notifier-common on Debian Stretch

I'm currently trying to install some fonts on Debian Stretch
g#i-3-nstance:~$ sudo apt-get install ttf-mscorefonts-installer
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:
ttf-mscorefonts-installer : Depends: update-notifier-common (>= 0.119ubuntu2) but it is not installable
E: Unable to correct problems, you have held broken packages.
g#i-3-nstance:~$
...but it seems this package has been removed.
https://github.com/plone/ansible-playbook/issues/98
https://github.com/jnv/ansible-role-unattended-upgrades/issues/6#issuecomment-93569818
Is there a work-around?
Update: I did a manual install based on this: https://askubuntu.com/a/861476
sudo apt-get install cabextract libmspack0
wget http://ftp.de.debian.org/debian/pool/contrib/m/msttcorefonts/ttf-mscorefonts-installer_3.6_all.deb
sudo dpkg -i ttf-mscorefonts-installer_3.6_all.deb
The ttf-mscorefonts-installer package that apt-get tries to install is from Ubuntu repository, not from Debian repository (note that it depends on update-notifier-common >= 0.119ubuntu2).
You probably have mixed Debian and Ubuntu repositories in /etc/apt/sources.list.

Cannot install g++ on ubuntu 14.04.4 LTS (I have tried commands and software center)

I cannot install g++ on newly installed ubuntu 14.04.4 LTS.
When I use command sudo apt-get install g++, the terminal tell me:
cluster#cluster0-vm:~$ sudo apt-get install g++
[sudo] password for cluster:
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:
g++ : Depends: g++-4.8 (>= 4.8.2-5~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
I changed the source, and tried again, failed too.
cluster#cluster0-vm:~$ sudo apt-get install g++
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:
g++:i386 : Depends: cpp:i386 (>= 4:4.7.3-1ubuntu10) but it is not going to be installed
Depends: gcc:i386 (>= 4:4.7.3-1ubuntu10) but it is not going to be installed
Depends: g++-4.7:i386 (>= 4.7.3-1~) but it is not going to be installed
Depends: gcc-4.7:i386 (>= 4.7.3-1~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
I used the ubuntu software center to install g++, failed again......
Figure: Use ubuntu software center to install g++
This problem has been solved by changing another source.
I have tried 4 sources, and all of them have problems......OMG!
I think this will help:
sudo apt-get update
sudo apt-get -f install
sudo dpkg --configure -a
sudo apt-get clean
sudo apt-get install g++
Also this could help:
sudo dpkg --purge g++# Try this first
sudo dpkg --purge --force-depends g++# Try this ONLY if the previous line fails
sudo apt-get clean g++# Remove g++ from the cache
sudo apt-get install g++# Download and install the appropriate version of g++
If I had to guess, I would say there are other libc6, libc-dev, etc..files that need updating before you can update the C's and G's.
It seems that if you install build essentials then it will correct the problem.
If you look up the files on the ubuntu packages site and look at the dependencies, then compare them to what is on your machine, I bet you find you have an update conflict due to incompatible dependency version somewhere.
You could manually download them individually at the bottom of the repository page (a small table) then double click the deb files and they will start to install if all of the dependencies and versions are met and compatible.
Think of it as "A depends on B which depends on C which depends on D......" being installed. to some infinity no avail. Its a nightmare when doing it that way. But does force you to respect Synaptic and the apt-get thorough and detailed process and compatibility check.
Best to start with build essentials though.

apt-get install fails with Not Found error because package removed from repository

I've been attempting to install the package r-base on Ubuntu Trusty Tahr and there's a package dependency that became broken in the last week.
My commands are as follows:
apt-get update -y
apt-get dist-upgrade -y
apt-get install -y r-base-dev
...
Err http://archive.ubuntu.com/ubuntu/ trusty-security/main libpng12-dev amd64 1.2.50-1ubuntu2.14.04.1
404 Not Found [IP: 91.189.91.23 80]
Fetched 92.8 MB in 28s (3262 kB/s)
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/libp/libpng/libpng12-dev_1.2.50-1ubuntu2.14.04.1_amd64.deb 404 Not Found [IP: 91.189.91.23 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
The command '/bin/sh -c sudo apt-get install -y r-base-dev' returned a non-zero code: 100
I have attempted to pass --fix-missing and --ignore-missing but it still fails.
It appears that the package was removed on Jan 8, 2016 due to a security patch: https://launchpad.net/ubuntu/+archive/primary/+sourcepub/5711916/+listing-archive-extra
Looking at http://archive.ubuntu.com/ubuntu/pool/main/libp/libpng/ confirms that the ubuntu2.14.04.1 file is not there but 1.2.50-1ubuntu2.14.04.2 is present.
How do I fix that?
My goal is to get r-base to install.
If I could somehow make it use the version "2" file instead of "1" it would presumably find the file and proceed happily, but I'm not sure how to make apt-get do that.
Alternatively, maybe it's possible to update the dependency list on my side? Or is it up to the r-base maintainers to do so?
Or third, is it possible to add a repository that still has the old package? I'm not running on an AMD processor, so I shouldn't need this particular package at runtime anyway.
Update:
The solution that worked for me was to explicitly remove the package with the broken dependency, download the updated version, and re-install it before running apt-get update.
$ apt-get remove -y libpng12-0
$ curl -O http://archive.ubuntu.com/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.50-1ubuntu2.14.04.2_amd64.deb
$ dpkg -i libpng12-0_1.2.50-1ubuntu2.14.04.2_amd64.deb
$ apt-get update -y
The problem apparently doesn't have much to do with the r-base or r-base-dev packages, even though r-base-dev incidentally depends on libpng12.
In my opinion this problem will probably fix itself in a couple of days. However if you can't wait, here's what you can do.
First, find out which version of libpng the package you want to install depends on.
$ apt-cache depends r-base
r-base
Depends: r-base-core
Depends: r-recommended
Recommends: r-base-html
Recommends: r-doc-html
Suggests: ess
|Suggests: r-doc-info
Suggests: r-doc-pdf
r-base itself does not depend on libpng but r-base-core probably does.
$ apt-cache depends r-base-core | grep png
Depends: libpng12-0
Now we want to know which specific version of libpng
$ apt-cache show r-base-core
... libpng12-0 (>= 1.2.13-4) ...
If you locate this package in Ubuntu's repositories, you can
download it and try to install it manually.
$ wget <url>
$ sudo dpkg -i <filename>
and then install r-base with apt-get install r-base. However if dpkg
refuses to install libpng you should not force it, because it means the
package is not installable and it would break other dependencies.

Resources