Cannot reinstall Cassandra on Ubuntu 18.04 - java

I have a standard version of Ubuntu 18.04 freshly installed and want to use it as a Cassandra node.
I went through the following steps to install Cassandra:
##
## Install java 1.8
sudo apt install openjdk-8-jre -y
##
## Check java version
java -version
##
## Create the JAVA_HOME link
echo "JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:bin/java::")" | sudo tee -a /etc/profile
source /etc/profile
echo $JAVA_HOME
##
## Create the Apache Cassandra 3.11.x apt repo:
echo "deb http://www.apache.org/dist/cassandra/debian 311x main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list
curl https://www.apache.org/dist/cassandra/KEYS | sudo apt-key add -
sudo apt-get update
##
## If GPG public key error
sudo apt-key adv --keyserver pool.sks-keyservers.net --recv-key A278B781FE4B2BDA
sudo apt-get update
##
## Install cassandra
sudo apt-get install cassandra
##
## Service status
sudo service cassandra status
Output:
cassandra.service - LSB: distributed storage system for structured data
Loaded: loaded (/etc/init.d/cassandra; generated)
Active: active (exited) since Thu 2018-08-02 23:03:47 UTC; 4h 2min ago
Docs: man:systemd-sysv-generator(8)
Tasks: 0 (limit: 4662)
CGroup: /system.slice/cassandra.service
The "active (exited)" part makes me think something went wrong.
I wanted to give it a re-try, and uninstall cassandra by doing:
sudo apt-get remove cassandra
sudo apt-get purge "cassandra-*"
sudo rm -rf /var/lib/cassandra
sudo rm -rf /var/log/cassandra
sudo rm -rf /etc/cassandra
sudo apt-get update
went through the same installing steps, and now /etc/cassandra contains only /triggers/, all configuration files are missing.
My guess is that I haven't completely cleant up something

In my limited debian/ubuntu experience, purging a package does nothing for removing dependencies. So people make the mistake that if they purge a package, then their system is returned to the state that it was in before the package was installed, which isn't true because all off the dependencies and their config files are still in the system.
So when removing a package, remove the dependencies too. I would do something like this:
sudo apt-get remove package_name
sudo apt-get purge package_name
sudo apt-get --purge autoremove
sudo apt-get clean
As far as your original problem, I would ask if it logged any errors in /var/log/cassandra/system.log but it looks like you deleted the logs.
Did java -version output what you expected?
Also make sure you have python and python-support installed
After doing a google search, you could check this out
Cassandra status changing from active(running) to active(exited) without any errors

Related

