3

Learn about your package manager

 3 years ago
source link: https://drewdevault.com/2018/01/10/Learn-your-package-manager.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Learn about your package manager

Learn about your package manager January 10, 2018 on Drew DeVault's blog

Tools like virtualenv, rbenv, and to a lesser extent npm and pip, are occasionally useful in development but encourage bad practices in production. Many people forget that their distro already has a package manager! And there’s more– you, the user, can write packages for it!

Your distro’s package repositories probably already have a lot of your dependencies, and can conveniently update your software alongside the rest of your system. On the whole you can expect your distro packages to be much better citizens on your system than a language-specific package manager will be. Additionally, pretty much all distros provide a means for you to host your own package repositories, from which you can install and update any packages you choose to make.

If you find some packages to be outdated, find out who the package maintainer is and shoot them an email. Or better yet - find out how the package is built and send them a patch instead. Linux distributions are run by volunteers, and it’s easy to volunteer yourself! Even if you find missing packages, it’s a simple matter to whip up a package yourself and submit it for inclusion in your distro’s package repository, installing it from your private repo in the meanwhile.

“But what if dependencies update and break my stuff?”, you ask. First of all, why aren’t you keeping your dependencies up-to-date? That aside, some distros, like Alpine, let you pin packages to a specific version. Also, using the distro’s package manager doesn’t necessarily mean you have to use the distro’s package repositories - you can stand up your own repos and prioritize it over the distro repos, then release on any schedule you want.

In my opinion, the perfect deployment strategy for some software is pushing a new package to your package repository, then SSHing into your fleet and running system updates (probably automatically). This is how I manage deployments for most of my software. As a bonus, these packages offer a good place to configure things that your language’s package manager may be ill suited to, such as service files or setting up new users/groups on the system. Consider it!

Have a comment on one of my posts? Start a discussion in my public inbox by sending an email to ~sircmpwn/[email protected] [mailing list etiquette]

Articles from blogs I read Generated by openring

Go on ARM and Beyond

The industry is abuzz about non-x86 processors recently, so we thought it would be worth a brief post about Go’s support for them. It has always been important to us for Go to be portable, not overfitting to any particular operating sys…

via The Go Programming Language Blog December 17, 2020

Status update, December 2020

Hi all! This status update is the 24th one, so it’s been 2 years I’ve started writing those now (ignoring a little hiatus). Time flies! This month I’ve invested a lot of time into wlroots. My main focus has been renderer v6, which has now been internally rol…

via emersion December 16, 2020

What's cooking on Sourcehut? December 2020

A brisk wind of winter chill sets a stir down my spine, as I sit down with a fresh cup of coffee to yarn a story of careful engineering and passionate spirit that took place over the course of 30 days. The last 30 days. Cause this is the monthly “what’s cook…

via Blogs on Sourcehut December 15, 2020
The content for this site is CC-BY-SA. The code for this site is MIT.

Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK