Perl e variabili d'ambiente

Ciao

dopo l’ennesimo super aggiornamento il pc (me lo aspettavo) non è più ripartito.
Ho scaricato OMV 3.03 e reinstallato tutto di nuovo.
Ho però questo errore

[root@albertolx3-pc albertolx3]# perl
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = “it_IT.UTF-8:it”,
LC_ALL = (unset),
LC_MEASUREMENT = “it_IT.ISO-8859-1”,
LC_MONETARY = “it_IT.ISO-8859-1”,
LC_SOURCED = “1”,
LC_COLLATE = “it_IT.ISO-8859-1”,
LC_NUMERIC = “it_IT.ISO-8859-1”,
LC_TIME = “it_IT.ISO-8859-1”,
LANG = “it_IT.ISO-8859-1”
are supported and installed on your system.
perl: warning: Falling back to the standard locale (“C”).

cosa posso fare per sistemarlo? Ovviamente in internet danno info solo per Debian e Ubuntu

La prima cosa da fare è usare l’icona </> per postare codice come codice.
First thing to do is use the </> icon to post code as code.

Post-edit: Ci scusiamo, ma è compito dei moderatori del forum tentare di convincere gli utenti a utilizzare correttamente gli strumenti del forum.
Post-edit: Apologies sort of but it is the job of forum moderators to attempt to get users to use the forum tools correctly.

1 Like

devi installare il pacchetto locales, nel mio caso, che io sono brasiliano, ho installato il locales-br, credo che italiano sia locales-it.

cercare il pacchetto locale e installare. Facci sapere se funziona.

Ho pubblicato utilizzando il traduttore di Google perché non parlo italiano.

1 Like

Sono anche curioso di sapere quale sia lo scopo di eseguire ‘perl’ come comando? Questo è nuovo per me.
I am also curious as to what is the purpose of running ‘perl’ as a command? That’s a new one for me.

Post-edit: qui eseguire ‘perl’ non fa esattamente nulla.
Post-edit: Here running ‘perl’ does exactly nothing.

Anche qui (vbox virtual machine localizzata Inglese).

Mi sono accorto del problema con il comando URPMI per installare i software che mi interessava. Di seguito un esempio

[root@albertolx3-pc albertolx3]# urpmi gimp
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = "it_IT.UTF-8:it",
        LC_ALL = (unset),
        LC_MEASUREMENT = "it_IT.ISO-8859-1",
        LC_MONETARY = "it_IT.ISO-8859-1",
        LC_SOURCED = "1",
        LC_COLLATE = "it_IT.ISO-8859-1",
        LC_NUMERIC = "it_IT.ISO-8859-1",
        LC_TIME = "it_IT.ISO-8859-1",
        LANG = "it_IT.ISO-8859-1"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
1 Like

Fatto.
Qualcosa è cambiato ma non so se in bene o in meglio.
Adesso da subito un errore all’apertura di un QTerminal

bash: warning: setlocale: LC_CTYPE: cannot change locale (it_IT.UTF-8): No such file or directory
[root@albertolx3-pc albertolx3]# urpmi gimp
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = "it_IT.UTF-8:it",
        LC_ALL = (unset),
        LC_MEASUREMENT = "it_IT.ISO-8859-1",
        LC_MONETARY = "it_IT.UTF-8",
        LC_SOURCED = "1",
        LC_COLLATE = "it_IT.ISO-8859-1",
        LC_NUMERIC = "it_IT.ISO-8859-1",
        LC_TIME = "it_IT.ISO-8859-1",
        LANG = "it_IT.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

Non ho accesso a una macchina con un mandriva ora, sono al lavoro, ma ovviamente ho solo bisogno di installare un pacchetto locales-XX (non ricordo cosa ho avuto qui nel XX), con me che ha risolto il problema, lo stesso problema del tuo. Cerca il pacchetto locale in RPMDRAKE, avrà diversi pacchetti, se non ti dispiace installare più pacchetti, puoi eseguire il rollup di urpmi locales-*, ma questo installerà molti pacchetti non necessari.

urpmi --test locales-it

http://abf-downloads.openmandriva.org/3.0/repository/x86_64/main/updates/locales-it-2.27-9-omv2015.0.x86_64.rpm
installing locales-it-2.27-9-omv2015.0.x86_64.rpm from /var/cache/urpmi/rpms                                      
Preparing...                     ################################################################################
Installation is possible
3 Likes