Update gitlab JDK to JDK17 (VM doesn't have internet connection)

I am using Gitlab to build a Java tool using ant
The tool requires JDK 17, but ant JDK version is 11, and I'm trying to change it.
So I tried a lot of solutions using a remote repository or remote download site, but after some tries I found out that the VM used to build the tool is not connected to internet (trying to ping google or my IP address doesn't work).
So I tried to upload in the same package with the tool source code the JDK 17 (openjdk-17_linux-x64_bin.tar.gz) and install it there.
Here is the problem, I am not sure how to do this since I don't work with linux, but I tried almost everything on the internet.
Every of these commands are used in a .gitlab-ci.yml file, used for gitlab pipeline.
Here are some examples of what I've tried so far:
- sudo cp /builds/project/openjdk-17_linux-x64_bin.tar.gz /usr/lib/jvm
- sudo tar zxvf "/usr/lib/jvm/openjdk-17_linux-x64_bin.tar.gz" -C /usr/lib/jvm
- echo "JAVA_HOME=/usr/lib/jvm/jdk-17" | sudo tee -a /etc/profile
- echo "PATH=${PATH}:${HOME}/bin:${JAVA_HOME}/bin" | sudo tee -a /etc/profile
- echo "export JAVA_HOME" | sudo tee -a /etc/profile
- echo "export JRE_HOME" | sudo tee -a /etc/profile
- echo "export PATH" | sudo tee -a /etc/profile
- sudo cat /etc/profile
- echo "JAVA_HOME=/usr/lib/jvm/jdk-17" | sudo tee -a /.bashrc
- echo "PATH=${PATH}:${JAVA_HOME}/bin" | sudo tee -a /.bashrc
- echo "JAVA_HOME='/usr/lib/jvm/jdk-17' | sudo tee -a /etc/environment"
- export JAVA_HOME=/usr/lib/jvm/jdk-17
- export PATH=$PATH:$JAVA_HOME/bin
After a lot of combinations of these commands the output of sudo update-alternatives --config java is still:
openjdk version "11.0.12" 2021-07-20
OpenJDK Runtime Environment (build 11.0.12+7-post-Debian-2deb10u1)
OpenJDK 64-Bit Server VM (build 11.0.12+7-post-Debian-2deb10u1, mixed mode, sharing)
But if I try /usr/lib/jvm/jdk-17/bin/java -version it prints 17.
What would be the solution of making the default Java version to be 17. (Also a solution for ant to use the JDK-17 without installing it would be great too, since I need the JDK-17 for ant)
Since you've already found a way to change the jdk on-the-go, you may really want to consider change the base image of your CI to save yourself a lot of time. This step will boost your CI speed. The steps to do that is fairly simple too.
Compose your own Dockerfile
This following is just a pesudo code. You may look into the description of dockerfile builder
FROM your-original-image. This is what you have in your image tag in the gitlab-ci file.
COPY jdk-17-linux-x64.tar.gz /usr/lib/jvm
RUN sudo tar zxvf "/usr/lib/jvm/jdk-17-linux-x64.tar.gz" -C /usr/lib/jvm \
&& sudo \cp -r /usr/lib/jvm/jdk-17 /usr/lib/jvm/java-1.11.0-openjdk-amd64 \
&& sudo \cp -r /usr/lib/jvm/jdk-17 /usr/lib/jvm/default-java \
&& sudo \cp -r /usr/lib/jvm/jdk-17 /usr/lib/jvm/java-11-openjdk-amd64 \
&& sudo \cp -r /usr/lib/jvm/jdk-17 /usr/lib/jvm/openjdk-11 \
&& sudo update-alternatives --remove-all java \
&& sudo update-alternatives --remove-all javac \
&& sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk-17/bin/java 1
Build the docker image
If you are using docker hub, then you need to login to docker and get a dockerId which matches the dockerId in the snippet.
If you are using a private repo like harbor or artifactory, you may need the permission to push to it.
docker build . -t dockerId/Name-of-your-image-you-want:latest
Upload the docker image using docker push
docker push dockerId/Name-of-your-image-you-want:latest
change the image tag in your gitlab-ci.yaml to dockerId/Name-of-your-image-you-want:latest
I found a solution.
- sudo cp jdk-17-linux-x64.tar.gz /usr/lib/jvm
- sudo tar zxvf "/usr/lib/jvm/jdk-17-linux-x64.tar.gz" -C /usr/lib/jvm
- sudo \cp -r /usr/lib/jvm/jdk-17 /usr/lib/jvm/java-1.11.0-openjdk-amd64
- sudo \cp -r /usr/lib/jvm/jdk-17 /usr/lib/jvm/default-java
- sudo \cp -r /usr/lib/jvm/jdk-17 /usr/lib/jvm/java-11-openjdk-amd64
- sudo \cp -r /usr/lib/jvm/jdk-17 /usr/lib/jvm/openjdk-11
- sudo update-alternatives --remove-all java
- sudo update-alternatives --remove-all javac
- sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk-17/bin/java 1
What I did here was to copy the JDK-17 content to all folders from /usr/lib/jvm folder. So even though the docker image uses JDK-11, I'm rewriting it using JDK-17 uploaded with the source code, and now the tool is built using JKD-17.
PS: I know this is slower and not professional, but in my case, it's easier and more convinient than trying to get help from those who setup the docker container.

How to install openjdk-8-jdk on Debian 10 (Buster)?

It seems Debian does not support openjdk-8-jdk anymore due to a security issue. What is the easiest way to install openjdk-8-jdk for Debian 10 (Buster)?
Alternatively, you can use adoptopenjdk repository:
wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add -
sudo add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/
sudo apt-get update && sudo apt-get install adoptopenjdk-8-hotspot
https://adoptopenjdk.net/installation.html
WARNING: this answer suggest unsupported and dangerous mixing of
Debian releases. Follow the advice on your own risk, as it can break
the system on upgrades, as explained in
http://wiki.debian.org/DontBreakDebian#Don.27t_make_a_FrankenDebian
Package mirror search steps:
In the Search package directories search for openjdk-8-jdk. You can see two results:
stretch (oldstable) (java): OpenJDK Development Kit (JDK)
sid (unstable) (java): OpenJDK Development Kit (JDK)
Choose stretch repository
Scroll to the Download openjdk-8-jdk section and choose your architecture. For example amd64
Now you can see mirrors list and instructions how to install the package via apt:
You should be able to use any of the listed mirrors by adding a line
to your /etc/apt/sources.list like this:
deb http://security.debian.org/debian-security stretch/updates main
Installation steps:
Install software source manager
apt-get update
apt-get install software-properties-common
Add mirror with openjdk-8-jdk
apt-add-repository 'deb http://security.debian.org/debian-security stretch/updates main'
apt-get update
Install openjdk 8
apt-get install openjdk-8-jdk
Note: You can use steps above to find an official Debian mirror with any other package you want to install
You can search the Debian packages site and find out the openjdk-8-jdk package for Debian 10 is only available from unstable (sid) repository currently.
At first it is good to check and save current system-wide symbolic links for already installed Java SDK/JRE packages if any:
ls -la /etc/alternatives | grep java > previous-java-alternatives.txt
Then check is this package can be installed with current configuration:
apt-cache policy openjdk-8-jdk
If no then you need to add unstable repository to the sources list.
The negative output may imply that you prefer to use stable repositories and usually it isn't appropriate for you to update all other software from unstable repositories.
So before adding unstable repository to the sources list make sure APT::Default-Release configuration option is set to "stable":
grep -r Default-Release /etc/apt/
If no (as by default) then set it as recommended in that answer by creating this file:
/etc/apt/apt.conf.d/99defaultrelease
APT::Default-Release "stable";
Now you're ready to add the unstable repository to the sources list.
Before I prefer to check what mirror was selected by me when system was installed. Just look to main sources list:
cat /etc/apt/sources.list
In my case the output shows that mirror.yandex.ru server is used as system source. So I use the same for unstables and add this file:
/etc/apt/sources.list.d/91-debian-unstable.list
deb http://mirror.yandex.ru/debian/ unstable main
deb-src http://mirror.yandex.ru/debian/ unstable main
(I also have 90-debian-testing.list file for the testing repo.)
Then update package lists:
apt update
And check you system wont update from unstable sources:
apt list --upgradable
And recheck is required package can be installed:
apt-cache policy openjdk-8-jdk
Do install the package:
apt install openjdk-8-jdk
Look at new symbolic links:
ls -la /etc/alternatives | grep java-8
Just waste few seconds on them (or continue with man 1 update-alternatives).
This is my script which I use to install OpenJDK 8 on Bitbucket's Pipelines Docker image NodeJS 10.16.2.
But now I see that this docker image is based on Stretch...
It is based on https://github.com/docker-library/openjdk/blob/89851f0abc3a83cfad5248102f379d6a0bd3951a/8-jdk/Dockerfile
#!/bin/bash
set -x #echo on
# based on https://github.com/docker-library/openjdk/blob/89851f0abc3a83cfad5248102f379d6a0bd3951a/8-jdk/Dockerfile
apt-get update && apt-get install -y --no-install-recommends \
bzip2 \
unzip \
xz-utils &&
rm -rf /var/lib/apt/lists/*
echo 'deb http://httpredir.debian.org/debian-security stretch/updates main' >/etc/apt/sources.list.d/jessie-backports.list
# Default to UTF-8 file.encoding
export LANG=C.UTF-8
# add a simple script that can auto-detect the appropriate JAVA_HOME value
# based on whether the JDK or only the JRE is installed
{ \
echo '#!/bin/sh'; \
echo 'set -e'; \
echo; \
echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; \
} > /usr/local/bin/docker-java-home \
&& chmod +x /usr/local/bin/docker-java-home
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export JAVA_VERSION=8u252
export JAVA_DEBIAN_VERSION=8u252-b09-1~deb9u1
# see https://bugs.debian.org/775775
# and https://github.com/docker-library/java/issues/19#issuecomment-70546872
export CA_CERTIFICATES_JAVA_VERSION=20170929~deb9u3
set -x \
&& apt-get update \
&& apt-get install -y \
openjdk-8-jdk="$JAVA_DEBIAN_VERSION" \
ca-certificates-java="$CA_CERTIFICATES_JAVA_VERSION" \
&& rm -rf /var/lib/apt/lists/* \
&& [ "$JAVA_HOME" = "$(docker-java-home)" ]
# see CA_CERTIFICATES_JAVA_VERSION notes above
/var/lib/dpkg/info/ca-certificates-java.postinst configure
UPDATE
Things change, versions are upped. Here is the latest script which works for https://hub.docker.com/layers/node/library/node/10.16.2/images/sha256-8f420c033acee137f9e902092a04d371bdf1f839559cce60614c0d5905d20294?context=explore
#!/bin/bash
set -x #echo on
# based on https://github.com/docker-library/openjdk/blob/89851f0abc3a83cfad5248102f379d6a0bd3951a/8-jdk/Dockerfile
apt-get update && apt-get install -y --no-install-recommends \
bzip2 \
unzip \
xz-utils &&
rm -rf /var/lib/apt/lists/*
echo 'deb http://httpredir.debian.org/debian-security stretch/updates main' >/etc/apt/sources.list.d/jessie-backports.list
# Default to UTF-8 file.encoding
export LANG=C.UTF-8
# add a simple script that can auto-detect the appropriate JAVA_HOME value
# based on whether the JDK or only the JRE is installed
{ \
echo '#!/bin/sh'; \
echo 'set -e'; \
echo; \
echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; \
} > /usr/local/bin/docker-java-home \
&& chmod +x /usr/local/bin/docker-java-home
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export JAVA_VERSION=8u265
export JAVA_DEBIAN_VERSION=8u265-b01-0+deb9u1
# see https://bugs.debian.org/775775
# and https://github.com/docker-library/java/issues/19#issuecomment-70546872
export CA_CERTIFICATES_JAVA_VERSION=20170929~deb9u3
set -x \
&& apt-get update \
&& apt-get install -y \
openjdk-8-jdk="$JAVA_DEBIAN_VERSION" \
ca-certificates-java="$CA_CERTIFICATES_JAVA_VERSION" \
&& rm -rf /var/lib/apt/lists/* \
&& [ "$JAVA_HOME" = "$(docker-java-home)" ]
# see CA_CERTIFICATES_JAVA_VERSION notes above
/var/lib/dpkg/info/ca-certificates-java.postinst configure
I needed to install a 32-bit version but this wasn't available at adoptopenjdk far as I could see. I tracked down a copy of a binary at java.com i their downloads area:
jre-8u241-linux-i586.tar.gz
All I needed was the JRE (rather than a JDK, but the process should be the same for either) and since it was also for a personal use only, the Oracle binary was OK (they have limitations in this regard).
I downloaded the binary and placed it in the home folder (~/) of the user that needed to run it and then unzipped it like so:
mkdir ~/java && cd ~/java && tar -xf jre-8u241-linux-i586.tar.gz
Then added the location to the path of the user that would run the Java application by appending this line to ~/.profile:
export PATH=$PATH:/home/youruserid/java/jre1.8.0_241/bin
This worked fine for my case but there are no doubt better ways to install a binary. For example so it is available for all Unix users rather than just one.
The easiest way to install JDK8 is using SDKMAN.
$ curl -s "https://get.sdkman.io" | bash
$ source "$HOME/.sdkman/bin/sdkman-init.sh"
$ sdk install java 8.0.275.hs-adpt
Based one some of the above answers, this is what i used in my shell script on debian buster silm os running node 12.x (node:12.6-buster-slim)
This was in preparing to move to github actions local testing with act, do note that there is no need for sudo as ci testing in this container already is root.
apt-get update -qq
#software-properties-common not installed on slim
apt-get install software-properties-common -y -q
wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | apt-key add -
add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/
apt-get update -qq
#man folder needs to be available for adoptopenjdk-8 to finish configuring
mkdir -p /usr/share/man/man1/
apt-get install adoptopenjdk-8-hotspot -y
#ensure openjdk-8-jdk is found for some installations, thanks b8kich for the virtual wrapper
curl https://gitlab.com/b8kich/adopt-openjdk-8-jdk/-/raw/master/adopt-openjdk-8-jdk_0.1_all.deb?inline=false -o adopt-openjdk-8-jdk_0.1_all.deb
dpkg -i adopt-openjdk-8-jdk_0.1_all.deb
I've found, mainly after years of working with deprecated iDrac consoles which have particular java requirements, that installing multiple versions of the JRE or JDK is preferable as you can choose between them as necessary without worrying about other dependencies or breaking your package manager.
This is actually incredibly easy on Debian, and very probably other linux, by eschewing the package manager all together and manually installing whatever versions you need.
Download your desired jre/jdk from the Oracle archives (You will need a free Oracle account) here for whatever architecture you need: https://www.oracle.com/java/technologies/downloads/archive/
I selected "Java SE 8 (8u211 and later)" from the menu and snagged jre-8u271-linux-x64.tar.gz.
From there, extract the archive to a location accessible to the user who will be running java; Typically I'll extract to "/usr/local/lib/jre1.8.0_271/".
From here you can run /usr/local/lib/jre1.8.0_271/bin/java successfully, as well as javaws.
/usr/local/lib/jre1.8.0_271/bin# ./java -version
java version "1.8.0_271"
Java(TM) SE Runtime Environment (build 1.8.0_271-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.271-b09, mixed mode)
On most of my systems I already have some packaged version of jre installed that's native to the release, so my /usr/bin/java and /usr/bin/javaws typically are symlinks to /etc/alternatives/java /etc/alternatives/javaws, respectively.
To switch the system to a particular jre, just update the relevant symlinks to point to the version of your choice:
rm /usr/bin/java /usr/bin/javaws /usr/bin/jjs /usr/bin/jcontrol
for i in java javaws jjs jcontrol; do ln -s /usr/local/lib/jre1.8.0_271/bin/$i /usr/bin/$i; done
Note that if you need, per say, jre 7, 11 and 17 you can download and extract each version to a particular named folder in /usr/local/lib, or your home directory if you'll be launching it manually, and utilize each of them individually as needed by updating the symlinks or just running them directly.
I just faced a similar problem:
I have on old HP-mini 210 netbook to be used as a "car logger" and it has to use java 8 32bit (required by the logger application).
I'm running a light distro based on Debian 10 (BunsenLabs Lithyum).
After poking around the easyest way I found to install java 8 32bits was by using an openjdk 8 deb package published by OpenLogic (they have 32 or 64 bits):
https://www.openlogic.com/openjdk-downloads
Just download and install (package manager). Worked 100% and now I have a super fast hp-mini "car logger".
I was migrating from Jessie to Buster, and found that not-so-old, legacy code would not compile and run on JDK11.
I managed to copy all java8 folders from my Jessie distribution, reworked the links, and set that as a new JDK on Eclipse. That works so far.
the easiest way I have found to download java 8 on debian buster is to use the command su apt-get install openjdk-8-jdk

How do I put Java onto a Ubuntu docker container?

I currently have a docker container with an Ubuntu(17.10) image installed with other packages included. However, I'm currently having difficulty trying to install Java onto this container in addition to the current image.
Current Dockerfile :
FROM cityofzion/neo-privatenet
ADD files/ files/
ENTRYPOINT [ "/bin/bash" ]
When trying to find information on how to do this and testing inside of the container most suggest using this command: apt-get install -y oracle-java9-installer
However this results in:E: Unable to locate package oracle-java9-installer
I have also tried this suggested command wget http://download.java.net/java/GA/jdk9/9/binaries/jdk-9+181_linux-x64_bin.tar.gz
Which produces this result HTTP request sent, awaiting response...
404 Not Found - ERROR 404: Not Found.
I have only tried running these commands in the container, since that is how they would be run and they seem to be failing.
Can anyone suggest what I can include into my Dockerfile that install java onto my image?
Thanks in advance.
You can also directly pull any of the open-jdk images mentioned at (https://hub.docker.com/_/openjdk/) and use it. There is no need to install Ubuntu in docker image and then install Java on top of it. These images already use Ubuntu (with bare-minimum file system).
add to to your docker file
RUN \
apt-get update && \
apt-get install -y software-properties-common && \
echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
add-apt-repository -y ppa:webupd8team/java && \
apt-get update && \
apt-get install -y oracle-java9-installer && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /var/cache/oracle-jdk8-installer
ENV JAVA_HOME /usr/lib/jvm/java-9-oracle
Following from here
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
Oracle JDK version 7
sudo apt-get install oracle-java7-installer
Oracle JDK version 8
sudo apt-get install oracle-java8-installer

Install Java 8 in debian Jessie

I've tried to install Java 8 into a ARM embedded linux in several ways but none of them worked:
First:
http://www.webupd8.org/2014/03/how-to-install-oracle-java-8-in-debian.html
(from the repositories of webupd8)
W: Failed to fetch
http://ppa.launchpad.net/webupd8team/java/ubuntu/dists/trusty/InRelease
Unable to find expected entry 'main/binary-armel/Packages' in Release
file (Wrong sources.list entry or malformed file)
W: Failed to fetch
http://ppa.launchpad.net/webupd8team/java/ubuntu/dists/jessie/main/binary-armel/Packages
404 Not Found
E: Some index files failed to download. They have been ignored, or old
ones used instead.
It seems that this repo does not have the source for my architecture:
Architectures: amd64 arm64 armhf i386 powerpc ppc64el
And i need armel ( at least this is working for java 7 )
I also tried this way:
http://www.rpiblog.com/2014/03/installing-oracle-jdk-8-on-raspberry-pi.html
Downloading the jdk from Oracle and then following the instructions.
But i cannot execute the file :
root#arietta:~# java -version
-bash: /usr/bin/java: No such file or directory
and neither:
root#arietta:~# /opt/jdk1.8.0_71/bin/java -version
-bash: /usr/bin/java: No such file or directory
While the file exists and has the correct permissions... i'm going crazy..
Any idea or alternative method?
At the end i solved it adding jessie backports to the sources.list:
echo deb http://http.debian.net/debian jessie-backports main >> /etc/apt/sources.list
apt-get update && apt-get install openjdk-8-jdk
update-alternatives --config java
I ran the following commands from the webupd8 team and it worked for me:
http://www.webupd8.org/2014/03/how-to-install-oracle-java-8-in-debian.html
su -
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | tee /etc/apt/sources.list.d/webupd8team-java.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
apt-get update
apt-get install oracle-java8-installer
exit
Same as #user2528085, you just need to add Debian backports to your sourcelist file.
Follow this instruction on Debian official site
https://backports.debian.org/Instructions/
Run these commands in shell:
echo "deb http://ftp.debian.org/debian jessie-backports main" | sudo tee -a /etc/apt/sources.list.d/jessie-backports.list
sudo apt-get update && sudo apt-get install elasticsearch
Nothing difficult

issue with installing java package on ec2

I was trying to install java using the following command:
sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts
during the installation for some reason my micro-instance in EC2 kept on freezing, I guess I am not the only one having this issue as it's posted on the aws forum as well. Now when I try to do the whole thing again I get:
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
However, when I try to run sudo dpkg --configure -a, it is just stuck in here:
Setting up sun-java6-bin (6.26-1lucid1) ...
for about an hour or so... WHat should I do now to get java in place?
It could be that the repository you added doesn't have the 'right' version of java6, personally I would use canonical's repository.
First I would try to uninstall the packages and repo
sudo apt-get remove sun-java6-jre sun-java6-plugin sun-java6-fonts
sudo remove-apt-repository ppa:ferramroberto/java
And then use canonical's aptitude repository.
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jdk
I thinks its the same Bug: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/634487
issue fix
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
pd#admin:~$ sudo dpkg --configure -a
dpkg: error: parsing file '/var/lib/dpkg/updates/0024' near line 0: newline in field name `#padding'
pd#admin:~$ sudo rm /var/lib/dpkg/updates/0024
pd#admin:~$ sudo dpkg --configure -a
pd#admin:~$ sudo apt-get install appname_mention_here
Reading package lists... Done
Building dependency tree
Reading state information... Done
Now its working the installation....!
Simply use Open JDK like so...
sudo apt-get install openjdk-6-jre-headless
since you can only ssh into anyway... :)

Categories