DEV Community

Cover image for Getting Cozy With Debian Buster

Getting Cozy With Debian Buster

Ben Lovy on January 01, 2020

Yes, Really, Even After All That This was an unexpectedly phenomenal discussion: Au Revoir, Gent...
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 :)

Collapse
 
adnan360 profile image
Adnan Shameem • Edited

Weirdly usermod lives in /usr/sbin but that's not in $PATH by default, so I added export PATH="$PATH:/usr/sbin/" to .bashrc for both root and my non-admin account.

I faced the same issue recently on a Devuan install. I think you can do this too:

su
sudo usermod -aG sudo ben

Then you won't need to change $PATH and stuff.

Great article to read. As far as I know you can't go wrong with Debian. It can be what you want it to be.

Personally however, I did not have a good experience with upgrading a point release distro, ever. So I usually choose rolling release distros for my work machines. Rolling releases are getting better now and they are quite reliable. If I were to use Debian, I would go with Devuan (because SystemD is too much of a bloat for me) and go with testing repos. That would give me a rolling release type of a setup with latest packages and reasonable stability.

Outside of Debian, I would choose Void Linux. It is so much faster that I couldn't believe when I first installed it on my system. It runs blazingly fast with runit init system, instead of SystemD. I was a skeptic at first to use a new init system, but it was surprisingly easy and felt like how an init system should work. Everything is a file, like unix philosophy says and so light. I even ran GNOME3 from a EXT4 (without journal) filesystem from a USB flashdrive, which I could not do with Arch with that responsiveness.

But whatever works for you is the best distro to go with.

Collapse
 
deciduously profile image
Ben Lovy

Ah, thanks! on My Debian install /usr/sbin wasn't in root's $PATH either, but it's possible I missed something.

I hadn't heard of Devuan, thanks for the suggestion. Good to note about point release updates, I've really only ever used rolling release so I'm sort of waiting to see how that goes in April.

I was also curious about SystemD, because I've used OpenRC for years, but it doesn't bother me. Sure, it does a lot more, but I've found it highly easy to use - I guess it's a personal preference thing. I have pretty standard needs.

I do already use Void Linux on my laptop, and love it, but have had trouble getting some of my development tools like dotnet installed. I'm not quite ready to use it exclusively, but in generally think very highly of it.

Thanks for your thoughts!

Collapse
 
mbrtn profile image
Ruslan Shashkov

So you've finally going Debian I see? 😌

Collapse
 
bjornor profile image
BjornOR • Edited

I'm having an extremely hard time setting up dual wifi on the raspberry Pi 4. The purpose is to be able to leave it hooked up to my monitor in my work space which isn't in the same room as my router.

Collapse
 
nguyenkien profile image
Nguyễn Trung Kiên

No snap please