Author Topic: [wiki]Allservers script: Rank Mirrors, Upgrade System, Maintain Cache, rm db.lck  (Read 34500 times)

0 Members and 1 Guest are viewing this topic.

Offline ringo

  • Held Mitglied
  • *****
  • Posts: 9684
  • www.manjaro-nl.org
    • Manjaro Belgium + forum
  • Branch: unsourced
  • Desktop: xfce
  • GPU Card: Nvidia Geforce 8600 GT (acer 23inch)
  • GPU driver: Free*
  • Kernel: linux kernel
  • Skill: Novice
Re: [How-To] Script & system mod's for Rankmirrors & associated...
« Reply #15 on: 29. December 2012, 09:19:48 »
cant you better not offering Your script too Phil? to build intoo the installer.. ...

other side i like distro hopping but in one side i want to stop that :) doing only virtualboxing really....mayby i find a way to make a light virtualbox Desktop it only load that :)  if you have a script of virtualbox sesion you can gave it :)


but on Cinnarch they doing rankmirrors by installer..., on the other side its wise, it going to do on install, so you doesnt do it later when installed... its a handy thing to when hoe have a Netinstall ....

installer Cli of cinnarch is almost like Manjaro it differs a bit on few things, on archbang its difference huger then those two...

only cinnarch used pantheon but i saw tthey switched to Nemo, ...   they have a cinnarch minimum installer, they install other part in installation.... in the cinnamon desktop...
 8)
Dutch go the dutch site :)

Offline handy

  • Global Moderator
  • *****
  • Posts: 5738
  • Desktop: Openbox 3.6.1-3 & Worker :)
  • GPU Card: intel...
  • GPU driver: open-source
  • Kernel: OpenBSD
  • Skill: Intermediate
Re: [How-To] Script & system mod's for Rankmirrors & associated...
« Reply #16 on: 29. December 2012, 09:25:01 »
cant you better not offering Your script too Phil? to build intoo the installer.. ...

8< 8< 8< 8< 8< 8< 8< 8< 8< snip 8< 8<

I don't think there are that many users here that would bother with it. I think most would are happier using the pacman GUI.

Phil, knows the script is his if he wants it, he played a part in its creation too. I also think that if he wanted to script something like that he'd do a better job, as he knows exactly what he's doing.  ;)
The ultimate tyranny in a society is not control
by martial law. It is control by the psychological
manipulation of consciousness, through which reality
is defined so that those who exist within do not even
realize that they are in prison.
  —  Barbara Marciniak

Offline ringo

  • Held Mitglied
  • *****
  • Posts: 9684
  • www.manjaro-nl.org
    • Manjaro Belgium + forum
  • Branch: unsourced
  • Desktop: xfce
  • GPU Card: Nvidia Geforce 8600 GT (acer 23inch)
  • GPU driver: Free*
  • Kernel: linux kernel
  • Skill: Novice
Re: [How-To] Script & system mod's for Rankmirrors & associated...
« Reply #17 on: 29. December 2012, 10:02:44 »
its not a bad think at installation.. you always sure of fast mirrors.. but at Pacman-gui is good too and user friendly , place it where it needs :)

i huse pacmanxg4 it has also rankmirrors build in if it works is other question :)
Dutch go the dutch site :)

Offline handy

  • Global Moderator
  • *****
  • Posts: 5738
  • Desktop: Openbox 3.6.1-3 & Worker :)
  • GPU Card: intel...
  • GPU driver: open-source
  • Kernel: OpenBSD
  • Skill: Intermediate
Re: [How-To] Script & system mod's for Rankmirrors & associated...
« Reply #18 on: 04. January 2013, 23:38:51 »
I'll get around to adding this to the wiki page here which is the place to get the best version:

http://wiki.manjaro.org/index.php?title=Allservers.sh_Script
____________________________________


I've added CacheClean to the allservers.sh script. CacheClean is set to leave the currently installed & the previously installed versions of the installation packages in /var/cache/pacman/pkg & to delete all others.

This is considered to be good housekeeping as it allows you to be able to downgrade out of trouble very easily & quickly using the pacman -U <path/to/filename> command. See this How-To for a detailed explanation:

http://forum.manjaro.org/index.php?topic=1484.0

The new script is called allservers.cc.sh . If you want to use it then you can open your favourite text editor & copy the following script below & paste it into the text editors blank page. Then save it as allservers.cc.sh , after that you will need to make it executable so enter the following at the Terminal prompt:

