I am new to the computing world. My intention is to figure out a generic approach to solve cyclic dependencies while installing new software on Linux, if it exists. Here I am using the case of Google chrome to better illustrate my question. While installing Google chrome (both using package manager and apt-get) I encounter the following problem:
Selecting previously unselected package google-chrome-stable.
(Reading database ... 262709 files and directories currently installed.)
Preparing to unpack google-chrome-stable_current_amd64.deb ...
Unpacking google-chrome-stable (55.0.2883.87-1) ...
dpkg: dependency problems prevent configuration of google-chrome-stable:
google-chrome-stable depends on libappindicator1; however:
Package libappindicator1 is not installed.
To solve the above error, I tried installing libappindicator1 but that returns another dependency error:
The following packages have unmet dependencies:
libappindicator1 : Depends: libindicator7 (>= 0.4.90) but it is not going to be installed
Now here we encounter the cyclic dependency. When trying to install libindicator7 the following error is received:
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
google-chrome-stable : Depends: libappindicator1 but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
As you can see that I cannot install the package because of the dependencies. Now one way is to use apt-get -f install and let Linux magically do it's work. But that won't teach me much. Using this example (or suggest a better example), can we figure out a better approach to solve the problem of cyclic dependency? If this is a stand-alone case of cyclic dependency while installing a new software or I made a mistake in interpreting the errors then I can remove the question.
Some helpful links-
[1]: https://askubuntu.com/questions/764040/im-having-a-hard-time-installing-google-chrome-on-16-04-lts-please-help [2]: How to solve Cyclic Dependency [3]: How to Solve Circular Dependency [4]: cyclic dependency ... how to solve?
The problem is usage of dpkg to install google-chrome-stable. DPKG does now install the required dependencies and leave the system in a broken state.
sudo apt install ./google-chrome-stable.deb
This installs the package with required dependencies.
dpkg only installs a package, so doing dpkg -i packageName.deb will only install this Deb package, and will notify you of any dependencies that need to be installed, but it will not install them, and it will not configure the packageName.deb because well...the dependencies are not there.
apt is a Package Management System that handles the installation of Deb packages on Debian-based Linux distributions. A Package Management System is a set of tools that will help you install, remove, and change packages easily. So apt is like a clever dpkg
DPKG is the software at the base of the package management system in the free operating system Debian and its numerous derivatives. dpkg is used to install, remove, and provide information about .deb packages. dpkg (Debian Package) itself is a low-level tool. [1]
APT (for Advanced Package Tool) is a set of tools for managing Debian packages, and therefore the applications installed on your Debian system. APT makes it possible to Install applications, Remove applications, Keep your applications up to date and much more.[2]
So if you move step by step on your installation
Once you download a .deb package you can unzip it. Unzip the contained control.tar.gz file. You would find a set of all the required packages.
Find all the dependencies for that specific Debian package. For google-chrome you would have something like
Package: google-chrome-stable
Version: 55.0.2883.87-1
Architecture: amd64
Maintainer: Chrome Linux Team <chromium-dev#chromium.org>
Installed-Size: 175549
Pre-Depends: dpkg (>= 1.14.0)
Depends: gconf-service, libasound2 (>= 1.0.16), libatk1.0-0 (>= 1.12.4), libc6 (>= 2.11), libcairo2 (>= 1.6.0), libcups2 (>= 1.4.0), libdbus-1-3 (>= 1.1.4), libexpat1 (>= 2.0.1), libfontconfig1 (>= 2.9.0), libfreetype6 (>= 2.3.9), libgcc1 (>= 1:4.1.1), libgconf-2-4 (>= 2.31.1), libgdk-pixbuf2.0-0 (>= 2.22.0), libglib2.0-0 (>= 2.26.0), libgtk2.0-0 (>= 2.24.0), libnspr4 (>= 2:4.9-2~) | libnspr4-0d (>= 1.8.0.10) | libnspr4 (>= 4.9.5-0ubuntu0), libnss3 (>= 2:3.13.4-2~) | libnss3-1d (>= 3.12.4), libpango1.0-0 (>= 1.14.0), libstdc++6 (>= 4.8.0), libx11-6 (>= 2:1.4.99.1), libx11-xcb1, libxcb1 (>= 1.6), libxcomposite1 (>= 1:0.3-1), libxcursor1 (>> 1.1.2), libxdamage1 (>= 1:1.1), libxext6, libxfixes3, libxi6 (>= 2:1.2.99.4), libxrandr2 (>= 2:1.2.99.3), libxrender1, libxss1, libxtst6, ca-certificates, fonts-liberation, libappindicator1, libnss3 (>= 3.17.2), lsb-base (>= 4.1), xdg-utils (>= 1.0.2), wget
Provides: www-browser
Section: web
Priority: optional
Description: The web browser from Google
Google Chrome is a browser that combines a minimal design with sophisticated technology to make the web faster, safer, and easier.
You would need to install all the dependencies for that specific package. Each dependency might depend on a set of other dependencies. You would have a tree of these dependencies. Either you can manually install all these dependencies or use something like apt or yum or aptitude ...
What either of these package managers would do for you is they would construct a dependency tree for you and install all the relevant packages before installing your Debian package.
So, Ideally there should not be any loops in the dependency tree, but it might be the case that some of the existing packages are already installed and are in newer/older version of what is currently installed and is a required package for an already existing installed package. Then you can end up in cyclic dependency loop.
So, how apt handles cyclic dependencies is mentioned in [3], I think you can consider it as a generic algorithm for solving a dependency manually but it's not recommended. Circular dependencies happen in the repositories, but the ones left standing to obey some specific rules. Usually, these are tightly bound packages. So the Depends relationship between them specifies the exact version number.
https://en.wikipedia.org/wiki/Dpkg
https://wiki.debian.org/Apt
https://web.archive.org/web/20150905091555/http://algebraicthunk.net/~dburrows/blog/entry/from-blogspot/2005-05-09--21:30:00/
What helped me with installing libappindicator1 on Debian and in Docker as well - is installing this package manually. Also, it depends on another one libindicator7.
RUN curl -p --insecure "http://ftp.de.debian.org/debian/pool/main/liba/libappindicator/libappindicator1_0.4.92-7_amd64.deb" --output libappindicator1_0.4.92-8_amd64.deb \
&& curl -p --insecure "http://ftp.de.debian.org/debian/pool/main/libi/libindicator/libindicator7_0.5.0-4_amd64.deb" --output libindicator7_0.5.0-4_amd64.deb \
&& dpkg -i libindicator7_0.5.0-4_amd64.deb \
&& dpkg -i libappindicator1_0.4.92-8_amd64.deb \
&& rm libindicator7_0.5.0-4_amd64.deb \
&& rm libappindicator1_0.4.92-8_amd64.deb
Related
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.
When I tried to remove python3.5 on ubuntu, it always reports error
sudo apt-get remove python3.5
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
python3-commandnotfound : Depends: python3-gdbm but it is not going to be installed
python3-pip : Depends: python-pip-whl (= 1.5.4-1ubuntu4) but it is not going to be installed
Recommends: python3-dev (>= 3.2) but it is not going to be installed
python3-software-properties : Depends: unattended-upgrades but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
In this case, I tried to reinstall the dependence, but finally, it always reports like
python3-commandnotfound : Depends: python3-gdbm but it is not going to be installed
python3-pip : Depends: python-pip-whl (= 1.5.4-1ubuntu4) but it is not going to be installed
Recommends: python3-dev (>= 3.2) but it is not going to be installed
I also tried apt-get remove/reinstall/autoremove/update/upgrade, but it deosn't work. I can see the same error finally. The dependence file is not going to be installed.
It looks I'm in a dead loop. How can I remove everything manually?
I'm trying to install Monodevelop from http://www.mono-project.com/docs/getting-started/install/linux/#debian-ubuntu-and-derivatives.
I'm using a virtual Box VM via Vagrant with an Ubuntu Precise 64 Guest OS
I have done this steps :
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
sudo apt-get update
echo "deb http://download.mono-project.com/repo/debian wheezy-libtiff-compat main" | sudo tee -a /etc/apt/sources.list.d/mono-xamarin.list
At this point, all seems OK.
But when I want to install the first package "mono-devel" by typing
sudo apt-get install mono-devel
I have the following error message
vagrant#precise64:~$ sudo apt-get install mono-devel
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:
mono-devel : Depends: libgdiplus (>= 2.6.7) but it is not going to be installed
Depends: libmono-system-design4.0-cil (>= 1.0) but it is not going to be installed
Depends: libmono-system-drawing4.0-cil (>= 3.0.6) but it is not going to be installed
Depends: libmono-system-messaging4.0-cil (>= 2.10.1) but it is not going to be installed
Depends: libmono-system-runtime4.0-cil (>= 2.10.1) but it is not going to be installed
Depends: libmono-system-servicemodel-activation4.0-cil (>= 1.0) but it is not going to be installed
Depends: libmono-system-servicemodel-web4.0-cil (>= 3.2.1) but it is not going to be installed
Depends: libmono-system-servicemodel4.0a-cil (>= 3.2.3) but it is not going to be installed
Depends: libmono-system-serviceprocess4.0-cil (>= 3.0.6) but it is not going to be installed
Depends: libmono-system-web-extensions4.0-cil (>= 2.10.3) but it is not going to be installed
Depends: libmono-system-web-services4.0-cil (>= 1.0) but it is not going to be installed
Depends: libmono-system-web-webpages-razor2.0-cil (>= 1.0) but it is not going to be installed
Depends: libmono-system-web-webpages2.0-cil (>= 1.0) but it is not going to be installed
Depends: libmono-system-web4.0-cil (>= 2.10.3) but it is not going to be installed
Depends: libmono-system-windows-forms4.0-cil (>= 1.0) but it is not going to be installed
Depends: libmono-cil-dev (= 4.4.1.0-0xamarin1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
vagrant#precise64:~$ lsb_release
No LSB modules are available.
vagrant#precise64:~$ cat /etc/issue
Ubuntu 12.04.5 LTS \n \l
I have also tried doing a "sudo apt-get upgrade" without any success.
I thought that apt could also download and install all package dependencies. Why the libraries files mentioned in the error message can't be loaded ?
How to solve the problem ? Is there a mistake somewhere ?
As SushiHangover advises me in the answer below, I have also tried to install libgdiplus but there is also an error message :
vagrant#precise64:~$ sudo apt-get install libgdiplus
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:
libgdiplus : Depends: libfontconfig1 (>= 2.9.0) but 2.8.0-3ubuntu9.1 is to be installed
Depends: libtiff5 (> 4.0.0-1~) but it is not installable
E: Unable to correct problems, you have held broken packages.
After manually installed libtiff5 package :
vagrant#precise64:/vagrant$ sudo apt-get install libgdiplus
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
libgdiplus : Depends: libcairo2 (>= 1.4) but it is not going to be installed
Depends: libexif12 but it is not going to be installed
Depends: libfontconfig1 (>= 2.9.0) but it is not going to be installed
Depends: libgif4 (>= 4.1.4) but it is not going to be installed
Depends: libjpeg8 (>= 8c) but it is not going to be installed
Depends: libxrender1 but it is not going to be installed
libtiff5 : Depends: libjbig0 (>= 2.0) but it is not installable
Depends: libjpeg8 (>= 8c) but it is not going to be installed
Depends: liblzma5 (>= 5.1.1alpha+20120614) but 5.1.1alpha+20110809-3 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
Try running this:
sudo apt-get install libgdiplus
If it results in:
~~~
libgdiplus : Depends: libjpeg62-turbo (>= 1.3.1) but it is not installable
~~~
Then you need to get the older libjpeg62 package:
wget http://ftp.br.debian.org/debian/pool/main/libj/libjpeg6b/libjpeg62_6b2-2_amd64.deb
sudo dpkg --install --recursive --auto-deconfigure libjpeg62_6b2-2_amd64.deb
Now you can:
sudo apt-get install mono-devel
sudo apt-get install monodevelop
New mono versions need libtiff5 package version >=4.0, and Ubuntu 12.x hasn't this package.
But this package version depends on other new packages or existing packages with newer versions...
There is a working solution (on amd64 platform):
wget http://mirrors.kernel.org/ubuntu/pool/main/f/fonts-freefont/fonts-freefont-ttf_20120503-4_all.deb
wget http://mirrors.kernel.org/ubuntu/pool/universe/f/fonts-freefont/ttf-freefont_20120503-4_all.deb
wget http://security.ubuntu.com/ubuntu/pool/main/f/fontconfig/fontconfig-config_2.11.0-0ubuntu4.2_all.deb
wget http://security.ubuntu.com/ubuntu/pool/main/f/fontconfig/libfontconfig1_2.11.0-0ubuntu4.2_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/main/j/jbigkit/libjbig0_2.1-3.1_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/main/x/xz-utils/liblzma5_5.1.1alpha+20120614-2ubuntu2_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/main/t/tiff/libtiff5_4.0.6-1_amd64.deb
sudo dpkg --install --recursive --auto-deconfigure fonts-freefont-ttf_20120503-4_all.deb
sudo dpkg --install --recursive --auto-deconfigure ttf-freefont_20120503-4_all.deb
sudo dpkg --install --recursive --auto-deconfigure fontconfig-config_2.11.0-0ubuntu4.2_all.deb
sudo dpkg --install --recursive --auto-deconfigure libfontconfig1_2.11.0-0ubuntu4.2_amd64.deb
sudo dpkg --install --recursive --auto-deconfigure libjbig0_2.1-3.1_amd64.deb
sudo dpkg --install --recursive --auto-deconfigure liblzma5_5.1.1alpha+20120614-2ubuntu2_amd64.deb
sudo dpkg --install --recursive --auto-deconfigure libtiff5_4.0.6-1_amd64.deb
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
sudo apt-get update
sudo apt-get install mono-devel
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.
I am trying to compile vpnshrew with CMAKE on linux mint.
However QT4 is missing and I have already tried everything with no success. The starting line it's this dependency error:
$ sudo apt-get install libqt4-core
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:
libqt4-core : Depends: libqt4-dbus (= 4:4.8.3+dfsg-0ubuntu3) but it is not going to be installed
Depends: libqt4-network (= 4:4.8.3+dfsg-0ubuntu3) but it is not going to be installed
Depends: libqt4-script (= 4:4.8.3+dfsg-0ubuntu3) but it is not going to be installed
Depends: libqt4-test (= 4:4.8.3+dfsg-0ubuntu3) but 4:4.8.3+dfsg-0ubuntu3.1 is to be installed
Depends: libqt4-xml (= 4:4.8.3+dfsg-0ubuntu3) but 4:4.8.3+dfsg-0ubuntu3.1 is to be installed
Depends: libqtcore4 (= 4:4.8.3+dfsg-0ubuntu3) but 4:4.8.3+dfsg-0ubuntu3.1 is to be installed
E: Unable to correct problems, you have held broken packages.
I have already tried lots of solutions. Namely
sudo dpkg --configure -a
sudo apt-get -f install
sudo apt-get update
Thanks in advance for any help.
Try sudo apt-get install qt4-dev-tools libqt4-dev libqt4-core libqt4-gui.