Grazie ora capisco. Ammetto di essere stato sconcertato.
Thanks now I understand. I admit I was baffled.

Se hai installato il pacchetto locale (per te penso locale-it) devi riavviare per rendere disponibili le impostazioni locali. Le versioni locali fanno parte dello stack di pacchetti glibc / libc, quindi anche la versione di tutti deve essere la stessa. Piace:
If you installed locale package (for you I think locales-it) you then have to reboot for locale to be available. Locales are part of glibc/libc package stack so you also want the version of all to be the same. Like:

$ rpm -qa | grep locales
locales-2.27-9-omv2015.0.x86_64
locales-en-2.27-9-omv2015.0.x86_64

$ rpm -qa | grep libc
glibc-2.27-9-omv2015.0.x86_64
libc6-2.27-9-omv2015.0.x86_64

sopra ho solo postato i pacchetti rilevanti non tutti i pacchetti prodotti dai comandi.
above I only posted the relevant packages not all packages the commands produce.

2 Likes

installato locales-it ma non cambia nulla

[albertolx3@albertolx3-pc ~]$ rpm -qa | grep locales
locales-2.27-9-omv2015.0.x86_64
locales-it-2.27-9-omv2015.0.x86_64

[albertolx3@albertolx3-pc ~]$ rpm -qa | grep libc
libcrystalhd-common-0-0.20121105.3-omv2015.0.x86_64
libcap-utils-2.25-2-omv2015.0.x86_64
libchewing-data-0.4.0-3-omv2015.0.x86_64
glibc-2.27-9-omv2015.0.x86_64
libc6-2.27-9-omv2015.0.x86_64

ma URPMI continua a dire

[root@albertolx3-pc albertolx3]# urpmi gimp
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = "it_IT.UTF-8:it",
        LC_ALL = (unset),
        LC_MEASUREMENT = "it_IT.ISO-8859-1",
        LC_MONETARY = "it_IT.UTF-8",
        LC_SOURCED = "1",
        LC_COLLATE = "it_IT.ISO-8859-1",
        LC_NUMERIC = "it_IT.ISO-8859-1",
        LC_TIME = "it_IT.ISO-8859-1",
        LANG = "it_IT.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

Hai riavviato da quando è stato installato questo pacchetto?
Have you rebooted since this package was installed?

OK, sopportami mentre sto pensando mentre vado qui. Puoi aprire Konsole e pubblicare l’output di “cat /etc/locale.conf”?

OK, bear with me as I’m thinking as I go here. Can you open Konsole and post output of ‘cat /etc/locale.conf’?

Post-modifica: puoi anche pubblicare in Konsole l’intero output del comando ‘locale’. Come sempre, l’output è superiore a circa 15-20 righe, lo inserisce in un file e allega il file qui.

Post-edit: And can you in Konsole also post entire output of command ‘locale’. As always it the output is more than about 15-20 lines put it in a file and attach the file here.

Inoltre puoi usare quella roba che hai trovato su Internet relativa a Debian e Ubuntu per trovare altri file che potresti controllare. Se tutti i file hanno le informazioni che dovrebbero, puoi provare a reinstallare pacchetti come urpmi, perl-URPM, locales, locales-it, glibc e libc6. Reinstallare con:

# urpmi --replacepkgs <foo_package>

Also you can use that stuff you found on the Internet relating to Debian and Ubuntu to find a few other files you could check. If all the files have the information they should then you can try reinstalling packages like urpmi, perl-URPM, locales, locales-it, glibc, and libc6. Reinstall with:

# urpmi --replacepkgs <foo_package>

Post-modifica: un suggerimento:

# urpmi --replacepkgs urpmi perl-URPM perl-RPMBDB python-rpm

si ma non è cambiato nulla

1 Like

Contenuto di locale.conf

[albertolx3@albertolx3-pc etc]$ cat locale.conf
LANG=it_IT.UTF-8
LANGUAGE=it_IT.UTF-8:it

Output comando locale

[albertolx3@albertolx3-pc etc]$ locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Impossibile impostare LC_ALL alla localizzazione predefinita: File o directory non esistente
LANG=it_IT.UTF-8
LC_CTYPE="it_IT.UTF-8"
LC_NUMERIC=it_IT.ISO-8859-1
LC_TIME=it_IT.ISO-8859-1
LC_COLLATE=it_IT.ISO-8859-1
LC_MONETARY=it_IT.UTF-8
LC_MESSAGES="it_IT.UTF-8"
LC_PAPER="it_IT.UTF-8"
LC_NAME="it_IT.UTF-8"
LC_ADDRESS="it_IT.UTF-8"
LC_TELEPHONE="it_IT.UTF-8"
LC_MEASUREMENT=it_IT.ISO-8859-1
LC_IDENTIFICATION="it_IT.UTF-8"
LC_ALL=
1 Like

