Score:1

Whenever i'm Trying to install any package I'm getting "E: Sub-process /usr/bin/dpkg returned an error code (1)"

cg flag
➜  ChessV  sudo apt-get -f install install-info         
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
install-info is already the newest version (6.8-4build1).
0 upgraded, 0 newly installed, 0 to remove and 187 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up install-info (6.8-4build1) ...
/usr/sbin/update-info-dir: 4: /etc/environment: Syntax error: Unterminated quoted string
dpkg: error processing package install-info (--configure):
 installed install-info package post-installation script subprocess returned error exit status 2
Errors were encountered while processing:
 install-info
E: Sub-process /usr/bin/dpkg returned an error code (1)

I've tried -f install a package I even tried to reinstall the install-info package it doesn't seem to work I'm also not able to update my ubuntu or install any other package

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin" JAVA_HOME="JAVA_HOME="/lib/jvm/java-11-openjdk-amd64/bin/java"
FedKad avatar
cn flag
It says that there is something wrong with the file `/etc/environment`. Please check the contents of this file. You can copy a correct one from another working system.
Aakash Chouksey avatar
cg flag
can you elaborate a little more im new to this
Score:2
cn flag

The contents of the /etc/environment file on my system is a single line like this:

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

I am running Ubuntu 22.10.

Please, check the file on your system. You are possibly missing the double quote (") at the end of the line or there might be other missing or extraneous data in your file.

As you see, the contents of your file contain extraneous information. The first part (starting with PATH=) is the same as mine. However, the rest of the line (starting with JAVA_HOME=) should be put on a separate line and by removing the duplicate part (JAVA_HOME="). Your file should be something like this:

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
JAVA_HOME="/lib/jvm/java-11-openjdk-amd64/bin/java"

However, I recommend to check whether the second line is really needed, because JAVA may not be installed on your system. Please, check with the command:

$ file /lib/jvm/java-11-openjdk-amd64/bin/java
/lib/jvm/java-11-openjdk-amd64/bin/java: cannot open `/lib/jvm/java-11-openjdk-amd64/bin/java' (No such file or directory)

If it says (No such file or directory) as in the example above, you can remove the second line completely and leave only the first line as I gave you on my first example.


You can edit your file with one you are familiar of the below commands:

$ sudo vi /etc/environment

$ gedit admin:///etc/environment

$ gnome-text-editor admin:///etc/environment
Aakash Chouksey avatar
cg flag
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin" JAVA_HOME="JAVA_HOME="/lib/jvm/java-11-openjdk-amd64/bin/java" this is the output of the /etc/enviornment file on my machine I'm running 22.04 I do have double quotations at the end of the path
FedKad avatar
cn flag
Please edit your question and add this information into your original question ***by properly formatting it***. In this form as you posted in a comment, I cannot decide about the problem in the contents.
Aakash Chouksey avatar
cg flag
thank you for being so patient with me id as you asked I have put them out of the /etc/environment in the question itself
FedKad avatar
cn flag
@AakashChouksey Please, check my updated answer. If it is OK, be sure to confirm by upvoting and/or clicking on the check mark. This is important for other people who may have a similar problem.
Aakash Chouksey avatar
cg flag
as you suggest above both the path on my system are on a separate line and I do have Java installed on my system I regularly use It too. I'm sorry to say but this might not be the solution
FedKad avatar
cn flag
You said that your file contains something like `...JAVA_HOME="JAVA_HOME="...` which is wrong. Check my answer once more!
Aakash Chouksey avatar
cg flag
@FedKad thanks for the response sorry it was my mistake and was correct and my system is now working just fine sorry I cant upvote it I don't have 15 reputation
Raffa avatar
jp flag
@AakashChouksey I Will upvote it instead ... But you can [accept the answer](https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work) if it worked for you.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.