From 21fd7af64211469da01a3472ed9f185fc37bc492 Mon Sep 17 00:00:00 2001 From: Mikaela Suomalainen Date: Tue, 13 May 2014 12:34:11 +0300 Subject: [PATCH] bashrc & zshrc: add function to download sources.list for Ubuntu. --- bashrc | 34 ++++++++++++++++++++++++++++++++++ zshrc | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) diff --git a/bashrc b/bashrc index 0552be55..68131d94 100644 --- a/bashrc +++ b/bashrc @@ -700,6 +700,40 @@ cd } +# This function will download and install sources.list. + +function ubuntu-sources-list-install { + +export RELEASE=`lsb_release -sr` +a[1]="http://mkaysi.github.io/shell-things/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://mkaysi.github.io/shell-things/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." + +} + # .custom if [ -f ~/.custom ]; then diff --git a/zshrc b/zshrc index e228923f..d4ea5fc2 100644 --- a/zshrc +++ b/zshrc @@ -672,6 +672,40 @@ cd } +# This function will download and install sources.list. + +function ubuntu-sources-list-install { + +export RELEASE=`lsb_release -sr` +a[1]="http://mkaysi.github.io/shell-things/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://mkaysi.github.io/shell-things/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." + +} + # Source files for miscannellious modifications.