Categories: Ubuntu

How to Resolve bin/sh: 1: source not: found

Ubuntu is a popular Linux operating system that allows you to run code using scripts. A computer error is the occurrence of a computer producing an inaccurate result. When running some scripts or doing some tasks using a terminal, you can encounter some errors that can be solved through different techniques. In this article, we will discuss the causes of the error “bin/sh: 1: source not: found” and how to resolve it.

A shell script is software that executes commands. Shell scripts are primarily used to avoid tedious tasks. Instead of entering commands one after the other n times, you can construct a script to automate a series of instructions to be run one after the other. The /bin/sh is used to run the file with sh, a Bourne shell, or another comparable shell.

Why
Sponsored
“bin/sh: 1: source not: found” Error Occurs

While using the fypll repository, you can confront the error “bin/sh: 1: source not: found” when you start activating that using the below command:

$ source ./activate

You will get:

/ bin / sh: 1: source: not found

Resolve

We can resolve the above error in multiple ways and follow the suitable way for you.

The source is not a sh built-in; it is a bash built-in, and you’re using sh rather than bash. Try using bash instead of sh.

Replace “source ./activate” with “. ./activate”

Building an automatic setup script that modifies /etc/profile and $HOME/.profile if some paths aren’t exported, then automatically reload these by the below-mentioned command:

Sponsored
$ source /etc/profile
$ source ~/.profile

You will get:

source: not found

It does not mean that the source file is not found; it means the source you are trying to access is not found, the source is a Bash built-in function, and the script isn’t run with bash

Resolve

Instead of source, “.” is supported by some shells. So, you may attempt something like the below-mentioned syntax.

$ . filename

Instead of using the below command:

$ source filename

The /bin/sh is usually a shell attempting to imitate The Shell. For “sh,” many distributions utilize /bin/bash because it supports the source. However, the source is not supported by Ubuntu which uses /bin/dash. If you cannot edit the script, try changing the shell that executes it.

Conclusion

As a programmer or computer users, we encounter certain errors daily. While using the shell, we encounter different types of errors, one of the errors is “bin/sh: 1: source not: found”. You encounter this error when running the bash script using the “sh” shell. The most common cause of this error is discussed in this article, and the possible ways to resolve this error are also discussed. You can find help from this article while resolving your error.

Ubuntu Server Admin

Recent Posts

Accelerating AI with open source machine learning infrastructure

The landscape of artificial intelligence is rapidly evolving, demanding robust and scalable infrastructure. To meet…

5 hours ago

Hardening automation for CIS benchmarks now available for Ubuntu 24.04 LTS

We’re pleased to release Ubuntu Security Guide profiles for CIS benchmarks. These profiles will allow…

5 hours ago

Detecting and Fixing Memory Leaks with Valgrind

Memory leaks are among the most frustrating bugs to track down in C and C++…

22 hours ago

How to Kill Processes Using Specific Ports on Linux, Windows and MacOS

Have you ever encountered issues starting a server or application because the required port is…

22 hours ago

How to Fix the “Native Host Connector Not Detected” Error for GNOME Extensions in Ubuntu 22.04

When upgrading to Ubuntu 22.04 LTS (Jammy Jellyfish), many users encounter the error message: “Although…

22 hours ago

Building optimized LLM chatbots with Canonical and NVIDIA

The landscape of generative AI is rapidly evolving, and building robust, scalable large language model…

1 day ago