Script pentru adăugare și actualizare programe în Ubuntu/Mint

Hai salut din nou! Azi o chestie scurtă și rapidă. Mulți folosim ppa-uri pe Ubuntu și/sau Mint, din diverse motive (programe actualizate, programe noi, etc. etc. etc.). Nu discutăm acum motivele. Cum și eu folosesc diverse ppa-uri și cum îmi place să mă mai joc uneori cu scripturi sh în Ubuntu, am zis să fac un script pe care să-l rulez după ce instalez Ubuntu. Explicațiile/comentariile din script sunt în limba engleză pentru că așa mi-a venit atunci, la momentul scrierii scriptului... :D
Copiați tot ce e în codul de mai jos și lipiți într-un editor de text ca gedit/kate/mousepad sau ce mai folosiți voi și salvați-l cu un nume de genul script_instalare.sh. Apoi îi dați drept de rulare/executare (știți voi cum, fie cu click dreapta pe el Proprieties->Permissions->bifare Allow this file to run as a program, fie în CLI cu chmod +x script_instalare.sh). Apoi nu mai trebuie decât să-l rulați. Spor!
P.S. Știu că există aptik, n-ai văzut scriptul?? :))
ATENȚIE!! SCRIPTUL INSTALEAZĂ NIȘTE PACHETE SPECIFICE PENTRU LAPTOPURI LENOVO THINKPAD!! DACĂ NU AVEȚI LAPTOP LENOVO, FOLOSIȚI VARIANTA A DOUA A SCRIPTULUI!! MAI MULTE INFORMAȚII GĂSIȚI AICI.
VARIANTA 1 - LENOVO 
********************************************************************************
#!/bin/bash
#Author: wladypauly
echo "THIS SCRIPT IS MEANT TO BE RUN AFTER INSTALLING UBUNTU"
echo
echo "What this script does is the following:"
echo
echo "1. it adds some ppas I use, ppas you can see inside the script"
echo
echo "2. it installs a series of packages I use most"
echo
echo "At some point the script will ask for your password and/or to confirm with Y some actions"
echo "Are you sure you want to continue? (Y/N)"
read a
if [ $a = "n" ] ; then
echo  "Operation aborted. You chicken'd out! See you! :)"
exit
fi
if [ $a = "y" ] ; then
echo "The universe and multiverse repositories will be enabled now"
sudo add-apt-repository "deb http://main.archive.ubuntu.com/ubuntu/ trusty universe multiverse"
sudo add-apt-repository "deb http://main.archive.ubuntu.com/ubuntu/ trusty-updates universe multiverse"
echo "Now some ppas will be added"
sudo add-apt-repository -y ppa:linrunner/tlp #laptop tools
sudo add-apt-repository -y ppa:jon-severinsson/ffmpeg #ffmpeg ppa
sudo add-apt-repository -y ppa:venerix/pkg #tvmaxe ppa
sudo add-apt-repository -y ppa:webupd8team/java #oracle-java ppa
sudo add-apt-repository -y ppa:danielrichter2007/grub-customizer #the name is self-explanatory
sudo add-apt-repository -y ppa:unit193/inxi #utility to display hardware details in terminal
sudo add-apt-repository -y ppa:tsbarnes/indicator-keylock #keyboard indicator for Caps Lock, Num Lock, Scroll Lock
sudo add-apt-repository -y ppa:ffmulticonverter/stable #multimedia and document format converter
sudo add-apt-repository -y ppa:teejee2008/ppa # aptik - a utility to backup and restore ppas, installed packages and more
sudo add-apt-repository -y ppa:noobslab/icons #icon themes
sudo add-apt-repository -y ppa:noobslab/themes #themes
sudo add-apt-repository -y ppa:nilarimogard/webupd8 #youtube-dl and others
sudo add-apt-repository -y ppa:noobslab/deepin-sc #deepin audio player, best of its kind :)
sudo add-apt-repository -y ppa:inkscape.dev/stable #inkscape latest version
sudo add-apt-repository -y ppa:libreoffice/ppa #libreoffice latest version
sudo apt-get update
echo "Now the package laptop-mode-tools will be purged, as it conflicts with tlp-tools, a package specially designed for laptops, especially LENOVO laptops"
echo "Also, openjdk will be removed as a replacement - oraclejava - will be installed"
sudo apt-get purge laptop-mode-tools openjdk*
sudo apt-get autoremove
echo "Now the system will be updated. DO NOT restart the system after the update, wait for this script to finish and it will automatically reboot your system!!"
sudo apt-get dist-upgrade
echo
echo "Now some packages, some of them from the ppas, will be installed"
sudo apt-get install tlp tlp-rdw smartmontools ethtool tv-maxe oracle-java8-installer grub-customizer inxi indicator-keylock ffmulticonverter aptik libreoffice gimp blender synaptic audacious audacity ffmpeg youtube-dl deepin-music-player inkscape
echo "Now the system will be cleaned of downloaded packages and then rebooted. MAKE SURE YOU CLOSE ALL APPLICATIONS AND SAVE ALL OF YOUR WORK BEFORE PROCEEDING!!"
echo "DO YOU WISH TO CONTINUE?"
read a
if [ $a = "n" ] ; then
echo  "Operation aborted. See you! :)"
exit
fi
fi
if [ $a = "y" ] ; then
sudo apt-get clean && sudo apt-get autoclean
echo "SYSTEM IS ABOUT TO BE RESTARTED!"
echo "PLEASE CLOSE ALL YOUR WORK AND HIT Y"
echo "Please restart your system as soon as possible to apply the latest changes!"
echo "DO YOU WANT TO CONTINUE?"
read a
if [ $a = "n" ] ; then
echo "Operation aborted. See you! :)"
exit
fi
if [ $a = "y" ] ; then
sudo reboot
fi
exit 0

