DEV Community

Discussion on: Getting Cozy With Debian Buster

Collapse
 
flrnd profile image
Florian Rand • Edited

Great readings both articles. Let me share how I manage packages in my Debian system and install from unstable and testing without breaking things.

The thing is to create separate config files for stable, testing and unstable, and configure it so packages priority comes like so: Stable > Testing > Unstable.


/etc/apt/preferences.d/stable.pref

# 500 <= P < 990: causes a version to be installed unless there is a
# version available belonging to the target release or the installed
# version is more recent

Package: *
Pin: release a=stable
Pin-Priority: 900


/etc/apt/preferences.d/testing.pref

# 100 <= P < 500: causes a version to be installed unless there is a
# version available belonging to some other distribution or the installed
# version is more recent

Package: *
Pin: release a=testing
Pin-Priority: 400

/etc/apt/preferences.d/unstable.pref

# 0 < P < 100: causes a version to be installed only if there is no
# installed version of the package

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

now in /etc/apt/sources.list.d/

/etc/apt/sources.list.d/stable.list

# stable
deb http://ftp.debian.org/debian/ stable main non-free contrib
deb-src http://ftp.debian.org/debian/ stable main non-free contrib

deb http://security.debian.org/debian-security stable/updates main contrib non-free
deb-src http://security.debian.org/debian-security stable/updates main contrib non-free

# stable-updates, previously known as 'volatile'
deb http://ftp.debian.org/debian/ stable-updates main contrib non-free
deb-src http://ftp.debian.org/debian/ stable-updates main contrib non-free

# buster-backports, previously on backports.debian.org
deb http://ftp.debian.org/debian/ buster-backports main contrib non-free
deb-src http://ftp.debian.org/debian/ buster-backports main contrib non-free



/etc/apt/sources.list.d/testing.list

# testing
deb http://ftp.debian.org/debian/ testing main non-free contrib
deb-src http://ftp.debian.org/debian/ testing main non-free contrib

deb http://security.debian.org/ testing-security main contrib non-free
deb-src http://security.debian.org/ testing-security main contrib non-free

# testing-updates, previously known as 'volatile'
deb http://ftp.debian.org/debian/ testing-updates main contrib non-free
deb-src http://ftp.debian.org/debian/ testing-updates main contrib non-free



/etc/apt/sources.list.d/unstable.list

# unstable
deb http://ftp.debian.org/debian/ unstable main non-free contrib
deb-src http://ftp.debian.org/debian/ unstable main non-free contrib

Rename your /etc/apt/sources.list into /etc/apt/sources.list.old to use the new stabe, testing, unstable list created.

NEVER install ubuntu PPAs (wiki.debian.org/DontBreakDebian), if you need a more recent package (be aware of installing things like KDE or other huge packages with a lot of dependencies) just apt -t unstable install firefox (or -t testing). There are also backports.debian.org/ at your disposal.

For Haskell, rust, node, go and ruby I use github.com/asdf-vm/asdf. Docker, Mongo, Vscode and other stuff I install from their official packages (not the debian ones). That way I have an up-to-date runtime and devel environment with a rock-solid base system.

Compared to gentoo, debian package system is like you said horrid, but backport packages from testing/unstable to stable is not that difficult: wiki.debian.org/BuildingFormalBack...

Anyway, good luck and I'm looking forward to reading the 3rd part of this series!

Collapse
 
deciduously profile image
Ben Lovy

Incredible, thank you SO much for the write up! This is precisely what I was looking for, this config setup is the first thing I'll do when I get back home today.

NEVER install ubuntu PPAs

I was worried about that. Fair enough. To fix the damage, will it be sufficient for me to apt purge the offending package, remove the offending line from sources.list, then do an apt update && apt autoremove? Then, to actually obtain the needed package, they only provide Ubuntu .deb files and generic tarballs. When you run into a similar situation, do you just stick to the tarball or try to build a Debian package?

Haskell, rust, node, go and ruby

Asdf has been on my radar for some time but I never got around to trying it - Gentoo covered my needs out of the box here. I'm not opinionated about any of these except Rust, which I use rustup for. What's the benefit of using asdf instead?

their official packages

I noticed when I installed VS Code it actually added a PPA for me during the transaction, which is both awesome (I thought it was forever going to be up to me) and scary (I didn't even know a package could do that, and I don't recall apt letting me know it was taking that action). Have you run into packages where this behavior is problematic, or should that generally be the accepted solution?

Thanks again, huge help!

Collapse
 
flrnd profile image
Florian Rand • Edited

I forgot about those situations where only Ubuntu packages (or no packages at all) are available (hello AMD). In those cases I directly use the tarball, the only downside is that I have to update it manually. In my case, it's very simple because as for today I don't use/need any external software not covered by Debian packages. However, I doubt that you are going to run into any problem with just the Vulkan SDK, so, if it works right now, let it be, but next time try to avoid using Ubuntu packages unless there is no other option :).

Asdf has been on my radar for some time but I never got around to trying it - Gentoo covered my needs out of the box here. I'm not opinionated about any of these except Rust, which I use rustup for. What's the benefit of using asdf instead?

I didn't know about rustup! I only toyed with rust but nothing serious.

I use asdf because I'm lazy and having one tool to rule them all seems convenient, but I don't think it has any real advantage over rustup.

I noticed when I installed VS Code it actually added a PPA for me during the transaction, which is both awesome (I thought it was forever going to be up to me) and scary (I didn't even know a package could do that, and I don't recall apt letting me know it was taking that action). Have you run into packages where this behavior is problematic, or should that generally be the accepted solution?

Some Debian packages install in your /etc/source.list.d/ a .list archive with a repository. For example, in the case of VSCode: http://packages.microsoft.com/repos/vscode stable main. The main difference is that this repository is maintained by Microsoft instead of the community. Other examples, like Docker: https://download.docker.com/linux/debian buster stable.

These repositories tend to stay up-to-date, as a rule of thumb, if there is an official repo/package I install them over the stable packages unless I don't care about the version.

Don't break Debian wiki page has really good advice.

Lastly, Glad to help and welcome to the Boretown!

Thread Thread
 
deciduously profile image
Ben Lovy

Heh, I made it maybe 90 minutes before breaking a core "Don't Break Debian" tenet. That's a great link, will definitely be more careful going forward - might just clean this up anyway and switch to the tarball to keep it clean.

I do think asdf sounds good in general - I use Rust a lot but the rest of those languages are more casual, experimental things for me so it's a perfect fit. Good stuff!

Thread Thread
 
andresdandrea profile image
andresdandrea

Great exchange! I learned a lot, specially with the first reply of @flrnd and the way to set up stable -> testing -> unstable repos. Thanks A LOT for sharing your knowledge Florian :)