_apt.rb 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #
  2. # Cookbook:: workstation
  3. # Recipe:: _apt
  4. #
  5. # Copyright:: 2022, The Authors, All Rights Reserved.
  6. file '/etc/apt/sources.list' do
  7. action :delete
  8. end
  9. components_ = %w[main contrib non-free]
  10. # Main distribution
  11. apt_repository 'debian_testing' do
  12. arch 'amd64'
  13. uri 'http://deb.debian.org/debian/'
  14. distribution 'testing'
  15. components components_
  16. deb_src true
  17. action :add
  18. end
  19. apt_repository 'debian_testing_updates' do
  20. arch 'amd64'
  21. uri 'http://deb.debian.org/debian/'
  22. distribution 'testing-updates'
  23. components components_
  24. deb_src true
  25. action :add
  26. end
  27. apt_repository 'debian_testing_security' do
  28. arch 'amd64'
  29. uri 'http://deb.debian.org/debian-security'
  30. distribution 'testing-security'
  31. components components_
  32. deb_src true
  33. action :add
  34. end
  35. apt_repository 'debian_testing_proposed_updates' do
  36. arch 'amd64'
  37. uri 'http://deb.debian.org/debian/'
  38. distribution 'testing-proposed-updates'
  39. components components_
  40. deb_src true
  41. action :add
  42. end
  43. # Stable in case package not found in testing
  44. apt_repository 'debian_stable' do
  45. arch 'amd64'
  46. uri 'http://deb.debian.org/debian/'
  47. distribution 'stable'
  48. components components_
  49. deb_src true
  50. action :add
  51. end
  52. # Apt configuration
  53. file '/etc/apt/apt.conf.d/01norecommend' do
  54. owner 'root'
  55. group 'root'
  56. mode '0644'
  57. content <<-_EOF.gsub(/^\s+/, '')
  58. APT::Install-Recommends "0";
  59. APT::Install-Suggests "0";
  60. _EOF
  61. end