Wiki Ubuntu-it

Indice
Partecipa
FAQ
Wiki Blog
------------------
Ubuntu-it.org
Forum
Chiedi
Chat
Cerca
Planet
  • Pagina non alterabile
  • Informazioni
  • Allegati
  • Differenze per "jeremie2/Prove13"
Differenze tra le versioni 6 e 17 (in 11 versioni)
Versione 6 del 22/09/2019 21.57.37
Dimensione: 3413
Autore: jeremie2
Commento:
Versione 17 del 01/04/2025 16.34.24
Dimensione: 5291
Autore: jeremie2
Commento:
Le cancellazioni sono segnalate in questo modo. Le aggiunte sono segnalate in questo modo.
Linea 1: Linea 1:
#format wiki
#LANGUAGE it
## page was renamed from GruppoDocumentazione/NuovoRilascio/ScriptHashSHA256Sum
#page created by wilecoyote
<<Indice(depth=2)>>
Linea 4: Linea 5:
<<Indice>>
<<Informazioni(forum="http://forum.ubuntu-it.org/viewtopic.php?f=46&t=597941")>>
<<Informazioni(forum=http://forum.ubuntu-it.org/viewtopic.php?t=641900; rilasci="22.04 24.04 24.10 25.04")>>
Linea 9: Linea 9:
In questa pagina vengono elencati i collegamenti da cui è possibile scaricare le immagini `iso` di '''Ubuntu 19.10 «Eoan Ermine»''' e delle sue derivate tramite protocollo [[http://it.wikipedia.org/wiki/BitTorrent|BitTorrent]]. Nelle pagine di download di Ubuntu, oltre alle immagini '''iso''' del sistema operativo, è regolarmente presente il file '''SHA256SUM''' con l'elenco delle impronte SHA256Sum di ciascun file `iso`.
Linea 11: Linea 11:
Fare riferimento alla pagina [[Installazione/RequisitiDiSistema|requisti di sistema]] per scegliere la distribuzione più adatta alla propria configurazione hardware. In questa pagina viene mostrato l'utilizzo di uno '''script''' in grado di rilevare dalle pagine di download tutte le impronte SHA256Sum di Ubuntu e derivate a seconda del numero di versione (22.04, 24.04, ecc..).<<BR>>
Per ogni versione verrà creato un file con l'elenco delle hash per le `iso` di Ubuntu e derivate.
Linea 13: Linea 14:
## start = Script =
Linea 15: Linea 16:
= 19.10 =
== Ubuntu ==
Il seguente script richiede l'[[AmministrazioneSistema/InstallareProgrammi|installazione]] del pacchetto [[apt://aiohttp-wsgi-serve|aiohttp-wsgi-serve]]. In caso di problemi è possibile utilizzare uno script [[#alternativo|alternativo]].
Linea 18: Linea 18:
||<tablestyle="width:30%; margin:1em; text-align:center;" rowstyle="background-color: #cccccc;" :30%>'''Versione''' || '''19.10''' ||
||<#f7f7f7>'''Desktop DVD'''|| [[http://releases.ubuntu.com/disco/ubuntu-19.10-desktop-amd64.iso.torrent|amd64]] ||
||<#f7f7f7>'''Server'''|| [[http://releases.ubuntu.com/disco/ubuntu-19.10-live-server-amd64.iso.torrent|amd64]] ||
{{{
import aiohttp
import asyncio
Linea 22: Linea 22:
## le vecchie point release delle derivate danno sempre errore: Requested download is not authorized for use with this tracker.
## basta aggiungere l'ultima point release
## per ubuntu invece le vecchie point release sono semplicemente spostate in releases.ubuntu.com
from sys import argv
script, ubu_version = argv
Linea 26: Linea 25:
== Kubuntu == ubuntu_flavours = ("kubuntu", "ubuntu-mate", "xubuntu", "lubuntu", "ubuntu-unity", "ubuntu-budgie", "ubuntustudio", "ubuntukylin", "ubuntucinnamon")
Linea 28: Linea 27:
||<tablestyle="width:30%; margin:1em; text-align:center;" rowstyle="background-color: #cccccc;" :30%>'''Versione''' || '''19.10''' ||
||<#f7f7f7>'''Desktop DVD'''|| [[http://cdimage.ubuntu.com/kubuntu/releases/19.10/release/kubuntu-19.10-desktop-amd64.iso.torrent|amd64]]||
Linea 31: Linea 28:
== Lubuntu == def create_versions_list():
    versions = []
    versions.append("UBUNTU")
Linea 33: Linea 32:
||<tablestyle="width:30%; margin:1em; text-align:center;" rowstyle="background-color: #cccccc;" :30%>'''Versione''' || '''19.10''' ||
||<#f7f7f7>'''Desktop DVD'''|| [[http://cdimage.ubuntu.com/lubuntu/releases/19.10/release/lubuntu-19.10-desktop-amd64.iso.torrent|amd64]]||
    for version in ubuntu_flavours:
        versions.append(version.upper())
Linea 36: Linea 35:
== Ubuntu Budgie ==     versions.append("SERVER_POWERPC")
    return versions
Linea 38: Linea 38:
||<tablestyle="width:30%; margin:1em; text-align:center;" rowstyle="background-color: #cccccc;" :30%>'''Versione''' || '''19.10''' ||
||<#f7f7f7>'''Desktop DVD'''|| [[http://cdimage.ubuntu.com/ubuntu-budgie/releases/19.10/release/ubuntu-budgie-19.10-desktop-amd64.iso.torrent|amd64]]||
Linea 41: Linea 39:
== Ubuntu Kylin == def create_urls_collection():
    urls = []
Linea 43: Linea 42:
||<tablestyle="width:30%; margin:1em; text-align:center;" rowstyle="background-color: #cccccc;" :30%>'''Versione''' || '''19.10''' ||
||<#f7f7f7>'''Desktop DVD'''|| [[http://cdimage.ubuntu.com/ubuntukylin/releases/19.10/release/ubuntukylin-19.10-desktop-amd64.iso.torrent|amd64]]||
    # Link hash Ubuntu
    link = f"https://releases.ubuntu.com/{ubu_version}/SHA256SUMS"
    urls.append(link)
Linea 46: Linea 46:
== Ubuntu Mate ==     # Link hash derivate ufficiali di Ubuntu
    for flavour in ubuntu_flavours:
        link = f"https://cdimage.ubuntu.com/{flavour}/releases/{ubu_version}/release/SHA256SUMS"
        urls.append(link)
Linea 48: Linea 51:
||<tablestyle="width:30%; margin:1em; text-align:center;" rowstyle="background-color: #cccccc;" :30%>'''Versione''' || '''19.10''' ||
||<#f7f7f7>'''Desktop DVD'''|| [[http://cdimage.ubuntu.com/ubuntu-mate/releases/19.10/release/ubuntu-mate-19.10-desktop-amd64.iso.torrent|amd64]]||
    # Link hash versioni server alternative, ecc..
    link = f"https://cdimage.ubuntu.com/releases/{ubu_version}/release/SHA256SUMS"
    urls.append(link)
Linea 51: Linea 55:
== Ubuntu Studio ==     return urls
Linea 53: Linea 57:
||<tablestyle="width:30%; margin:1em; text-align:center;" rowstyle="background-color: #cccccc;" :30%>'''Versione''' || '''19.10''' ||
||<#f7f7f7>'''Desktop DVD'''|| [[http://cdimage.ubuntu.com/ubuntustudio/releases/19.10/release/ubuntustudio-19.10-dvd-amd64.iso.torrent|amd64]]||
Linea 56: Linea 58:
== Xubuntu == async def fetch_page(session, url):
    async with session.get(url) as response:
        if response.status == 200:
            return await response.text()
        else:
            return None
Linea 58: Linea 65:
||<tablestyle="width:30%; margin:1em; text-align:center;" rowstyle="background-color: #cccccc;" :30%>'''Versione''' || '''19.10''' ||
||<#f7f7f7>'''Desktop DVD'''|| [[http://cdimage.ubuntu.com/xubuntu/releases/19.10/release/xubuntu-19.10-desktop-amd64.iso.torrent|amd64]] ||
Linea 61: Linea 66:
## end async def main():
    ubu_versions = create_versions_list()
    urls = create_urls_collection()
    async with aiohttp.ClientSession() as session:
        hash_pages = []

        for url in urls:
            hash_pages.append(fetch_page(session, url))

        htmls = await asyncio.gather(*hash_pages)

    for flavour_name, hash_text in zip(ubu_versions, htmls):
        if hash_text is None:
            print(f"{flavour_name}\nNon presente!\n")
        else:
            print(f"{flavour_name}\n{hash_text}")


asyncio.run(main())

}}}

= Utilizzo =

Aprire un [[Ufficio/EditorDiTesto|editor di testo]], incollare il testo dello script riportato nel paragrafo precedente e salvare il file nella propria '''Home''' con il nome `script.py`

Vengono elencati qui i comandi da [[AmministrazioneSistema/Terminale|terminale]] per ogni [[Rilasci|versione supportata]]. Ogni comando creerà nella propria '''Home''' un file con all'interno l'elenco delle impronte per una specifica versione di Ubuntu. Ad esempio il file '''hash_24-04.txt''' conterrà l'elenco delle hash SHA256Sum della versione '''24.04'''.

 * '''25.04''': digitare il comando:{{{
python3 script.py 25.04 > hash_25-04.txt
}}}
 * '''24.10''': digitare il comando:{{{
python3 script.py 24.10 > hash_24-10.txt
}}}
 * '''24.04''': digitare il comando:{{{
python3 script.py 24.04 > hash_24-04.txt
}}}
 * '''22.04''': digitare il comando:{{{
python3 script.py 22.04 > hash_22-04.txt
}}}

<<Anchor(alternativo)>>
= Script alternativo =

Lo script è meno veloce del precedente, potrebbe richiedere vari secondi per l'esecuzione, tuttavia non richiede pacchetti aggiuntivi in una installazione standard di Ubuntu.

{{{
import urllib.request
import requests

from sys import argv
script, ubu_version = argv

ubuntu_flavours = ("kubuntu", "ubuntu-mate", "xubuntu", "lubuntu", "ubuntu-unity", "ubuntu-budgie", "ubuntustudio", "ubuntukylin", "ubuntucinnamon")

def print_hash(web_page):
    request = requests.get(web_page)
    if request.status_code == 200:
        web = urllib.request.urlopen(web_page)
        text = web.read().decode('utf_8')
        print(text)
    else:
        print("Non presente!\n")

#STAMPA HASH UBUNTU PRESENTI IN https://releases.ubuntu.com/
print("UBUNTU")
link = f"https://releases.ubuntu.com/{ubu_version}/SHA256SUMS"
print_hash(link)

#STAMPA HASH VARIANTI *BUNTU PRESENTI IN http://cdimage.ubuntu.com/
for i in ubuntu_flavours:
    link = f"https://cdimage.ubuntu.com/{i}/releases/{ubu_version}/release/SHA256SUMS"
    print(i.upper())
    print_hash(link)

#STAMPA HASH VERSIONI SERVER PRESENTI IN https://cdimage.ubuntu.com/releases/
print("SERVER_POWERPC")
link = f"https://cdimage.ubuntu.com/releases/{ubu_version}/release/SHA256SUMS"
print_hash(link)

}}}

= Ulteriori risorse =

 * [[Installazione/SHA256Sum|Hash sha256]]
 * [[Installazione/SHA256Sum/Hash|Elenco delle hash sha256]]


Guida verificata con Ubuntu: 22.04 24.04 25.04

Problemi in questa pagina? Segnalali in questa discussione

Introduzione

Nelle pagine di download di Ubuntu, oltre alle immagini iso del sistema operativo, è regolarmente presente il file SHA256SUM con l'elenco delle impronte SHA256Sum di ciascun file iso.

In questa pagina viene mostrato l'utilizzo di uno script in grado di rilevare dalle pagine di download tutte le impronte SHA256Sum di Ubuntu e derivate a seconda del numero di versione (22.04, 24.04, ecc..).
Per ogni versione verrà creato un file con l'elenco delle hash per le iso di Ubuntu e derivate.

Script

Il seguente script richiede l'installazione del pacchetto aiohttp-wsgi-serve. In caso di problemi è possibile utilizzare uno script alternativo.

import aiohttp
import asyncio

from sys import argv
script, ubu_version = argv

ubuntu_flavours = ("kubuntu", "ubuntu-mate", "xubuntu", "lubuntu", "ubuntu-unity", "ubuntu-budgie", "ubuntustudio", "ubuntukylin", "ubuntucinnamon")


def create_versions_list():
    versions = []
    versions.append("UBUNTU")

    for version in ubuntu_flavours:
        versions.append(version.upper())

    versions.append("SERVER_POWERPC")
    return versions


def create_urls_collection():
    urls = []

    # Link hash Ubuntu
    link = f"https://releases.ubuntu.com/{ubu_version}/SHA256SUMS"
    urls.append(link)

    # Link hash derivate ufficiali di Ubuntu
    for flavour in ubuntu_flavours:
        link = f"https://cdimage.ubuntu.com/{flavour}/releases/{ubu_version}/release/SHA256SUMS"
        urls.append(link)

    # Link hash versioni server alternative, ecc..
    link = f"https://cdimage.ubuntu.com/releases/{ubu_version}/release/SHA256SUMS"
    urls.append(link)

    return urls


async def fetch_page(session, url):
    async with session.get(url) as response:
        if response.status == 200:
            return await response.text()
        else:
            return None


async def main():
    ubu_versions = create_versions_list()
    urls = create_urls_collection()
    async with aiohttp.ClientSession() as session:
        hash_pages = []

        for url in urls:
            hash_pages.append(fetch_page(session, url))

        htmls = await asyncio.gather(*hash_pages)

    for flavour_name, hash_text in zip(ubu_versions, htmls):
        if hash_text is None:
            print(f"{flavour_name}\nNon presente!\n")
        else:
            print(f"{flavour_name}\n{hash_text}")


asyncio.run(main())

Utilizzo

Aprire un editor di testo, incollare il testo dello script riportato nel paragrafo precedente e salvare il file nella propria Home con il nome script.py

Vengono elencati qui i comandi da terminale per ogni versione supportata. Ogni comando creerà nella propria Home un file con all'interno l'elenco delle impronte per una specifica versione di Ubuntu. Ad esempio il file hash_24-04.txt conterrà l'elenco delle hash SHA256Sum della versione 24.04.

  • 25.04: digitare il comando:

    python3 script.py 25.04 > hash_25-04.txt
  • 24.10: digitare il comando:

    python3 script.py 24.10 > hash_24-10.txt
  • 24.04: digitare il comando:

    python3 script.py 24.04 > hash_24-04.txt
  • 22.04: digitare il comando:

    python3 script.py 22.04 > hash_22-04.txt

Script alternativo

Lo script è meno veloce del precedente, potrebbe richiedere vari secondi per l'esecuzione, tuttavia non richiede pacchetti aggiuntivi in una installazione standard di Ubuntu.

import urllib.request
import requests

from sys import argv
script, ubu_version = argv

ubuntu_flavours = ("kubuntu", "ubuntu-mate", "xubuntu", "lubuntu", "ubuntu-unity", "ubuntu-budgie", "ubuntustudio", "ubuntukylin", "ubuntucinnamon")

def print_hash(web_page):
    request = requests.get(web_page)
    if request.status_code == 200:
        web = urllib.request.urlopen(web_page)
        text = web.read().decode('utf_8')
        print(text)
    else:
        print("Non presente!\n")

#STAMPA HASH UBUNTU PRESENTI IN https://releases.ubuntu.com/
print("UBUNTU")
link = f"https://releases.ubuntu.com/{ubu_version}/SHA256SUMS"
print_hash(link)

#STAMPA HASH VARIANTI *BUNTU PRESENTI IN http://cdimage.ubuntu.com/
for i in ubuntu_flavours:
    link = f"https://cdimage.ubuntu.com/{i}/releases/{ubu_version}/release/SHA256SUMS"
    print(i.upper())
    print_hash(link)

#STAMPA HASH VERSIONI SERVER PRESENTI IN https://cdimage.ubuntu.com/releases/
print("SERVER_POWERPC")
link = f"https://cdimage.ubuntu.com/releases/{ubu_version}/release/SHA256SUMS"
print_hash(link)

Ulteriori risorse


CategoryInstallazioneSistema