惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

GbyAI
GbyAI
博客园 - 三生石上(FineUI控件)
S
Securelist
U
Unit 42
The Cloudflare Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Simon Willison's Weblog
Simon Willison's Weblog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
B
Blog
T
Tenable Blog
The Hacker News
The Hacker News
The Register - Security
The Register - Security
IT之家
IT之家
博客园 - 【当耐特】
Spread Privacy
Spread Privacy
P
Privacy & Cybersecurity Law Blog
博客园_首页
T
Tailwind CSS Blog
人人都是产品经理
人人都是产品经理
C
Cybersecurity and Infrastructure Security Agency CISA
Know Your Adversary
Know Your Adversary
NISL@THU
NISL@THU
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
阮一峰的网络日志
阮一峰的网络日志
T
Tor Project blog
C
CERT Recently Published Vulnerability Notes
Apple Machine Learning Research
Apple Machine Learning Research
Stack Overflow Blog
Stack Overflow Blog
T
Threat Research - Cisco Blogs
T
The Exploit Database - CXSecurity.com
V
Vulnerabilities – Threatpost
A
Arctic Wolf
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
V
V2EX
aimingoo的专栏
aimingoo的专栏
大猫的无限游戏
大猫的无限游戏
Scott Helme
Scott Helme
L
LINUX DO - 热门话题
Cyberwarzone
Cyberwarzone
V
Visual Studio Blog
月光博客
月光博客
爱范儿
爱范儿
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
美团技术团队
G
GRAHAM CLULEY
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
H
Heimdal Security Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Stop Hand-Editing Fragile APT Lines: Practical deb822 `.sources` Files for Debian and Ubuntu
Lyra · 2026-06-12 · via DEV Community

If you still manage APT repositories as long one-line deb ... entries, you are working with a format APT now explicitly marks as deprecated. It still works, but it is harder to read, harder to automate safely, and easier to get wrong when you add options like arch= or signed-by=.

The better option is deb822 style .sources files.

This post shows how to:

  • read the structure of a .sources file
  • migrate a legacy .list entry safely
  • use Signed-By without falling back to apt-key
  • disable a repository cleanly without deleting it
  • verify that APT accepts the new configuration

I am focusing on practical host administration, not packaging theory.

Why move to deb822 now?

The sources.list(5) man page now says the traditional one-line .list format is deprecated and may eventually be removed, though not before 2029.

More importantly, deb822 solves real operational annoyances:

  • fields are explicit instead of positional
  • one stanza can describe multiple suites or types
  • Enabled: no is cleaner than commenting lines in and out
  • machine parsing is much easier
  • Signed-By is clearer and safer in structured form

On a current Debian host, you may already be using it without noticing:

find /etc/apt/sources.list.d -maxdepth 1 -type f -name '*.sources'

On my test system, the default Debian repository is already stored as /etc/apt/sources.list.d/debian.sources.

The old format vs the new format

A traditional one-line entry looks like this:

deb [arch=amd64 signed-by=/etc/apt/keyrings/example.gpg] https://packages.example.com/apt stable main

The same source in deb822 format becomes:

Types: deb
URIs: https://packages.example.com/apt
Suites: stable
Components: main
Architectures: amd64
Signed-By: /etc/apt/keyrings/example.gpg

That is the core win. Instead of cramming everything into one line and hoping spacing stays correct, each field says exactly what it means.

Example 1, a clean Debian .sources file

Here is a practical example for Debian using separate stanzas for the main archive and the security archive:

Types: deb deb-src
URIs: http://deb.debian.org/debian
Suites: trixie trixie-updates
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

Types: deb deb-src
URIs: http://deb.debian.org/debian-security
Suites: trixie-security
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

This structure comes straight from the current sources.list(5) guidance.

A few useful details:

  • Types: can include both deb and deb-src
  • Suites: can contain multiple suites in one stanza
  • values are whitespace-separated, not comma-separated
  • the file extension must be .sources

Example 2, migrating a third-party repo from .list to .sources

Suppose you currently have this legacy entry:

deb [arch=amd64 signed-by=/etc/apt/keyrings/vendor.asc] https://repo.vendor.example stable main

Create /etc/apt/sources.list.d/vendor.sources:

Types: deb
URIs: https://repo.vendor.example
Suites: stable
Components: main
Architectures: amd64
Signed-By: /etc/apt/keyrings/vendor.asc

Then disable or remove the old .list file so APT does not see duplicate definitions.

A safe migration workflow

Here is the workflow I recommend on a real machine.

1) Inspect current sources

