From b1a9ac28dc711ae2acd9fbf56b3f22820b988555 Mon Sep 17 00:00:00 2001 From: Mikaela Suomalainen Date: Sun, 12 Jul 2015 11:01:45 +0300 Subject: [PATCH] rc: sources-list-install-debian ref #78 --- rc/bashrc | 34 +++++++++++++++++++++++++++++++++- rc/zshrc | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 1 deletion(-) diff --git a/rc/bashrc b/rc/bashrc index 8f35ecc7..c3747f2b 100644 --- a/rc/bashrc +++ b/rc/bashrc @@ -726,7 +726,6 @@ cd } # This function will download and install sources.list. - function sources-list-install { export RELEASE=$(lsb_release -sr) @@ -759,6 +758,39 @@ echo "I have now finished everything that I was supposed to do." } +# Same for Debian (codename instead of release) +function sources-list-install-debian { + +export RELEASE=$(lsb_release -sc) +a[1]="https://raw.githubusercontent.com/Mikaela/shell-things/master/etc/apt/sources.list/$RELEASE" + +echo "I am now changing directory to /etc/apt/." +echo "" +cd /etc/apt/ + +echo "I will now backup sources.list to sources.list.bak ." +echo "" +cp /etc/apt/sources.list /etc/apt/sources.list.bak + +echo "I will now download the sources.list file from https://raw.githubusercontent.com/Mikaela/shell-things/master/etc/apt/sources.list/$RELEASE and save it as /etc/apt/sources.list ." +echo "" +echo "" > /etc/apt/sources.list +\wget ${a[1]} -O /etc/apt/sources.list +#\curl -L ${a[1]} >> /etc/apt/sources.list + +echo "" +echo "The new sources.list file should now be installed." +echo "" + +echo "Finally, I will now run 'apt-get -y update' so the new sources.list is used." +echo "" + +apt-get update + +echo "I have now finished everything that I was supposed to do." + +} + # This function fixes nodejs on Debian based systems. # (Everything expects nodejs to be called as node, but it's not with Debian.) fix-node () { diff --git a/rc/zshrc b/rc/zshrc index 3d6b4d5a..5c08644a 100644 --- a/rc/zshrc +++ b/rc/zshrc @@ -746,6 +746,39 @@ echo "I have now finished everything that I was supposed to do." } +# Same for Debian (codename instead of release) +function sources-list-install-debian { + +export RELEASE=$(lsb_release -sc) +a[1]="https://raw.githubusercontent.com/Mikaela/shell-things/master/etc/apt/sources.list/$RELEASE" + +echo "I am now changing directory to /etc/apt/." +echo "" +cd /etc/apt/ + +echo "I will now backup sources.list to sources.list.bak ." +echo "" +cp /etc/apt/sources.list /etc/apt/sources.list.bak + +echo "I will now download the sources.list file from https://raw.githubusercontent.com/Mikaela/shell-things/master/etc/apt/sources.list/$RELEASE and save it as /etc/apt/sources.list ." +echo "" +echo "" > /etc/apt/sources.list +\wget ${a[1]} -O /etc/apt/sources.list +#\curl -L ${a[1]} >> /etc/apt/sources.list + +echo "" +echo "The new sources.list file should now be installed." +echo "" + +echo "Finally, I will now run 'apt-get -y update' so the new sources.list is used." +echo "" + +apt-get update + +echo "I have now finished everything that I was supposed to do." + +} + # This function fixes nodejs on Debian based systems. # (Everything expects nodejs to be called as node, but it's not with Debian.) function fix-node {