Fatto anche questo ma non cambia nulla

1 Like

Nell’output di locale c’è un misto di ISO-8859-1ed UTF-8. Riporto un esempio di /etc/locale.conf

LC_NAME=it_IT.UTF-8
LC_MONETARY=it_IT.UTF-8
LANG=it_IT.UTF-8
LC_ADDRESS=it_IT.UTF-8
LC_NUMERIC=it_IT.UTF-8
LC_IDENTIFICATION=it_IT.UTF-8
LC_TIME=it_IT.UTF-8
LC_MEASUREMENT=it_IT.UTF-8
LC_PAPER=it_IT.UTF-8
LC_TELEPHONE=it_IT.UTF-8

Per controllare la localizzazone del sistema puoi utilizzare il comando

localectl status

Per controllare le localizzazioni disponibili

localectl list-locales

Ed infine per impostare la localizzazione del sistema

localectl set-locale LANG=it_IT.UTF-8

Ad esempio nel mio caso la localizzazione impostata è:

$ localectl status
System Locale: LANG=it_IT.UTF-8
VC Keymap: it
X11 Layout: it
X11 Model: pc105

e quelle disponibili (per la lingua italiana) sono:

$ localectl list-locales | grep ^it
it
it_CH
it_CH.UTF-8
it_IT
it_IT.UTF-8
it_IT@euro

2 Likes

Penso che il file locale.conf dovrebbe avere più di 2 righe. Il mio lo fa. D’altra parte l’output di ‘locales’ sembra normale. Inserirò un file che è possibile copiare in /etc/locale.conf e / etc / default / locale sovrascrivendo entrambi i file. Ma per farlo in modo sicuro, prima dobbiamo copiare i file originali in modo da poterli ripristinare se necessario.

locale.conf-Italian.txt (230 Bytes)

Quindi questo è come (devi essere super user o root):

# cp /etc/locale.conf /etc/locale.conf.bak

# cp /etc/default/locale /etc/default/locale.bak

la l in locale è in minuscolo l Non so perché Discourse sta facendo questo quando inserisco un codice. Quindi ora hai salvato questi file nel caso in cui ciò che proviamo non funzioni.

Ora per sostituire i file scarica il file ‘locale.conf-Italian.txt’ e fai il cd nella directory in cui hai scaricato quel file e fai:

# cp locale.conf-Italian.txt /etc/locale.conf

# cp locale.conf-Italian.txt /etc/default/locale

e ricorda che deve ancora essere una l minuscola. In entrambi i casi, quando viene richiesto se si desidera sovrascrivere il file, selezionare immettere sì. Ora riavvia e guarda se qualcosa è cambiato.

Per spiegare cosa sto facendo qui> Sulla base di ciò che ho sul mio computer questi 2 file hanno contenuti identici, quindi ho preso il mio file e lo ho editato per sostituire en_US con it_IT per il locale italiano.

I think the locale.conf file should have more than 2 lines. Mine does. On the other hand the output of ‘locales’ looks normal. I’m going to post a file that you can copy to /etc/locale.conf and /etc/default/locale overwriting both files. But to do this safely we first copy the original files so you can revert to them if needed.

locale.conf-Italian.txt (230 Bytes)

So this is how to (you will need to be super user or root):

# cp /etc/locale.conf /etc/locale.conf.bak

# cp /etc/default/locale /etc/default/locale.bak

the l in locale is lowercase l I dont know why Discourse is doing this when I post as code. So now you have saved these files in case what we try does not work.

Now to replace the files download the ‘locale.conf-Italian.txt’ file and cd to the directory where you downloaded that file and do:

# cp locale.conf-Italian.txt /etc/locale.conf

# cp locale.conf-Italian.txt /etc/default/locale

and remember that is still supposed to be a lowercase l. In both cases when it asks if you want to overwrite the file select enter yes. Now reboot and see if anything changed.

To explain what I’m doing here > Based on what I have on my computer these 2 files have identical contents so I jut took my file and edited it to replace en_US with it_IT for the Italian locale.

:monkey_face: