如何在Debian系统的Chromebook上为/etc/apt/sources.list添加non-free组件以安装Steam
Hey there! I totally get how overwhelming this can be when you're new to Debian—let's take this one step at a time, nice and slow. The issue you're hitting is that deb http://deb.debian.org/debian/ buster main contrib non-free isn't a command you run directly; it's a repository entry that needs to be added to your system's source list files. Here's exactly what to do:
Step 1: Back up your existing sources list (just in case!)
First, let's make a copy of your current source file so we can revert if something goes wrong. Open your terminal and run this command:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudolets you run commands with administrator (root) privileges—you'll need to enter your Chromebook's password when prompted.cpis the "copy" command, so this creates a backup namedsources.list.bakof your original file.
Step 2: Edit the main sources list file
We'll use nano, a simple text editor that works directly in the terminal (no fancy GUI needed). Run this command to open the file:
sudo nano /etc/apt/sources.list
Once the file opens, look for lines that start with deb http://deb.debian.org/debian/ buster main. It might look something like this:
deb http://deb.debian.org/debian/ buster main
deb-src http://deb.debian.org/debian/ buster main
Modify those lines to add contrib non-free at the end, so they become:
deb http://deb.debian.org/debian/ buster main contrib non-free
deb-src http://deb.debian.org/debian/ buster main contrib non-free
If you don't see these lines at all, just paste the two modified lines somewhere in the file.
Step 3: Save and exit the editor
- Press
Ctrl + O(that's the letter O, not zero) to save the changes. When prompted, press Enter to confirm the filename. - Press
Ctrl + Xto exit the nano editor.
Step 4: Update your system's package cache
Now tell Debian to fetch the latest information from the new repositories you added. Run this command:
sudo apt update
This might take a minute, and you'll see some text scrolling by—this is normal!
Alternative: Create a separate source file (instead of editing the main one)
If you'd rather not modify the original sources.list file, you can create a new file just for Steam's required repositories:
- Run this command to create and open a new file called
steam.listin thesources.list.dfolder:sudo nano /etc/apt/sources.list.d/steam.list - Paste this line into the file:
deb http://deb.debian.org/debian/ buster main contrib non-free - Save and exit nano the same way as before (
Ctrl+OthenCtrl+X). - Run
sudo apt updateto refresh the cache.
Once you've completed these steps, your system will have access to the non-free packages needed for Steam, and you can continue with the rest of the installation guide. If you run into any other issues along the way, don't hesitate to ask for more help!
内容的提问来源于stack exchange,提问作者Kieran Church

