Score:1

Can't install Java on Ubuntu Server 20.04.3 LTS

ug flag

So when I go to paste in:

sudo add-apt-repository ppa:linuxuprising/java

It says:

N: Ignorerar filen ”linuxuprising-” i katalogen ”/etc/apt/sources.list.d/” eftersom den inte har en filändelse

It's in Swedish but it basically ignores a file because it hasn't got a file ending. After this, I get a bunch of warnings telling me some packages are configured multiple times. No matter what I type it's always ignoring a file from linuxuprising. What do I do?

The content of linuxuprising-java.list is deb http://ppa.launchpad.net/linuxuprising/java/ubuntu focal main. This normal?

Complete Error message:

N: Ignorerar filen ”linuxuprising-” i katalogen ”/etc/apt/sources.list.d/” eftersom den inte har en filändelse
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/linuxuprising                                                                                                                        -java.list:1 and /etc/apt/sources.list.d/linuxuprising-ubuntu-java-focal.list:1
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/linuxuprising-j                                                                                                                        ava.list:1 and /etc/apt/sources.list.d/linuxuprising-ubuntu-java-focal.list:1
W: Target Translations (main/i18n/Translation-sv_SE) is configured multiple times in /etc/apt/sources.list.d/linuxupr                                                                                                                        ising-java.list:1 and /etc/apt/sources.list.d/linuxuprising-ubuntu-java-focal.list:1
W: Target Translations (main/i18n/Translation-sv) is configured multiple times in /etc/apt/sources.list.d/linuxuprisi                                                                                                                        ng-java.list:1 and /etc/apt/sources.list.d/linuxuprising-ubuntu-java-focal.list:1
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/linuxuprisi                                                                                                                        ng-java.list:1 and /etc/apt/sources.list.d/linuxuprising-ubuntu-java-focal.list:1
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/linuxuprising-java.li                                                                                                                        st:1 and /etc/apt/sources.list.d/linuxuprising-ubuntu-java-focal.list:1
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/linuxuprising-java.list                                                                                                                        :1 and /etc/apt/sources.list.d/linuxuprising-ubuntu-java-focal.list:1
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/linuxuprising                                                                                                                        -java.list:1 and /etc/apt/sources.list.d/linuxuprising-ubuntu-java-focal.list:1
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/linuxuprising-j                                                                                                                        ava.list:1 and /etc/apt/sources.list.d/linuxuprising-ubuntu-java-focal.list:1
W: Target Translations (main/i18n/Translation-sv_SE) is configured multiple times in /etc/apt/sources.list.d/linuxupr                                                                                                                        ising-java.list:1 and /etc/apt/sources.list.d/linuxuprising-ubuntu-java-focal.list:1
W: Target Translations (main/i18n/Translation-sv) is configured multiple times in /etc/apt/sources.list.d/linuxuprisi                                                                                                                        ng-java.list:1 and /etc/apt/sources.list.d/linuxuprising-ubuntu-java-focal.list:1
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/linuxuprisi                                                                                                                        ng-java.list:1 and /etc/apt/sources.list.d/linuxuprising-ubuntu-java-focal.list:1
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/linuxuprising-java.li                                                                                                                        st:1 and /etc/apt/sources.list.d/linuxuprising-ubuntu-java-focal.list:1
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/linuxuprising-java.list                                                                                                                        :1 and /etc/apt/sources.list.d/linuxuprising-ubuntu-java-focal.list:1

I tried doing

sudo apt autoremove
sudo apt-get update 
sudo apt-get install openjdk-17-jdk. 

That should remove unneeded packages, update the internal list of packages, and install OpenJDK. But when I try these none of them work, not even the apt-get update. Here is the error I get:

filip@filip:~$ sudo apt autoremove
E: Malformed entry 1 in list file /etc/apt/sources.list.d/linuxuprising.list (Suite)
E: The list of sources could not be read.,
E: Malformed entry 1 in list file /etc/apt/sources.list.d/linuxuprising.list (Suite)
E: The list of sources could not be read.,
filip@filip:~$ sudo apt-get update
E: Malformed entry 1 in list file /etc/apt/sources.list.d/linuxuprising.list (Suite)
E: The list of sources could not be read.,
filip@filip:~$ sudo apt-get install openjdk-17-jdk
E: Malformed entry 1 in list file /etc/apt/sources.list.d/linuxuprising.list (Suite)
E: The list of sources could not be read.,
E: Malformed entry 1 in list file /etc/apt/sources.list.d/linuxuprising.list (Suite)
E: The list of sources could not be read.,

