How do you add Debian experimental repo to Ubuntu, for those understanding the risks associated?

12,712

Solution 1

Sorry for this long answer, but the previous answers are all erroneous in one way or another, so I hope this attempt to be a bit of help to everyone.

Besides "experimental", Debian has several streams of packages that it calls "distribution". And every such distribution has its very own name. The current stable distribution was just released and is called "buster". Before that, now referred to as "oldstable" was "stretch", before that was oldoldstable "jessie". The 5/2013 released "wheezy" still sees another year of long-term support (https://wiki.debian.org/LTS). The one that is under current development is always called "testing", and it also always has a name that testing will be known to at the time it is released, this is "bullseye" now. There is also a distribution to which developers upload new packages, which is "unstable" and runs under the permanent name "sid". Packages uploaded to sid are auto-transferred to testing if there was no critical bug assigned to it during the first days (the uploader says how many days) of presence in unstable. For non-critical machines it is perfectly fine to run testing or unstable. The "unstable" refers to packages changing a lot, not to "software that crashes".

Experimental is kind of special in that

  • it only has the name "experimental", no assignment to a toy story character
  • it has a dual use as an ever lasting repository for packages that are not considered ready for the general public to use and
  • as a temporary store for packages while the release is finalised and new uploads are put on hold ("freeze").
  • packages are auto-removed from experimental when newer versions of a software appear on unstable

Debian developers typically expect users of testing or unstable to be the ones that install packages from experimental. Users of stable are likely to need updates to libraries. A recent version of Ubuntu should be fine with installing Debian packages from experimental directly, you would indeed just add

 deb http://httpredir.debian.org/debian/ experimental main contrib non-free

to your /etc/apt/sources.list but this is not what I tend to recommend. It depends a bit on the number of packages that are dragged in by the update and the dependencies on specific versions of libraries. If it is too many that apt-get suggests to install, then stop the installation if you fear a negative effect on your other binaries.

Instead, I suggest that you compile the software yourself. You may add

 deb-src http://httpredir.debian.org/debian/ experimental main contrib non-free

to sources.list (instead or in addition to the prior mentioned line describing a source for binary packages) and after apt-get update do

 apt-get build-dep wantedpackagename # installs build dependencies
 apt-get source --compile wantedpackagename # fetches source and builds

If the right version is downloaded you see at the time of the download. For binaries, have not tried with apt-get source, to retrieve from the experimental section you may also from Ubuntu need to specify "-t experimental" as additional flags to apt-get install. With apt-cache show wantedpackagename you see all versions of the package available to the system.

When building from source, there is absolutely no risk at all to damange your system since you leave all libraries at the version that your regular distribution already offers. There should hence be no side-effects. If the build fails, then it may already fail because the build dependencies could not be matched upfront. With build dependencies matched, a failed build you may decide to report to the package maintainer to improve his build instructions and possibly continue working on the package together. It is common for a package maintainer to be very happy about constructive feedback, so do not be shy.

Solution 2

If you already understand the risks associated with this, then you can follow these steps:

  1. sudo touch /etc/apt/apt.conf.d/debian_repos.conf
  2. sudo nano /etc/apt/apt.conf.d/debian_repos.conf
  3. add your repo (eg. deb http://deb.debian.org/debian/ oldstable main contrib non-free)
  4. CTRL + X
  5. Y
  6. apt-get update
  7. sudo apt-get install (packagename)

I would heartily recommend that you do not do this, because of stability; security and conflicting updates.

To pin the default distro updates, create a file sudo touch /etc/apt/preferences.d/unstable and paste the following inside:

Package: *
Pin: release v=12.04, l=Ubuntu
Pin-Priority: 1000

Package: *
Pin: release a=unstable
Pin-Priority: 600

Save & close.

This should only install updates from the debian repo, if they are not found in the Ubuntu repos first.

Sources:

Share:
12,712

Related videos on Youtube

Anon
Author by

Anon

Specialties: Keyboard Layouts Audiobooks and Text to Speech Qt

Updated on September 18, 2022

Comments

  • Anon
    Anon over 1 year

    This question was asked previously, however the answers in this question are intent to tell why that is a poor idea.

    How to add Debian experimental repo to Ubuntu?

    No actual answer is actually provided, due to the actual issue at hand being tangential. So for the daring, how do you add Debian experimental repo to Ubuntu?

    Thanks.

  • ravery
    ravery almost 7 years
    he wants experimental not jessie
  • AnotherKiwiGuy
    AnotherKiwiGuy almost 7 years
    @ravery - Yes, I know. I gave generic instructions, so he can add any repo he wants. Note the "eg." in my writing.
  • AnotherKiwiGuy
    AnotherKiwiGuy almost 7 years
    @ravery - Yes, I know. Why are you pushing this?
  • ravery
    ravery almost 7 years
    1) your answer doesn't add the repo, it replaces his repos. 2) you pointed to the wrong repo
  • AnotherKiwiGuy
    AnotherKiwiGuy almost 7 years
    @ravery - It is a complete answer that shows him how to add his own repos, any way he wants. It solves part of the update issues that your answer does not address. It does not replace his repos at all, it creates a new conf. The repo is a generic example. Please move along.
  • Gummysaur
    Gummysaur almost 7 years
    This adds "sid", aka "unstable", not "experimental".
  • ravery
    ravery almost 7 years
    @smoe then which is experimental? of the 4 choices you have (oldstable, stable, testing, unstable) I would think I identified correctly.
  • chaskes
    chaskes almost 7 years
  • Anon
    Anon almost 7 years
    Great Answer. I will add that after adding the repo, I only used it to install a few experimental packages which would solve dependencies using the experimental repo. It allowed me for example to get Qt 5.9 packages in Ubuntu, which was necessary for building my software. I wouldnt however dream of using it in a system update.