0
zhiwei@zhiwei-Lenovo-Rescuer-15ISK:~$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  flashplugin-installer libpango1.0-0 libpangox-1.0-0
Suggested packages:
  x-ttcidfont-conf ttf-mscorefonts-installer ttf-bitstream-vera | ttf-dejavu
  ttf-xfree86-nonfree xfs
The following NEW packages will be installed:
  libpango1.0-0 libpangox-1.0-0
The following packages will be upgraded:
  flashplugin-installer
1 upgraded, 2 newly installed, 0 to remove and 201 not upgraded.
2 not fully installed or removed.
Need to get 0 B/51.7 kB of archives.
After this operation, 122 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
Setting up install-info (6.5.0.dfsg.1-2) ...
/usr/sbin/update-info-dir: 46: /etc/environment: 34:ln=01: not found
dpkg: error processing package install-info (--configure):
 installed install-info package post-installation script subprocess returned error exit status 127
Errors were encountered while processing:
 install-info
E: Sub-process /usr/bin/dpkg returned an error code (1)

It seems that there's something wrong with my environment file, here's its content:

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
    SUDO_GID=1000
    MAIL=/var/mail/root
    LANGUAGE=zh_CN:zh
    LC_TIME=en_CA.UTF-8
    USER=root
    HOME=/home/zhiwei
    LC_MONETARY=en_CA.UTF-8
    COLORTERM=truecolor
    SUDO_UID=1000
    LOGNAME=root
    TERM=xterm-256color
    USERNAME=root
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
    LC_ADDRESS=en_CA.UTF-8
    DISPLAY=:0
    LANG=zh_CN.UTF-8
    LC_TELEPHONE=en_CA.UTF-8
    XAUTHORITY=/run/user/1000/gdm/Xauthority
    SUDO_COMMAND=./.sh
    LC_NAME=en_CA.UTF-8
    SHELL=/bin/bash
    SUDO_USER=zhiwei
    LC_MEASUREMENT=en_CA.UTF-8
    LC_IDENTIFICATION=en_CA.UTF-8
    PWD=/media/zhiwei/DATA
    LC_NUMERIC=en_CA.UTF-8
    LC_PAPER=en_CA.UTF-8
    SUDO_GID=1000
    MAIL=/var/mail/root
    LANGUAGE=zh_CN:zh
    LC_TIME=en_CA.UTF-8
    USER=root
    HOME=/home/zhiwei
    LC_MONETARY=en_CA.UTF-8
    COLORTERM=truecolor
    SUDO_UID=1000
    LOGNAME=root
    TERM=xterm-256color
    USERNAME=root
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
    LC_ADDRESS=en_CA.UTF-8
    DISPLAY=:0
    LANG=zh_CN.UTF-8
    LC_TELEPHONE=en_CA.UTF-8
    LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:*.
    XAUTHORITY=/run/user/1000/gdm/Xauthority
    SUDO_COMMAND=./.sh
    LC_NAME=en_CA.UTF-8
    SHELL=/bin/bash
    SUDO_USER=zhiwei
    LC_MEASUREMENT=en_CA.UTF-8
    LC_IDENTIFICATION=en_CA.UTF-8
    PWD=/media/zhiwei/DATA
    LC_NUMERIC=en_CA.UTF-8
    LC_PAPER=en_CA.UTF-8
    SUDO_GID=1000
    MAIL=/var/mail/root
    LANGUAGE=en
    LC_TIME=en_CA.UTF-8
    USER=root
    HOME=/home/zhiwei
    LC_MONETARY=en_CA.UTF-8
    COLORTERM=truecolor
    SUDO_UID=1000
    LOGNAME=root
    TERM=xterm-256color
    USERNAME=root
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
    LC_ADDRESS=en_CA.UTF-8
    DISPLAY=:0
    LANG=en_US.UTF-8
    LC_TELEPHONE=en_CA.UTF-8
    LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
    XAUTHORITY=/run/user/1000/gdm/Xauthority
    SUDO_COMMAND=./.sh
    LC_NAME=en_CA.UTF-8
    SHELL=/bin/bash
    SUDO_USER=zhiwei
    LC_MEASUREMENT=en_CA.UTF-8
    LC_IDENTIFICATION=en_CA.UTF-8
    PWD=/media/zhiwei/DATA
    LC_NUMERIC=en_CA.UTF-8
    LC_PAPER=en_CA.UTF-8

How should I resolve this error?

  • 1
    What exactly did you do to cause your /etc/environent file to look like that? nothing after the first line looks like it belongs there – steeldriver Apr 06 '18 at 21:18

2 Answers2

0

''' The /etc/environment file normally contains only this line:

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"

'''

0

That output is the output from the env command, not the content of any "normal" /etc/environment file.

These type of errors during package adds and updates usually can be cleared by running this command:

$ dpkg --configure -a

And, although the similar error I just received when doing upgrades in Ubuntu Mate 18 was not resolved by running the command, it has in fact worked for me until last night in every other case.

Related packages being upgraded during times when LTS versions are fading into the past, along with their software updates that match the deps, and you start getting this stuff happen again, much like when when Ubuntu 14.x.x was reaching EOL.

It is much better now, and dist-upgrade has been working better than ever, BUT here that problem seems to have popped its head up again.

Solved:

https://askubuntu.com/questions/1069702/dpkg-error-processing-package-install-info

My exact package issue was with locales but the rest is exactly the same and the solution needs adjustment to the package you are having issues with.

Sorry about the bad formatting. This is my first post here and with code remarks after 25 years on the internet I don't really care if that is wrong just sending the right answer without going back to my main terminal to reply to this.

I have tried the solution provided by the link above. It worked instantly on this system I am writing from and remoted into.

The usual dpkg command fails, and will continue to endlessly. Been there, done that.

# dpkg --configure -a
Setting up locales (2.31-0ubuntu9) ...
/var/lib/dpkg/info/locales.postinst: 64: /var/lib/dpkg/info/locales.postinst: locale-gen: not found
dpkg: error processing package locales (--configure):
 installed locales package post-installation script subprocess returned error exit status 127
Errors were encountered while processing:
 locales
root@main:~# mv /var/lib/dpkg/info/locales.postinst /var/lib/dpkg/info/locales.postinst.bad
root@main:~# apt-get update
Hit:1 http://us.archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://security.ubuntu.com/ubuntu focal-security InRelease [107 kB]      
Get:3 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease [111 kB]     
Hit:4 http://archive.canonical.com/ubuntu xenial InRelease                     
Get:5 http://us.archive.ubuntu.com/ubuntu focal-backports InRelease [98.3 kB]  
Fetched 317 kB in 1s (427 kB/s)                               
Reading package lists... Done
root@mine-hive-main:~# dpkg --configure -a
Setting up locales (2.31-0ubuntu9) ...

From there all is well, again, with dpkg and apt.

Simon Sudler
  • 3,931
  • 3
  • 21
  • 34