The error looks a little different now after I added a file extension to the linuxuprising directory.

cat /etc/apt/sources.list
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://se.archive.ubuntu.com/ubuntu focal main restricted
# deb-src http://se.archive.ubuntu.com/ubuntu focal main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://se.archive.ubuntu.com/ubuntu focal-updates main restricted
# deb-src http://se.archive.ubuntu.com/ubuntu focal-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://se.archive.ubuntu.com/ubuntu focal universe
# deb-src http://se.archive.ubuntu.com/ubuntu focal universe
deb http://se.archive.ubuntu.com/ubuntu focal-updates universe
# deb-src http://se.archive.ubuntu.com/ubuntu focal-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://se.archive.ubuntu.com/ubuntu focal multiverse
# deb-src http://se.archive.ubuntu.com/ubuntu focal multiverse
deb http://se.archive.ubuntu.com/ubuntu focal-updates multiverse
# deb-src http://se.archive.ubuntu.com/ubuntu focal-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://se.archive.ubuntu.com/ubuntu focal-backports main restricted universe                                                                                                                                                              multiverse
# deb-src http://se.archive.ubuntu.com/ubuntu focal-backports main restricted un                                                                                                                                                             iverse multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu focal partner
# deb-src http://archive.canonical.com/ubuntu focal partner

deb http://se.archive.ubuntu.com/ubuntu focal-security main restricted
# deb-src http://se.archive.ubuntu.com/ubuntu focal-security main restricted
deb http://se.archive.ubuntu.com/ubuntu focal-security universe
# deb-src http://se.archive.ubuntu.com/ubuntu focal-security universe
deb http://se.archive.ubuntu.com/ubuntu focal-security multiverse
# deb-src http://se.archive.ubuntu.com/ubuntu focal-security multiverse
/etc/apt/sources.list.d/
linuxuprising-java.list  linuxuprising-java.list.save  linuxuprising.list  linuxuprising-ubuntu-java-focal.list  linuxuprising-ubuntu-java-focal.list.save  nodesource.list  nodesource.list.save
in flag
Based on the results, I'd venture that you will need to edit your `linuxuprising-java.list` file to comment out (or remove) the duplicates. Which version of Ubuntu are you running?
guiverc avatar
cn flag
Does this answer your question? [How can I fix apt error "W: Target Packages ... is configured multiple times"?](https://askubuntu.com/questions/760896/how-can-i-fix-apt-error-w-target-packages-is-configured-multiple-times)
karel avatar
sa flag
Does this answer your question? [How do remove "Ignoring file in directory /etc/apt/sources.list.d/ as it has an invalid filename extension?](https://askubuntu.com/questions/458598/how-do-remove-ignoring-file-in-directory-etc-apt-sources-list-d-as-it-has-an)
cocomac avatar
cn flag
Why aren't you just using the `openjdk-[version]-[jre/jdk]` packages? What are you trying to do with a PPA?
ItzFoil  avatar
ug flag
I tried using the links karel and guiverc provided but it says that the file or directory doesn't exist when I paste in the command.
EODCraft Staff avatar
cn flag
I'd be real careful adding off the wall repo's...Esp. with the log4j exploit. Follow @cocomac 's advice!
ItzFoil  avatar
ug flag
cocomac and @EODCraft Staff, I have already tried and I get the same message
cocomac avatar
cn flag
@ItzFoil What exact command are you using to install OpenJDK?
vidarlo avatar
om flag
@ItzFoil Don't paste in random commands. Understand what they do.
ItzFoil  avatar
ug flag
@cocomac I've tried basically every command I can get my hands on. At last, I got Java 17 installed but the invalid file extension error remains.
cocomac avatar
cn flag
Try these commands: `sudo apt autoremove && sudo apt-get update && sudo apt-get install openjdk-17-jdk`. That remove un-needed packages, updates the internal list of packages, and installs OpenJDK. [edit] your question to include what happens then
Someone avatar
my flag
Please [edit] your question to include the output of `cat /etc/apt/sources.list` and `ls /etc/apt/sources.list.d/`
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.