Skip to content

Instantly share code, notes, and snippets.

@ChristopherA
Last active April 20, 2024 20:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save ChristopherA/680b4eeeeb6e9e4c7fc59c010a23b6cd to your computer and use it in GitHub Desktop.
Save ChristopherA/680b4eeeeb6e9e4c7fc59c010a23b6cd to your computer and use it in GitHub Desktop.
How to enable contrib and non-free repos in Debian

As root you need to edit /etc/apt/sources.lst

Then add contrib and non-free at the end of each line that begins with deb and deb-src just like the example:

deb http://http.us.debian.org/debian jessie main contrib non-free

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

Save the file, and run ‘apt-get update‘ and optionally ‘apt-get upgrade‘ to activate the changes.

@djdembeck
Copy link

lst -> list

@sgargel
Copy link

sgargel commented Jan 11, 2022

Or: sed -r -i 's/^deb(.*)$/deb\1 contrib/g' /etc/apt/sources.list

@tfoote
Copy link

tfoote commented Jul 8, 2022

If you have software-properties-common installed you can use apt-add-repository contrib and apt-add-repository non-free to do it conditionally and be a little more robust to potentially differently modified sources lists.

@jjb
Copy link

jjb commented Mar 1, 2023

thanks @tfoote !!

@DragonSerW
Copy link

DragonSerW commented Aug 28, 2023

Thank you a lot @tfoote, your solution is gust perfect.
I perform this task on all my machines now:
sudo apt-get install software-properties-common -y && sudo apt-add-repository contrib -y # https://dragonserw.ru/wiki:debian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment