Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #Cleans up accidentally added Ubuntu repositories from the Debian's repository list
  2. #!/bin/bash
  3. sourcesDir=/etc/apt/sources.list.d
  4. fileNames=$(ls $sourcesDir)
  5. for fileName in $fileNames
  6. do
  7. fullFilePath=$sourcesDir/$fileName
  8. fileSourcesList=$(cat $fullFilePath)
  9. if [[ "$fileSourcesList" =~ "ubuntu" ]]
  10. then
  11. echo "$fullFilePath contains Ubuntu repositories, will be removed"
  12. rm -f $fullFilePath
  13. else
  14. echo "$fullFilePath does not contain Ubuntu repositories"
  15. fi
  16. done
  17. echo "DONE!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement