In this article, we will see Download and Install Chef in Amazon EC2 Linux Instance.
Steps to follow Download and Install Chef
- Launch Linux EC2 Instance.
- Connect to Linux EC2 Instance through Putty.
- Switch to root user.
- Update Server Packages.
- Download and Install the chef package.
- Verify the chef package and Version.
Launch Linux EC2 Instance
Please check the below link to Launch Linux Server.
We can see the Linux Server “Chef-Workstation” which was created earlier.
Open Linux EC2 Instance Terminal
2 3 4 5 6 7 8 9 | Using username "ec2-user". Authenticating with public key "imported-openssh-key" Last login: Tue Dec 24 02:35:19 2019 from 124.123.103.5 __| __|_ ) _| ( / Amazon Linux 2 AMI ___|\___|___| https://aws.amazon.com/amazon-linux-2/ |
Switch to root user
Update Server Packages
By using “yum update” command.
Download and Install chef package
Download Chef Package
First we need to go chef official website by using below link.
Click on DOWNLOADS.

Click on Get it.

Copy Chef package URL from website

Paste URL which was copied from website in Linux EC2 Terminal
The chef package has been downloaded successfully.
Install chef package
Verify chef package and Version
Verify chef package
To see the version of Chef
using chef -v command
using chef -version command
if somehow you are getting the below error :
[root@ip-172-31-27-245 ec2-user]# chef -v
/opt/chef-workstation/embedded/bin/ruby: error while loading shared libraries: libcrypt.so.1: cannot open shared object file: No such file or directory
in my case, I came to know that It seems that there is no
libcrypt package available directly through the package manager on your Amazon Linux system. In that case, we need to identify the correct package that provides libcrypt.so.1 and install it. On Amazon Linux, libcrypt.so.1 is typically part of the glibc package.Here are the steps you can take:
Verify the glibc Package: Run the following command to check if the
glibcpackage is installed:bashsudo yum list installed glibcIf it's not installed, you can install it using the following command:
bashsudo yum install glibcThis should include the necessary
libcrypt.so.1library.Update Dynamic Linker Cache: After installing or verifying the
glibcpackage, update the dynamic linker cache:bashsudo ldconfigRetry ldd Command: Run the
lddcommand again forruby:bashldd /opt/chef-workstation/embedded/bin/rubyEnsure that
libcrypt.so.1is now listed without "not found."Check Library Path: Verify that the library path is set correctly. Check the
LD_LIBRARY_PATHenvironment variable:bashecho $LD_LIBRARY_PATHIt should include the directory where
libcrypt.so.1is installed.Reinstall Chef Workstation: If the issue persists, reinstall Chef Workstation to ensure a clean installation:
bashsudo yum remove chef-workstation sudo yum install chef-workstation

No comments:
Post a Comment