Unable to Get rid of php7.2 which is blocking installation of php8.0 - ubuntu-20.04

I have a challenge in getting rid of php7.2.2 to pave way for php8.0 on my machine. I have tried to with a number of suggested solutions but still don't understand why php7.2.2 still shows up when i run php -v yet on trying to purge that specific php version the, it's not found. I have even tried to restart my pc to see if the changes would be effective but not. Please see the screenshot attached below.
First, I started By trying to remove php7.2.2 using the following commands:-
sudo apt-get --purge auto-remove php7.2.2
Second, Interactive switching mode
sudo update-alternatives --config php
sudo update-alternatives --config phar
sudo update-alternatives --config phar.phar
Third, I tried Manual Switching
From PHP 7.2 => PHP 8.0
Default PHP 7.2 is set on the system and I had to switch to PHP 8.0.
Apache:
$ sudo a2dismod php7.2
$ sudo a2enmod php8.0
$ sudo service apache2 restart
Have also tried, Command Line:
$ sudo update-alternatives --set php /usr/bin/php8.0
$ sudo update-alternatives --set phar /usr/bin/phar8.0
$ sudo update-alternatives --set phar.phar /usr/bin/phar.phar8.0

Related

Installing Yarn through Bash shell WSL1

When I run curl, it shows this error:
~$ curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
gpg: can't connect to the agent: IPC connect call failed
I'm unable to install yarn.
I tried killing:
~$ kill -9 gpg-agent
and restarting:
~$ gpg-agent --daemon
but nothing worked so far. Any advice?
I did this from my root -
npm install -g yarn
Checked if the yarn is installed by -
yarn --version
It worked.
The following worked for me:
sudo apt remove gnupg
sudo apt autoremove
sudo apt install gnupg1
This installs GNUPG Classic. Read more here.

Script to change PHP version

I'm trying code a bash script to swith between php version, but I'm getting the following message error:
Which PHP version would you like to enable?
php5.6
Module php5.6 already disabled
Module php7.1 already disabled
Module php7.2 already disabled
Enabling...
ERROR: Module does not exist!
My code:
#!/bin/bash
echo "Which PHP version would you like to enable?";
read $version;
sudo a2dismod php5.6;
sudo a2dismod php7.1;
sudo a2dismod php7.2;
echo "Enabling...";
sudo a2enmod "$version";
systemctl restart apache2;
I suggest to remove $ from read $version.
Do not use $ when assigning content to a variable.

ejabberdctl not found in bash Ubuntu(installing ejabberd)

I was trying to install ejabberd with applying the tutorials in many site to my VM which is ubuntu but I am stuck in the beginning. After I wrote
sudo apt-get update
sudo apt-get -y install ejabberd
it installs ejabberd. But when I try to write the following
ejabberdctl register admin localhost mypassword
it says ejabberdctl not found. I also tried to restart it with but it is still same.
sudo service ejabberd restart
Note: I did not install erlang seperately. Can it be the problem?
Try sudo ejabberdctl,
if it didn't work, Do:
sudo updatedb
sudo locate ejabberdctl
check if the output is in your $PATH variable.

Install hadoop on Ubuntu 12.04

I am trying to install Hadoop on Ubuntu 12.04, my system is 32 bit compatible.
I am Linux newbie. I tried this tutorial.
I have done these steps successfully:
Part 1 install Hadoop:
First, install Sun JDK 6. Go to the following page:
http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html
Look for x86, agree to the license, and download the file. I did this on my laptop and copied it up to the server via scp. Once it's up there follow these installation instructions:
chmod +x jdk-6u32-linux-x86.bin
./jdk-6u32-linux-x86.bin
sudo mkdir -p /usr/lib/jvm
sudo mv jdk1.6.0_32 /usr/lib/jvm/jdk1.6.0_32
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_32/bin/javac 1
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_32/bin/java 1
sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_32/bin/javaws 1
# now we're ready to install hadoop. taken from https://ccp.cloudera.com/display/CDH4DOC/Installing+CDH4+on+a+Single+Linux+Node+in+Pseudo-distributed+Mode
# update apt to be able to access cloudera
wget http://archive.cloudera.com/cdh4/one-click-install/lucid/amd64/cdh4-repository_1.0_all.deb
sudo dpkg -i cdh4-repository_1.0_all.deb
curl -s http://archive.cloudera.com/cdh4/ubuntu/lucid/amd64/cdh/archive.key | sudo apt-key add -
sudo apt-get update
# install hadoop
sudo su
export JAVA_HOME=/usr/lib/jvm/jdk1.6.0_32/
But while I try installing 'hadoop-0.20-conf-pseudo' I get this error:
E: Unable to locate package hadoop-0.20-conf-pseudo
E: Couldn't find any package by regex 'hadoop-0.20-conf-pseudo'
Would you please let me know what causes the problem?

Difficulty installing Laravel 4 and phpmyadmin on an amazon EC2 instance

So, I installed Laravel 4 on an amazon EC2 instance by following this tutorial:
Basically, my steps included:
———- Installing Apache ———-
$ sudo apt-get install apache2
———- Installing PHP ———-
$ sudo add-apt-repository ppa:ondrej/php5
$ sudo apt-get update
$ sudo apt-get install php5 libapache2-mod-php5
———- Installing PHP Mcrypt ext. ———-
$ sudo apt-get install php5-mcrypt
———- Installing MYSQL ———-
$sudo apt-get install mysql-server
———- Installing GIT ———-
$ sudo apt-get install git-core
———- Laravel GIT Repo ———-
sudo su
mkdir laravel
cd laravel/
git clone https://github.com/laravel/laravel.git
———- Installing Composer ———-
curl -sS https://getcomposer.org/installer | php
php composer.phar install
Now, I am trying to install phpmyadmin on the EC2 instance, and I am at a loss on how to go about doing it. I am a newbie
So should I install it in the laravel folder?
I have tried this:
downloading the phpmyadmin file
sudo wget http://sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/3.3.9.1/phpMyAdmin-3.3.9.1-all-languages.tar.gz
unzipping
tar -jxf phpMyAdmin-3.4.1-all-languages.tar.bz2
renaming
mv phpMyAdmin-3.4.1-all-languages phpmyadmin
Obviously it is not done, and I dont think I am doing this at the right folder. Please help anyone?
PhpMyAdmin has nothing to do with Laravel and isn't required at all; you can manage your MySQL database using the command line client, the MySQL workbench or PHPMyAdmin running on a remote computer (assuming it can connect to your DB running on your EC2 instance).
I would recommend not installing PHPMyAdmin as it's always a target for vulnerability scanners and can be vulnerable (plus it's one more thing to keep up to date).
If you still want to use it then extract its tar file somewhere else (not in Laravel's directory), and then change your Apache configuration to redirect something like "/pma" or "/phpmyadmin" to that directory.
If you're using Ubuntu, then you can just install PhpMyAdmin with the package manager, with this command :
sudo apt-get install phpmyadmin
Just follow the instructions, enter your MySQL root password when asked and that's it, your Apache configuration will be updated automatically, and then you can access it on http://server/phpmyadmin.
See the PhpMyAdmin article in the Ubuntu documentation.

Resources