Error: sudo: amazon-linux-extras: command not found - amazon-ec2

System Information: Ubuntu 20.04.2 LTS (GNU/Linux 5.4.0-1045-aws x86_64)
Problem: Trying to run sudo amazon-linux-extras install epel -y and sudo yum install -y chromium Because i need it for my Discord Bot which has the error of:
Discord Bot Error:
Mashwishi using command cyt!price
/home/container/node_modules/node-html-to-image/node_modules/puppeteer-cluster/dist/Cluster.js:120
throw new Error(`Unable to launch browser, error message: ${err.message}`);
^
Error: Unable to launch browser, error message: Failed to launch the browser process!
/home/container/node_modules/node-html-to-image/node_modules/puppeteer/.local-chromium/linux-737027/chrome-linux/chrome: error while loading shared libraries: libXcomposite.so.1: cannot open shared object file: No such file or directory
TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md
at Cluster.<anonymous> (/home/container/node_modules/node-html-to-image/node_modules/puppeteer-cluster/dist/Cluster.js:120:27)
at Generator.throw (<anonymous>)
at rejected (/home/container/node_modules/node-html-to-image/node_modules/puppeteer-cluster/dist/Cluster.js:6:65)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
So I went to check the article for troubleshooting Running Puppeteer on AWS EC2 instance running Amazon-Linux since we're running Amazon AWS EC2. So I tried to the commands:
sudo amazon-linux-extras install epel -y
The error is: sudo: amazon-linux-extras: command not found
sudo yum install -y chromium
The error is: sudo: yum: command not found

Related

Laravel/Vue | Elastic Beanstalk - Configuration throws error

I'm trying to get a Laravel/Vue app running on Elastic Beanstalk.
I've added the following .ebextensions/npm.config file:
container_commands:
01_install_gcc:
command: 'yum install -y gcc-c++ make'
02_download_node:
command: "curl -sL https://rpm.nodesource.com/setup_6.x | bash -E"
03_install_node:
command: 'yum install -y nodejs'
04_install_node_modules:
command: 'npm install --save-dev cross-env'
05_run_production:
command: 'npm run production'
Unfortunately, it is throwing an error.
Platform: PHP 8.1 running on 64bit Amazon Linux 2/3.4.1
Has anyone faced this issue?

Laravel Dusk running in Ubuntu 20.04 Error Chrome failed to start: exited abnormally

When I run
$ php artisan dusk tests/Browser/ExampleTest.php
It prompt the error
Tests\Browser\ExampleTest::testExample
Facebook\WebDriver\Exception\UnknownServerException: unknown error:
Chrome failed to start: exited abnormally (unknown error:
DevToolsActivePort file doesn't exist) (The process started from
chrome location /snap/bin/chromium is no longer running, so
ChromeDriver is assuming that Chrome has crashed.) (Driver info:
chromedriver=2.45.615279
(12b89733300bd268cff3b78fc76cb8f3a7cc44e5),platform=Linux
5.4.0-107-generic x86_64)
I check the chrome driver, it is install correctly.
$ php artisan dusk:chrome-driver
ChromeDriver binary successfully installed for version 100.0.4896.60.
Then I google the error. They said to check the chrome version
$ /usr/bin/chromium-browser --version
/usr/bin/chromium-browser: 12: xdg-settings: not found cannot create
user data directory: /home/shiro/snap/chromium/1952: Permission
denied
My goal is need to run Laravel Dusk in Ubuntu 20.04.
***Make sure your chromium-browser need to REMOVE and INSTALL snap stable version MATCH with your Laravel Dusk Chrome Driver
Below is the step, I run:-
Next fix the Chromium issue by install via snap, then next error
$ sudo snap refresh --edge chromium
error: cannot communicate with server: Post
http://localhost/v2/snaps/chromium: dial unix /run/snapd.socket:
connect: no such file or directory
to solve the error, need to update the packages.
$ sudo add-apt-repository ppa:saiarcot895/chromium-beta
$ sudo apt-get update
$ sudo apt-get install chromium-browser
Finally, it show the version. However, does not match my Laravel Chrome driver. Didn't solve my first issue. Still can't run dusk
$ /usr/bin/chromium-browser --version
Chromium 97.0.4692.20 Ubuntu 20.04
Next install snap version of Chrome and remove the chromium-browser
$ systemctl start snapd.service
$ sudo snap install chromium
$ sudo apt remove chromium-browser
IMPORTANT NOTE
$ /usr/bin/chromium-browser --version
-bash: /usr/bin/chrome: No such file or directory
Boom~ It works~

sudo: apt-get: command not found while installing lex and ycc tools via terminal

image_terminalI am trying to install Lex and Ycc Tools via Terminal on a Mac M1.Whenever I run command sudo apt-get update ,I am getting (sudo: apt-get: command not found)
what is the reason behind it.
Care to help?

Error running docker-compose command via Ansible playbook

I am getting an error trying to execute docker-compose in a ansible playbook.
I am running from a Mac OSX, but the destination node is a AWS ec2 (Ubuntu 20.04)
On Ubuntu 20.04, I installed the following
sudo apt-get update -y && sudo apt-get install git python3 python3-setuptools
python3-pip software-properties-common docker docker.io unzip acl -y
sudo apt-add-repository -y --update ppa:ansible/ansible
sudo apt-get install ansible -y
sudo apt install python3-pip -y
sudo apt-get install python3-docker
pip3 install docker
pip3 install docker-compose
In the main.yml
name: Run "docker-compose up"
community.docker.docker_compose:
project_src: /data
project_name: test
register: output
I am getting the following error
fatal: [ndr2]: FAILED! => {"changed": false, "msg": "Unable to load docker-compose. Try `pip install docker-compose`. Error: Traceback (most recent call last):\n File \"/tmp/ansible_community.docker.docker_compose_payload_566twi2g/ansible_community.docker.docker_compose_payload.zip/ansible_collections/community/docker/plugins/modules/docker_compose.py\", line 494, in <module>\nModuleNotFoundError: No module named 'compose'\n"}
Any help is appreciated.
I had to run sudo apt install docker-compose -y on the target host, instead of installing docker-compose via pip3. Not sure why it had to be installed this way.

AWS EC2 : sudo: apt-get: command not found error

I have installed Amazon Linux 2 AMI (HVM), SSD Volume Type second number of os in list (AWS console) in my instance.
It connect to putty successfully.
Now I want to install node in my server.
For that I go to /var folder. Then I run this command.
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
And then I got error this.
## Populating apt-get cache...
+ apt-get update
bash: apt-get: command not found
Error executing command, exiting
To fixed this I have fire follow commands.
1) apt-get update
2) sudo apt-get update
3) yum update
4) sudo yum update
Still I have same issue. Anyone can help me.
Install node version manager (nvm) by typing the following at the command line.
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.0/install.sh | bash
Use nvm to install Node.js because nvm can install multiple versions of Node.js and allow you to switch between them.
Activate nvm by typing the following at the command line.
. ~/.nvm/nvm.sh
Use nvm to install the version of Node.js you intend to use by typing the following at the command line.
nvm install 4.4.5
Installing Node.js also installs the Node Package Manager (npm) so you can install additional modules as needed.
Test that Node.js is installed and running correctly by typing the following at the command line.
node -e "console.log('Running Node.js ' + process.version)"
This should display the following message that confirms the installed version of Node.js running.
Running Node.js v4.4.5
More Info : https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-up-node-on-ec2-instance.html

Resources