mirror of
https://gitea.blesmrt.net/mikaela/shell-things.git
synced 2024-11-22 11:19:22 +01:00
bashrc & zshrc: add function to download sources.list for Ubuntu.
This commit is contained in:
parent
e4da11776a
commit
21fd7af642
34
bashrc
34
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
|
||||
|
34
zshrc
34
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.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user