In aws ec2, sudo: apt-get: command not found error - amazon-ec2

I have created an instance in amazon Linux. and I want to install python-dev. for this I was using
sudo apt-get install python-dev or any other package. but it throws me the command not found error.
instead of apt-get, I was used yum command but that is also not working.
I have created a flask application and I am using FileZilla and putty. I am running application (python files) using putty. I have install pycrypto but then also it is showing no module name. so somewhere I learned that I have install package python-dev. for that purpose I was using apt-get command.

Amazon linux is based on redhat distribution. So you should yum install [package name] instead of apt-get'. the commandapt-getcommand is used indebian` based distribution.
You can use yum search [package name] to search for packages by name.
hope this helps.

Related

How to setup ODBC on Ubuntu 20.04 server

I am trying to setup ODBC for an old application, what use ODBC to connect MySQL DB.
Seem like have any tutorial to setup ODBC, or have but old OS version.
I tried to install UnixODBC by: sudo apt-get install odbcinst1debian2 libodbc1 odbcinst unixodbc.
And now I am trying to install MySQL ODBC. Have 3 method to install it.
Installing Connector/ODBC Using the MySQL Yum Repository
(Yum cannot install on Ubuntu 20.04)
Installing Connector/ODBC from a Binary Tarball Distribution
(Latest version seem like has not support)
Installing Connector/ODBC from a DEB Distribution
I find the way to install a deb package file and try sudo apt install mysql-connector-odbc_8.0.31-1ubuntu20.04_amd64.deb but error Unable to locate package mysql-connector-odbc_8.0.31-1ubuntu20.04_amd64.deb
I am stuck here. And have no way to reseach.
Could you help me!!!!!
If you try
sudo apt-get install mysql-connector-odbc_8.0.31-1ubuntu20.04_amd64.deb
apt-get will try to install it from your repos (and fail). To make it install from your local copy of a .deb file, give it the full path to the .deb file (or prefix with ./ if it's in your current directory).

How can I install libdouble-conversion-dev on Ubuntu 18.04?

I tried installing the libdouble-conversion-dev package using sudo apt-get install libdouble-conversion-dev but failed with the following output:
Package libdouble-conversion-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'libdouble-conversion-dev' has no installation candidate
I have also tried running sudo apt-get update beforehand and got the same results, as well as installing from the debian file from https://packages.debian.org/buster/amd64/libdouble-conversion-dev/download but nothing seemed to have changed.
You can manually install a Debian package on a compatible Ubuntu host with sudo dpkg -i $name_of_package_file.

vagrant command not running for magento setup

How do I run a command in vagrant?
While using below commands for install magento setup:
vagrant#precise64:~/magento2$ sudo dnf install httpd
I get the following error:
sudo: dnf: command not found
So, how do I run a command in vagrant?
Try using apt for package installation on precise 64 box.
You can do sudo apt-get install apache2
To configure it, you can use vim/nano to modify:
/etc/apache2/apache2.conf
DNF Package manager is not available on hashicorp/Precise64 as it's not .rpm based.
From DNF WIKI:
DNF is a software package manager that installs, updates, and removes
packages on RPM-based Linux distributions

Can AWS CLI be installed using Python2.7?

I installed AWS CLI from Python 2.7 using python -m pip install awscli. It seemed to install, but then when trying to run aws, I get 'aws' is not recognized as an internal or external command.
The documentation states that I should add to PATH this:
%USERPROFILE%\AppData\Local\Programs\Python\Python36\Scripts
But this is for Python3. Where is it installed for Python2? There is nothing in %USERPROFILE%\AppData\Local\Programs\ (I checked). And does installation work for Python2 or only for Python3?
After lots of searching, the file was located at c:\Python27\Scripts\aws.cmd. But it was aws.cmd, not aws.exe. So to make aws work, you need to add it to the PATH:
set PATH=%PATH%;c:\Python27\Scripts
After that it works:
c:\Python27>aws --version
File association not found for extension .py
aws-cli/1.11.148 Python/2.7.14rc1 Windows/10 botocore/1.7.6
Although there is still this weird File association not found for extension .py error.
Edit: From #zwer's comment about "File association not found for extension .py", you need to execute this from an administrator cmd prompt:
assoc .py=Python.File
ftype Python.File=c:\Python27\python.exe "%1" %*
The best approach to get this done is
Install pip
pip Install awscli
aws configure
keys and identification keys access parameters
To Install PIP:
need to update YUM Release version and then install python-pip
#yum install epel-release
#yum install python-pip
Install AWSCLI:
#pip install awscli
Configure AWSCLI:
#aws configure
aws_access_key_id=<########>
aws_secret_access_key=<####################>
Default Region[None]: region=us-west-2
format[none]: json
you can find these configuration parameters later in file::
~/.ssh/aws/credentials

install pine/alpine on Amazon EC2 linux

Can someone tell me how to install pine or alpine (the text-based e-mail client) on an Amazon EC2 linux instance running Amazon Linux?
yum install pine
and
yum install alpine
did not work.
There is some support for pine and derivatives. You can install alpine on Amazon, with:
sudo yum install alpine --enablerepo=epel
if it doesn't show up with a yum search, its unlikely that the packages are in the repository. You can try adding another repository that do have the packages. Centos/Redhat repositories work for the most part, but you might run into issues with dependencies.

Resources