******************************************************

VARIANTA 2 - FĂRĂ LENOVO :D

****************************************************** 
#!/bin/bash
#Author: wladypauly
echo "THIS SCRIPT IS MEANT TO BE RUN AFTER INSTALLING UBUNTU"
echo
echo "What this script does is the following:"
echo
echo "1. it adds some ppas I use, ppas you can see inside the script"
echo
echo "2. it installs a series of packages I use most"
echo
echo "At some point the script will ask for your password and/or to confirm with Y some actions"
echo "Are you sure you want to continue? (Y/N)"
read a
if [ $a = "n" ] ; then
echo  "Operation aborted. See you! :)"
exit
fi
if [ $a = "y" ] ; then
echo "The universe and multiverse repositories will be enabled now"
sudo add-apt-repository "deb http://main.archive.ubuntu.com/ubuntu/ trusty universe multiverse"
sudo add-apt-repository "deb http://main.archive.ubuntu.com/ubuntu/ trusty-updates universe multiverse"
echo "Now some ppas will be added"
sudo add-apt-repository -y ppa:linrunner/tlp #laptop tools
sudo add-apt-repository -y ppa:jon-severinsson/ffmpeg #ffmpeg ppa
sudo add-apt-repository -y ppa:venerix/pkg #tvmaxe ppa
sudo add-apt-repository -y ppa:webupd8team/java #oracle-java ppa
sudo add-apt-repository -y ppa:danielrichter2007/grub-customizer #the name is self-explanatory
sudo add-apt-repository -y ppa:unit193/inxi #utility to display hardware details in terminal
sudo add-apt-repository -y ppa:tsbarnes/indicator-keylock #keyboard indicator for Caps Lock, Num Lock, Scroll Lock
sudo add-apt-repository -y ppa:ffmulticonverter/stable #multimedia and document format converter
sudo add-apt-repository -y ppa:teejee2008/ppa # aptik - a utility to backup and restore ppas, installed packages and more
sudo add-apt-repository -y ppa:noobslab/icons #icon themes
sudo add-apt-repository -y ppa:noobslab/themes #themes
sudo add-apt-repository -y ppa:nilarimogard/webupd8 #youtube-dl and others
sudo add-apt-repository -y ppa:noobslab/deepin-sc #deepin audio player, best of its kind :)
sudo add-apt-repository -y ppa:inkscape.dev/stable #inkscape latest version
sudo add-apt-repository -y ppa:libreoffice/ppa #libreoffice latest version
sudo apt-get update
echo "Now the package laptop-mode-tools will be purged, as it conflicts with tlp-tools, a package specially designed for laptops, especially LENOVO laptops"
echo "Also, openjdk will be removed as a replacement - oraclejava - will be installed"
sudo apt-get purge laptop-mode-tools openjdk*
sudo apt-get autoremove
echo "Now the system will be updated. DO NOT restart the system after the update, wait for this script to finish and it will automatically reboot your system!!"
sudo apt-get dist-upgrade
echo
echo "Now some packages, some of them from the ppas, will be installed"
sudo apt-get install tlp tlp-rdw smartmontools ethtool tp-smapi-dkms acpi-call-tools tv-maxe oracle-java8-installer grub-customizer inxi indicator-keylock ffmulticonverter aptik libreoffice gimp blender synaptic audacious audacity ffmpeg youtube-dl deepin-music-player inkscape
echo "Now the system will be cleaned of downloaded packages and then rebooted. MAKE SURE YOU CLOSE ALL APPLICATIONS AND SAVE ALL OF YOUR WORK BEFORE PROCEEDING!!"
echo "DO YOU WISH TO CONTINUE?"
read a
if [ $a = "n" ] ; then
echo  "Operation aborted. See you! :)"
exit
fi
fi
if [ $a = "y" ] ; then
sudo apt-get clean && sudo apt-get autoclean
echo "SYSTEM IS ABOUT TO BE RESTARTED!"
echo "PLEASE CLOSE ALL YOUR WORK AND HIT Y"
echo "Please restart your system as soon as possible to apply the latest changes!"
echo "DO YOU WANT TO CONTINUE?"
read a
if [ $a = "n" ] ; then
echo "Operation aborted. See you! :)"
exit
fi
if [ $a = "y" ] ; then
sudo reboot
fi
exit 0

Comentarii

Postări populare de pe acest blog

Ion Pribeagu - un scriitor uitat

Crăciunul în mitologia română

Kdenlive „crapă” la importul unui clip