grep -R "^[[:space:]]*deb " -n /etc/apt/sources.list /etc/apt/sources.list.d 2>/dev/null
find /etc/apt/sources.list.d -maxdepth 1 -type f \( -name '*.list' -o -name '*.sources' \) | sort

This gives you a quick inventory of legacy one-line entries and existing deb822 files.

2) Back up the file you are changing

sudo cp /etc/apt/sources.list.d/vendor.list /etc/apt/sources.list.d/vendor.list.bak

3) Write the new .sources file

sudo tee /etc/apt/sources.list.d/vendor.sources >/dev/null <<'EOF'
Types: deb
URIs: https://repo.vendor.example
Suites: stable
Components: main
Architectures: amd64
Signed-By: /etc/apt/keyrings/vendor.asc
EOF

4) Disable the legacy file

The cleanest option is usually to rename it out of the way:

sudo mv /etc/apt/sources.list.d/vendor.list /etc/apt/sources.list.d/vendor.list.disabled

Why rename it instead of leaving both? Because duplicate definitions are noisy at best and confusing at worst.

5) Validate the result

sudo apt update
apt policy

If the repository metadata updates cleanly and apt policy looks normal, the migration is good.

Enabled: no is better than comment gymnastics

One of my favorite deb822 features is that you can disable a repository without deleting it or commenting every line.

Enabled: no
Types: deb
URIs: https://repo.vendor.example
Suites: stable
Components: main
Signed-By: /etc/apt/keyrings/vendor.asc

That is much easier to audit later than a half-commented .list file.

This is especially handy for:

  • temporarily disabling a staging repo
  • leaving a documented rollback option in place
  • keeping a source definition around while troubleshooting

Stop using apt-key for new repository setups

If you still have old install notes using apt-key add, retire them.

The apt-key(8) man page is explicit:

  • apt-key is deprecated
  • it is expected to disappear after its supported transition window
  • /etc/apt/keyrings is the recommended location for extra keys not managed by packages
  • Signed-By is the recommended way to bind a repository to a specific key

A modern pattern looks like this:

sudo install -d -m 0755 /etc/apt/keyrings
curl -fsSL https://repo.vendor.example/key.asc | sudo tee /etc/apt/keyrings/vendor.asc >/dev/null
sudo chmod 0644 /etc/apt/keyrings/vendor.asc

Then reference that key directly:

Types: deb
URIs: https://repo.vendor.example
Suites: stable
Components: main
Signed-By: /etc/apt/keyrings/vendor.asc

That is much better than dropping every third-party key into a globally trusted bucket.

Embedded keys are possible, but file-based keys are easier to maintain

Current APT documentation also allows embedding an ASCII-armored public key directly inside a deb822 .sources file when using Signed-By:.

That is useful in some immutable-image or generated-config workflows.

For day-to-day admin work, I still prefer a separate key file in /etc/apt/keyrings/ because it is easier to:

  • rotate
  • diff
  • replace with configuration management
  • audit with normal filesystem tooling

Small deb822 details that are easy to miss

A few gotchas are worth remembering:

  • .sources files use whitespace-separated multivalue fields
  • legacy .list option lists often use commas inside brackets
  • filenames in sources.list.d should use only letters, digits, underscore, hyphen, and period
  • if Suites: is an exact path ending with /, then Components: must be omitted
  • older APT versions before 1.1 ignore deb822 files

That last point mostly matters for very old systems. On modern Debian and Ubuntu systems, deb822 support is normal.

A practical audit you can run today

If you want a quick cleanup target, look for three things:

Legacy .list files

find /etc/apt/sources.list.d -maxdepth 1 -type f -name '*.list' | sort

Old key placement

sudo apt-key list

You will get a deprecation warning, which is the point here. This is useful for finding old trust material that still needs migration.

Repositories already using deb822

grep -R "^Signed-By:" /etc/apt/sources.list.d/*.sources 2>/dev/null

That gives you a fast picture of which repositories are already on the modern path.

When I would not rush a migration

I would not churn a stable production machine just to convert every file for aesthetic reasons.

If a repo is package-managed and already working cleanly, leave it alone unless you have a specific reason:

  • you are standardizing fleet configuration
  • you need clearer automation
  • you are cleaning up apt-key legacy warnings
  • you want per-repository trust boundaries with Signed-By

The point is not to rewrite everything. The point is to make future repository management safer and less fragile.

Final take

deb822 .sources files are not just prettier APT config.

They are easier to review, easier to automate, and a better fit for the way modern Debian and Ubuntu systems handle repository trust. If you touch repository configuration more than once in a while, this format is worth adopting now instead of waiting until a legacy .list edge case bites you.

If your current repository instructions still involve a dense deb [...] ... line and apt-key add, that is a good sign the docs need a refresh.

Sources and references