E: Subprocesso / usr / bin / dpkg retornou um código de erro (1) [Relacionado ao KVM]

1

Eu tentei instalar o KVM no Ubuntu 17.10 e recebi este erro:

**anuragabhi@abhishek-Notebook:~$** sudo aptitude install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils

[sudo] password for anuragabhi: 
The following NEW packages will be installed:

    at{a} augeas-lenses{a} bridge-utils dctrl-tools{a} debootstrap{a} devscripts{a} dmeventd{a} dput{a} ebtables{a} ipxe-qemu{a} 
    kpartx{a} libaugeas0{a} libb-hooks-endofscope-perl{a} libboost-random1.62.0{a} libboost-regex1.62.0{a} libcacard0{a} 
    libclass-method-modifiers-perl{a} libclass-xsaccessor-perl{a} libdata-optlist-perl{a} libdevel-globaldestruction-perl{a} 
    libdevmapper-event1.02.1{a} libdistro-info-perl{a} libfdt1{a} libfile-chdir-perl{a} libfile-homedir-perl{a} libfile-which-perl{a}
    libgetopt-long-descriptive-perl{a} libgit-wrapper-perl{a} libibverbs1{a} libimport-into-perl{a} libio-stringy-perl{a} libiscsi7{a} 
    liblist-compare-perl{a} liblvm2app2.2{a} liblvm2cmd2.02{a} libmodule-implementation-perl{a} libmodule-runtime-perl{a} 
    libmoo-perl{a} libnamespace-clean-perl{a} libnetcf1{a} libnumber-compare-perl{a} libnumber-range-perl{a} libpackage-stash-perl{a}
    libpackage-stash-xs-perl{a} libparams-classify-perl{a} libparams-util-perl{a} libparams-validate-perl{a} 
    libpath-iterator-rule-perl{a} libpath-tiny-perl{a} libpod-constants-perl{a} librados2{a} librbd1{a} libreadline5{a}
    librole-tiny-perl{a} libsort-key-perl{a} libsort-versions-perl{a} libspice-server1{a} libstrictures-perl{a}
    libstring-copyright-perl{a} libstring-escape-perl{a} libsub-exporter-perl{a} libsub-exporter-progressive-perl{a}
    libsub-identify-perl{a} libsub-install-perl{a} libsub-quote-perl{a} libtext-glob-perl{a} libtry-tiny-perl{a} 
    libunicode-utf8-perl{a} libusbredirparser1{a} libvariable-magic-perl{a} libvirt-bin libvirt-clients{a} libvirt-daemon{a} 
    libvirt-daemon-system{a} libvirt0{a} libxen-4.9{a} libxenstore3.0{a} libxml2-utils{a} licensecheck{a} lvm2{a} python-cheetah{a} 
    python-libvirt{a} python-vm-builder{a} python3-magic{a} python3-unidiff{a} qemu-block-extra{a} qemu-kvm qemu-system-common{a} 
    qemu-system-x86{a} qemu-utils{a} seabios{a} sharutils{a} ubuntu-vm-builder wdiff{a}

The following partially installed packages will be configured:
    install-info  
0 packages upgraded, 94 newly installed, 0 to remove and 49 not upgraded.
Need to get 0 B/21.4 MB of archives. After unpacking 91.9 MB will be used.
Do you want to continue? [Y/n/?] y
Extracting templates from packages: 100% 
Preconfiguring packages ...
Setting up install-info (6.4.90.dfsg.1-1build1) ...
/usr/sbin/update-info-dir: 3: /etc/environment: $: not found
dpkg: error processing package install-info (--configure):
    subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
    install-info
E: Sub-process /usr/bin/dpkg returned an error code (1)
Setting up install-info (6.4.90.dfsg.1-1build1) ...
/usr/sbin/update-info-dir: 3: /etc/environment: $: not found
dpkg: error processing package install-info (--configure):
     subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
     install-info

Para resolver o erro de DPKG, tentei a solução fornecida no link:

E: Subprocesso / usr / bin / dpkg retornou um código de erro (1) [relacionado ao Google Chrome]

Mas nada parece funcionar.

Eu tentei alguns comandos e a saída é a seguinte:

anuragabhi@abhishek-Notebook:~$ cat /usr/sbin/update-info-dir
#!/bin/sh
# update-info-dir
# create a dir file from all installed info files
# Copyright 2009, 2014 Norbert Preining
# GPLv2

unset LANGUAGE
unset LANG
if [ -r /etc/environment ] ; then
      . /etc/environment
fi
if [ -r /etc/default/locale ] ; then
    . /etc/default/locale
fi

Help ()
{
    echo "\
SYNOPSIS: update-info-dir [-h,--help] [info-directory]

(re-)creates the index of available documentation in info format
(the file /usr/share/info/dir) which is usually presented by info 
browsers
on startup."

    exit 0
}


if [ "" = "-h" ] || [ "" = "--help" ]; then
    Help
fi

if [ -n "" ] ; then
    INFODIR=""
fi

if [ ! -d "$INFODIR" ] ; then
    echo "Not a directory: $INFODIR." >&2
    exit 1
fi

if [ -r "$INFODIR/dir" ] ; then
    rm -f "$INFODIR/dir.old"
    cp $INFODIR/dir $INFODIR/dir.old
fi

# we have to remove the dir file not make install-info being surprised
rm -f "$INFODIR/dir"

errors=0
find "$INFODIR" -type f | while read file ; do
    case $file in
    */dir|*/dir.gz|*/dir.old|*/dir.old.gz|*-[0-9]|*-[0-9].gz|*-[1-9]
[0-9]|*-[1-9][0-9].gz|*.png|*.jpg)
      # these files are ignored
      continue
    ;;
*)
    install-info "$file" "$INFODIR/dir" || {
    errors=$((errors+1))
  }
  ;;
    esac
done

if [ $errors -gt 0 ] ; then
    exec >&2
    echo
    echo "Updating the index of info documentation produced $errors 
    errors."
fi

exit 0

# vim:set expandtab tabstop=2: #

e:

anuragabhi@abhishek-Notebook:~$ cat /etc/environment

PATH=" 
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/g a
mes:/usr/local/games"


$ cat >> etc/environment <<EOL
JAVA_HOME=/usr/bin/lib/jvm/java-8-oracle
JRE_HOME=/usr/lib/jvm/java-8-oracle/jre
EOL
    
por Anurag 04.03.2018 / 17:43

1 resposta

1

A primeira mensagem de erro informa o conto: /usr/sbin/update-info-dir: 3: /etc/environment: $: not found . Como você pode ver, o script update-info-dir usa apenas /etc/environment como um parâmetro para . it ( . também é o bash command source ), para definir alguns parâmetros no ambiente do processo atual .

No meu sistema Ubuntu 16.04.4 (YMMV), ele contém a configuração inicial de PATH , uma variável muito importante. PATH é a lista de diretórios separados por dois pontos, na qual bash procura por executáveis.

Você pode corrigir seu problema:

/usr/bin/sudo /bin/rm /etc/environment
echo 'PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" | /usr/bin/sudo /usr/bin/tee /etc/environment'
/bin/chmod 0644 /etc/environment
    
por waltinator 04.03.2018 / 18:44