Code: [Select]
chmod +x <path/to>/allservers.cc.sh
The script executes as usual & at the end it automatically runs CacheClean which is set to delete all but the current & previous versions of the installation packages in /var/cache/pacman/pkg :

allservers.cc.sh

Code: [Select]
#!/bin/bash

# allservers.cc.sh - inspired by Manjaro's Carl & Phil, initially hung together
# by handy, the script's display prettied up & progress information added by Phil,
# the menu & wiki page added by handy:
# http://wiki.manjaro.org/index.php?title=Allservers.sh_Script
 
# allservers.menu.sh MUST be run as root = after sudo su
# 1. Downloads the most recent Manjaro mirror list to /etc/pacman.d/allservers
# 2. Formats it to /etc/pacman.d/allservers
# 3. Rankmirrors tests then updates /etc/pacman.d/mirrorlist with the 3 fastest
# 4. Syncs the mirrors with your machine
# 5. Menu then appears asking you how you want to upgrade your system.
#    Choice 1. type s or S to call pacman -Syu
#    Choice 2. type a or A to call yaourt -Syu --aur
#    Hit Return to exit the script.
# 6. Finally, (unless the script has been exited) CacheClean will run,
#    cleaning all but the current & previouls installed versions
#    of the installation files residing in /var/cache/pacman/pkg
###########################################################

err() {
    ALL_OFF="\e[1;0m"
    BOLD="\e[1;1m"
    RED="${BOLD}\e[1;31m"
   local mesg=$1; shift
   printf "${RED}==>${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2
}

msg() {
    ALL_OFF="\e[1;0m"
    BOLD="\e[1;1m"
    GREEN="${BOLD}\e[1;32m"
   local mesg=$1; shift
   printf "${GREEN}==>${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2
}


if [[ `whoami` != "root" ]];
then
  err "Must use 'sudo su' before you run this script."
  exit
fi

echo
msg "Downloading latest mirrorlist"
wget http://git.manjaro.org/packages-sources/basis/blobs/raw/master/pacman-mirrorlist/mirrorlist -O /etc/pacman.d/allservers >& /dev/null
msg "Editing allservers file"
sed -ie s'/# Server/Server/'g /etc/pacman.d/allservers
msg "Running rankmirrors"
rankmirrors -n 3 /etc/pacman.d/allservers > /etc/pacman.d/mirrorlist
msg "Updating your pacman databases"
echo
pacman -Syy


# menu options to upgrade system & upgrade system plus AUR:

clear # Clear the screen.

echo
echo -e "\033[1m                 allservers.sh \033[0m"
echo
echo -e "\e[1;32m    Choose how you want to upgrade Manjaro?"
echo  "    Choose the S/s or A/a key - or -->"
echo  "    Hit the Return/Enter key to Exit the script."
echo
echo
echo  "    [S]ystem Only --> pacman -Syu"
echo
echo -e "    [A]UR & System --> yaourt -Syu --aur  \e[1;0m"
echo
echo

read option

case "$option" in
# Note variable is quoted.

  "S" | "s" )
  # Accept upper or lowercase input.
  echo
  msg "Upgrading System:"
  echo
  pacman -Syu
  echo
  msg "System update complete."
  ;;
# Note double semicolon to terminate each option.

  "A" | "a" )
  # Accept upper or lowercase input.
  echo
  msg "Upgrading System & AUR:"
  echo
  yaourt -Syu --aur
  echo
  msg "System including AUR packages are up to date."
  ;;

esac

echo
  msg "CacheClean will now remove all but the curent"
  msg "& previous versions of packages in your"
  msg "/var/cache/pacman/pkg directory"
echo
  cacheclean -v 2
echo
  msg "CacheClean has done its job."
echo

exit 0

Use the method in the wiki (linked at top of post) to make a ~/.bashrc alias for this command. I've added the following alias to my ~/.bashrc :

Code: [Select]
alias asc="sudo su -c allservers.cc.sh"
« Last Edit: 17. November 2013, 05:03:58 by handy »
The ultimate tyranny in a society is not control
by martial law. It is control by the psychological
manipulation of consciousness, through which reality
is defined so that those who exist within do not even
realize that they are in prison.
  —  Barbara Marciniak

Offline handy

  • Global Moderator
  • *****
  • Posts: 5738
  • Desktop: Openbox 3.6.1-3 & Worker :)
  • GPU Card: intel...
  • GPU driver: open-source
  • Kernel: OpenBSD
  • Skill: Intermediate
Re: [How-To] Script & system mod's for Rankmirrors & associated...
« Reply #19 on: 07. January 2013, 07:20:13 »
Cleaned up the CacheClean addition to the allservers.sh script wiki page some. If you see any problems there please let me know here?

http://wiki.manjaro.org/index.php?title=Allservers.sh_Script
« Last Edit: 17. November 2013, 05:04:14 by handy »
The ultimate tyranny in a society is not control
by martial law. It is control by the psychological
manipulation of consciousness, through which reality
is defined so that those who exist within do not even
realize that they are in prison.
  —  Barbara Marciniak

Offline handy

  • Global Moderator
  • *****
  • Posts: 5738
  • Desktop: Openbox 3.6.1-3 & Worker :)
  • GPU Card: intel...
  • GPU driver: open-source
  • Kernel: OpenBSD
  • Skill: Intermediate
Re: [How-To] Script & system mod's for Rankmirrors & associated...
« Reply #20 on: 08. January 2013, 06:43:39 »
[edit:] The following script has been edited 19-April-2013 to make the wget lines work with Phil's new changes.

I've just done a major overhaul of the allservers.sh script. It is now vastly improved & more useful, being completely menu driven & optimised so that it is much more flexible, offering 5. choices, & you don't always have to do the rankmirrors stuff every time you use it, which also makes it much quicker too.

I'll get around to improving the colours one day, when the mood strikes.

allservers.sh - fully menu driven:

Code: [Select]
#!/bin/bash # allservers.sh - inspired by Manjaro's Carl & Phil, initially hung together # by handy, the script's display prettied up & progress information added by Phil, # the menu & wiki page added by handy. # Latest revision now calls everything the menu. # Following wiki page is about this script: # http://wiki.manjaro.org/index.php/Allservers.sh_Script:-_Rankmirrors,_Synchronise_Pacman_Database # Following wiki page will introduce CacheClean & related information: # http://wiki.manjaro.org/index.php/Maintaining_/var/cache/pacman/pkg_for_System_Safety #__________________________________________ # # allservers.sh is now completely menu driven. The Menu describes # what it does for you, if you need more detail see the two # wiki page links listed above. ########################################## err() { ALL_OFF="\e[1;0m" BOLD="\e[1;1m" RED="${BOLD}\e[1;31m" local mesg=$1; shift printf "${RED}==>${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2 } msg() { ALL_OFF="\e[1;0m" BOLD="\e[1;1m" GREEN="${BOLD}\e[1;32m" local mesg=$1; shift printf "${GREEN}==>${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2 } if  `whoami` != "root" ; then err "Must use 'sudo su' before you run this script." exit fi # The menu: clear # Clear the screen. echo echo -e "\033[1m                      allservers.sh \033[0m" echo echo -e "\e[1;32m    Enter your Option's number OR hit Return to exit. " echo echo echo  "    [1] Rank Mirrors, Update Mirrorlist & run pacman -Syy " echo echo  "    [2] Option 1. plus Upgrade the System - pacman -Syu " echo  "        & then run CacheClean - cacheclean -v 2 " echo echo  "    [3] Option 1. plus Upgrade the System & AUR - yaourt -Syu --aur " echo  "        & then run CacheClean - cacheclean -v 2 " echo echo  "    [4] Upgrade the System only - pacman -Syu " echo  "        & then run CacheClean - cacheclean -v 2 " echo echo  "    [5] Upgrade the System & AUR only - yaourt - Syu --aur " echo  "        & then run CacheClean - cacheclean -v 2 " echo echo  "    CacheClean can be obtained via the AUR - yaourt -S cacheclean " echo  "    CacheClean is set to remove all installation packages in your " echo  "    /var/cache/pacman/pkg directory EXCEPT the two most recent " echo  "    versions. See the Manjaro wiki for details. " echo -e "    http://wiki.manjaro.org/index.php/Maintaining_/var/cache/pacman/pkg_for_System_Safety \033[0m" echo echo -e "\033[1m  Enter Your Choice: \033[0m" echo read option case "$option" in # Note variable is quoted. "1") echo msg "Downloading latest mirrorlist" wget http://git.manjaro.org/packages-sources/basis/blobs/raw/abd4c76ae4b83f7750d1038a0b7df6dfb063f580/pacman-mirrorlist/mirrorlist -O /etc/pacman.d/allservers >& /dev/null msg "Editing allservers file" sed -ie s'/# Server/Server/'g /etc/pacman.d/allservers msg "Running rankmirrors" rankmirrors -n 3 /etc/pacman.d/allservers > /etc/pacman.d/mirrorlist msg "Updating your pacman databases" echo pacman -Syy  ;; # Note double semicolon to terminate each option. "2") echo msg "Downloading latest mirrorlist" wget http://git.manjaro.org/packages-sources/basis/blobs/raw/abd4c76ae4b83f7750d1038a0b7df6dfb063f580/pacman-mirrorlist/mirrorlist -O /etc/pacman.d/allservers >& /dev/null msg "Editing allservers file" sed -ie s'/# Server/Server/'g /etc/pacman.d/allservers msg "Running rankmirrors" rankmirrors -n 3 /etc/pacman.d/allservers > /etc/pacman.d/mirrorlist msg "Updating your pacman databases" echo pacman -Syy echo msg "Upgrading System:" echo pacman -Syu echo msg "System update complete." echo msg "CacheClean will now remove all but the 2 most " msg "recent versions of the installation packages in " msg "/var/cache/pacman/pkg directory:" echo cacheclean -v 2 echo msg "CacheClean has done its job. " echo  ;; # Note double semicolon to terminate each option. "3") echo msg "Downloading latest mirrorlist" wget http://git.manjaro.org/packages-sources/basis/blobs/raw/abd4c76ae4b83f7750d1038a0b7df6dfb063f580/pacman-mirrorlist/mirrorlist -O /etc/pacman.d/allservers >& /dev/null msg "Editing allservers file" sed -ie s'/# Server/Server/'g /etc/pacman.d/allservers msg "Running rankmirrors" rankmirrors -n 3 /etc/pacman.d/allservers > /etc/pacman.d/mirrorlist msg "Updating your pacman databases" echo pacman -Syy echo msg "Upgrading System & AUR:" echo yaourt -Syu --aur echo msg "System including AUR packages are up to date." echo msg "CacheClean will now remove all but the 2 most " msg "recent versions of the installation packages in " msg "/var/cache/pacman/pkg directory:" echo cacheclean -v 2 echo msg "CacheClean has done its job. " echo  ;; # Note double semicolon to terminate each option. "4") echo msg "Upgrading System:" echo pacman -Syu echo msg "System update complete." echo msg "CacheClean will now remove all but the 2 most " msg "recent versions of the installation packages in " msg "/var/cache/pacman/pkg directory:" echo cacheclean -v 2 echo msg "CacheClean has done its job. " echo  ;; # Note double semicolon to terminate each option. "5") echo msg "Upgrading System & AUR: " echo yaourt -Syu --aur echo msg "System including AUR packages are up to date. " echo msg "CacheClean will now remove all but the 2 most " msg "recent versions of the installation packages in " msg "/var/cache/pacman/pkg directory:" echo cacheclean -v 2 echo msg "CacheClean has done its job. " echo  ;; esac exit 0
I'll go & update the wiki page now:

http://wiki.manjaro.org/index.php?title=Allservers.sh_Script
« Last Edit: 17. November 2013, 05:04:34 by handy »
The ultimate tyranny in a society is not control
by martial law. It is control by the psychological
manipulation of consciousness, through which reality
is defined so that those who exist within do not even
realize that they are in prison.
  —  Barbara Marciniak

Offline handy

  • Global Moderator
  • *****
  • Posts: 5738
  • Desktop: Openbox 3.6.1-3 & Worker :)
  • GPU Card: intel...
  • GPU driver: open-source
  • Kernel: OpenBSD
  • Skill: Intermediate
Re: [How-To] Script & system mod's for Rankmirrors & associated...
« Reply #21 on: 08. January 2013, 08:05:49 »
I've just completed expanding & updating the wiki page with the new script in the previous post:

http://wiki.manjaro.org/index.php?title=Allservers.sh_Script
« Last Edit: 17. November 2013, 05:04:56 by handy »
The ultimate tyranny in a society is not control
by martial law. It is control by the psychological
manipulation of consciousness, through which reality
is defined so that those who exist within do not even
realize that they are in prison.
  —  Barbara Marciniak

Offline handy

  • Global Moderator
  • *****
  • Posts: 5738
  • Desktop: Openbox 3.6.1-3 & Worker :)
  • GPU Card: intel...
  • GPU driver: open-source
  • Kernel: OpenBSD
  • Skill: Intermediate
Re: [How-To] Script & system mod's for Rankmirrors & associated...
« Reply #22 on: 27. April 2013, 03:23:10 »
For anyone who was using the allservers.sh script before all of the recent Manjaro server & system changes; I have just modified the script to work using the new pacman-mirrors -g command.

I've rewritten much of the first page of this thread & it now contains the current allservers.sh script. I've also modified the wiki page (which has by far the most comprehensive & simplest how-to) & is of course the recommended place for any new allservers.sh script users to go: http://wiki.manjaro.org/index.php?title=Allservers.sh_Script

I'd appreciate feedback on how the script works for you, & if you could state whether you copied it from the wiki, or from the OP of this thread, that would be helpful too?

I've tested all of its options again after modifying it & it works fine here. It is a simpler (shorter) script than it was, but I might have put a character out of place somewhere or something.

Please ignore the out of date warning that is heading up the wiki, that will be gone inside of the next 24 hours.
« Last Edit: 17. November 2013, 05:05:13 by handy »
The ultimate tyranny in a society is not control
by martial law. It is control by the psychological
manipulation of consciousness, through which reality
is defined so that those who exist within do not even
realize that they are in prison.
  —  Barbara Marciniak

Offline handy

  • Global Moderator
  • *****
  • Posts: 5738
  • Desktop: Openbox 3.6.1-3 & Worker :)
  • GPU Card: intel...
  • GPU driver: open-source
  • Kernel: OpenBSD
  • Skill: Intermediate
Having been made aware of this:

https://wiki.archlinux.org/index.php/Pacman#Partial_upgrades_are_unsupported

I have removed the possibility of using menu Option [1] by itself. It is still used by the other menu options that call it.

I have modified the wiki; updating the allservers.sh script, image & description. I advise you to replace your script with the new one (or at the very least, be careful about using Option [1].

I'll replace the script in the OP of this thread now too.

Wiki page:

http://wiki.manjaro.org/index.php?title=Allservers.sh_Script
« Last Edit: 17. November 2013, 05:05:39 by handy »
The ultimate tyranny in a society is not control
by martial law. It is control by the psychological
manipulation of consciousness, through which reality
is defined so that those who exist within do not even
realize that they are in prison.
  —  Barbara Marciniak

Offline handy

  • Global Moderator
  • *****
  • Posts: 5738
  • Desktop: Openbox 3.6.1-3 & Worker :)
  • GPU Card: intel...
  • GPU driver: open-source
  • Kernel: OpenBSD
  • Skill: Intermediate
The allservers.sh script has been modified, bringing back the option of choosing Option 1. again (it is useful from time to time) with a warning to take care & read the provided link. Also, made the output more informative for each process in progress.

http://wiki.manjaro.org/index.php?title=Allservers.sh_Script
« Last Edit: 17. November 2013, 05:05:56 by handy »
The ultimate tyranny in a society is not control
by martial law. It is control by the psychological
manipulation of consciousness, through which reality
is defined so that those who exist within do not even
realize that they are in prison.
  —  Barbara Marciniak

Offline moumin

  • Vollwertiges Mitglied
  • ***
  • Posts: 150
  • Branch: stable
  • Desktop: xfce 4.10
  • GPU Card: intel
  • GPU driver: free
  • Kernel: linux312-x64
  • Skill: Novice
This script obviously is outdated as cacheclean isn't available in AUR.

Offline handy

  • Global Moderator
  • *****
  • Posts: 5738
  • Desktop: Openbox 3.6.1-3 & Worker :)
  • GPU Card: intel...
  • GPU driver: open-source
  • Kernel: OpenBSD
  • Skill: Intermediate
The ultimate tyranny in a society is not control
by martial law. It is control by the psychological
manipulation of consciousness, through which reality
is defined so that those who exist within do not even
realize that they are in prison.
  —  Barbara Marciniak

Offline moumin

  • Vollwertiges Mitglied
  • ***
  • Posts: 150
  • Branch: stable
  • Desktop: xfce 4.10
  • GPU Card: intel
  • GPU driver: free
  • Kernel: linux312-x64
  • Skill: Novice

Offline handy

  • Global Moderator
  • *****
  • Posts: 5738
  • Desktop: Openbox 3.6.1-3 & Worker :)
  • GPU Card: intel...
  • GPU driver: open-source
  • Kernel: OpenBSD
  • Skill: Intermediate
oops, my bad I'm sorry, I must have missed it.

Easily done in this world of information overload that we live in... ;)
The ultimate tyranny in a society is not control
by martial law. It is control by the psychological
manipulation of consciousness, through which reality
is defined so that those who exist within do not even
realize that they are in prison.
  —  Barbara Marciniak

Offline moumin

  • Vollwertiges Mitglied
  • ***
  • Posts: 150
  • Branch: stable
  • Desktop: xfce 4.10
  • GPU Card: intel
  • GPU driver: free
  • Kernel: linux312-x64
  • Skill: Novice
Tell me sir, Is this script better than creating a custom/country mirror list?? does It include it?