2

As far as my understanding,

  1. If we install package from only official repository (sudo apt install package-name, installing from software center, sudo apt install ./official-deb ), all the package dependencies will be properly handled by apt and no dependencies problem will occur.
  2. Installing using PPAs, and building from the source, might lead to dependency problem at install time itself or in future.

How about if I install a .deb package which is not part of official repository (like Chrome .deb package), by doing sudo apt install ./chrome.deb. Can it lead to dependency problem while installation itself and/or future update with sudo apt update && .....? If yes, is it possible to configure it so that dependencies will be handled by apt?

P.S. Sorry if it is basic question.

  • I've installed several sw installing from terminal with "sudo dpkg -i packagename" or by using gdebi and most of the time the dependency have been solved automatically by the system. – pat Oct 14 '20 at 21:04
2

In short, yes. Pretty much every method of installation in Linux (except for maybe appimages and snaps) is bound to have dependency problems. However, the point of using apt to install .deb files is that it can still find dependencies. You can still have dependency problems with .deb files and apt, but they are not as common as installing them with dpkg -i as your original post said (which is almost guaranteed to have dependency problems). In my opinion, your best bet is to just install it with apt and hope. :) apt will usually figure it out for you, especially with a popular package like Google Chrome, which is intended to be easily installed. Also, just to clarify, you do use apt to install from PPAs, just after you've added them to your source lists. So while you can run into dependency problems with .deb(s), you can just as easily do this with apt install, even from the official repos.

UPDATE

In a comment, you stated you were more concerned about dependency problems caused by updates due to differences in versions of libraries. I moved my answer in the comments here, and added some stuff aswell:

This can happen, but again, there's not much more of a chance of this happening with .debs than with official repos. If packages are listed as conflicting with each other, apt will throw an error, no matter the source of the files. Packages can also list a range of versions for dependencies they work with. These can be viewed by apt or online at http://packages.ubuntu.com. I can't think of any with an upper range, but you can see this on a package like https://packages.ubuntu.com/focal/htop, which has several dependencies listed with minimum versions. Additionally, some libraries are integrated into the code at compile time, and thus not shared between packages. And a lot of libraries themselves have protections against this: backwards and forwards compatibility.

3

Yes and No.

It'll depend what is inside the package, and what if any dependencies it has & requires. There are many packages which have NO impact on anything else, but most will have impact. It'll depend on the package.

In your example google-chrome-stable, on my system it reports

guiverc@d960-ubu2:/de2900/lubuntu_64$   apt-cache depends google-chrome-stable
google-chrome-stable
  PreDepends: dpkg
    dpkg:i386
  Depends: ca-certificates
  Depends: fonts-liberation
  Depends: libasound2
  Depends: libatk-bridge2.0-0
  Depends: libatk1.0-0
  Depends: libatspi2.0-0
  Depends: libc6
  Depends: libcairo2
  Depends: libcups2
  Depends: libdbus-1-3
  Depends: libdrm2
  Depends: libexpat1
  Depends: libgbm1
  Depends: <libgcc1>
    libgcc-s1
  Depends: libgdk-pixbuf2.0-0
  Depends: libglib2.0-0
  Depends: libgtk-3-0
  Depends: libnspr4
  Depends: libnss3
  Depends: libpango-1.0-0
  Depends: libpangocairo-1.0-0
  Depends: libx11-6
  Depends: libx11-xcb1
  Depends: libxcb-dri3-0
  Depends: libxcb1
  Depends: libxcomposite1
  Depends: libxdamage1
  Depends: libxext6
  Depends: libxfixes3
  Depends: libxrandr2
  Depends: wget
    wget:i386
  Depends: xdg-utils
  Recommends: libu2f-udev
  Recommends: libvulkan1

Controlling the dependencies are done during the packaging step, ie. Ubuntu devs and Google folks who create the packages themselves.

For Ubuntu repository packages, depends rules can be see via https://packages.ubuntu.com/ , as well as via commands. It's not as easy with 3rd party packages like google-chrome-stable (thus I resorted to a quick example from my own box & command enquiry).

  • 1
    If a package has mis-configured dependencies, myself I'd for sure not work around it, I'd likely file a bug (so they can be fixed), or re-build the package myself & use my own version (that I would have a greater understanding of given I'd have hopefully learnt a little by peeking inside during the re-build process; ie. I wouldn't just copy & paste commands but review & build). If dep rules are there, I'd assume there is a reason thus would look for that reason before I just erased it with rebuild. – guiverc Oct 14 '20 at 21:40
  • 1
    @SagarAdhikari this can happen, but again, there's not much more of a chance of this happening with .debs than with official repos. If packages are listed as conflicting with each other, apt will throw an error, no matter the source of the files. Additionally, many libraries are integrated into the code at compile time, and thus not shared between packages. And a lot of libraries themselves have protections against this; backwards and forwards compatibility. – Pixelated Fish Oct 15 '20 at 2:40
  • 1
    Yes it can happen with 3rd party repos/software used. All Ubuntu repository software is checked (automatic quality testing) ensures any change will not impact any other repository software for the same release, but that QA testing does not include any 3rd party packages (outside of multiverse & restricted). Problems can occur into the future with 3rd party; as it's up to the 3rd party to ensure it doesn't happen OR better add their packages to the Ubuntu repositories (via 'universe' or community supported or other [multiverse/restricted]; then it's covered in automatic QA). – guiverc Oct 15 '20 at 2:56
  • 1
    How you deal with it is up to you. I tend to make judgement on what problems there will be in the future before I install the package. Myself I'd opt to use chromium-browser over chrome (fully open source & managed automatically by Ubuntu). There was a question here (this site) earlier today on setting up a ML for a package update being available (any release not just the installed one) could probably be implemented for this.. but I'd not bother. Yes uninstalling & fixing (re-install or looking for alternative) could be used but I'd rather maintenance free options (decide before installing) – guiverc Oct 15 '20 at 3:04
  • 1
    Your last comment I felt was already replied to with my 2nd comment (on this answer)... I think we've gone in circles – guiverc Oct 15 '20 at 3:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.