Linux - Appuals Tech from the Experts Mon, 18 Dec 2023 07:24:02 +0000 en-US hourly 1 https://wordpress.org/?v=6.4.3 How to Fix SystemCTL Command Not Found Issue? https://appuals.com/systemctl-command-not-found/?utm_source=rss&utm_medium=rss&utm_campaign=systemctl-command-not-found https://appuals.com/systemctl-command-not-found/#disqus_thread Tue, 25 Jul 2023 00:39:32 +0000 https://appuals.com/?p=346568 The systemctl command not found error usually occurs when you are running a Linux operating system which uses another init system like runit, SystemV etc. SystemV init system is usually used in the older Linux operating systems, mainly in versions of Ubuntu before 15.04. Although, there are some modern Linux operating systems that use init …

The post How to Fix SystemCTL Command Not Found Issue? appeared first on Appuals.

]]>
The systemctl command not found error usually occurs when you are running a Linux operating system which uses another init system like runit, SystemV etc. SystemV init system is usually used in the older Linux operating systems, mainly in versions of Ubuntu before 15.04. Although, there are some modern Linux operating systems that use init systems other than systemd i.e artix Linux which is based on Arch Linux but uses other init systems like runit, dinit etc instead of systemd.

What’s an init system?

Init system is the first process that runs after your kernel boots up. There are more than one init systems out there for Linux but the most popular one is systemd, and it is used in many of the major Linux operating systems. Systemd is a set of daemons and libraries which controls all the other daemons and libraries e.g. starting or stopping a daemon, enabling or disabling a daemon. A daemon in Linux is equal to a service in Windows which runs in the background.

How you can fix systemctl command not found in  Linux distributions:

In order to fix this error, you have two choices. 

  • Install systemd and replace your current init system with systemd. Since systemctl command not found error comes because you don’t have systemd installed on your system.
  • Use the init system your linux distribution has to manage different daemons/services. This solution is for those of you who don’t have systemd installed but don’t want to install systemd on their machine or if systemd is not available in your distribution’s repositories.

1. Install systemd (if not installed):

If you are using a Debian/Ubuntu based operating system, you can type a command to do a search that whether systemd is installed or not. 

Type this command if you are using Ubuntu or Debian based operating systems and press enter. 

sudo dpkg -l | grep systemd.

For arch linux based distributions, use this command:

pacman -Qs systemd

If you see some text as output of this command, then it means systemd is installed on your system and it might be corrupted. 

You then need to reinstall systemd for the systemctl command to work. 

To do that type this command in a terminal and press Enter. 

sudo apt-get install --reinstall systemd.

This will reinstall systemd with apt package manager that’s used by Debian/Ubuntu based distributions.

For arch linux or its derivatives, use this command:

sudo pacman -S systemd

If you didn’t get any output from the sudo dpkg -l | grep systemd command above, then it means systemd is not installed on your distribution. 

In such a scenario, you can either use the init system your distribution has or install systemd. 

To install systemd on debian/Ubuntu based distributions, type this command in a terminal and press Enter:

sudo apt-get install systemd

For arch linux, type pacman -S systemd as root user or using sudo.

This will install systemd on your operating system. You will now be able to use the systemctl command without any errors. 

2. Use the init system of your distribution:

Another, and preferably the best solution for this error is to use the init system your Linux distribution already has to manage dameons/services. 

To see which init system your computer has, you can type this command in a terminal and press enter.

ls -l /sbin/init 

The /sbin/init is a symlink to the init system your linux distribution uses. If you see the symlink of /sbin/init to /lib/sysvinit/init , then it means that your distribution uses sysv init system and you will have to use the service command instead of systemctl to manage services or daemons. 

The syntax of sysv init system to manage services is also pretty simple:

service [service_name] [action]

You can thus start a service by typing service [service_name] start 

e.g : 

If you want to start the bluetooth daemon/service you can type the command:

sudo service bluetooth start 

Then to check whether it is running without any errors, you can type the command 

sudo service bluetooth status

If you want to restart or stop a service, you can use the commands service [service-name] restart and “service [service-name] stop respectively. 

For example, if you want to stop the bluetooth service, you can type:

sudo service bluetooth stop   

It is possible that your init system might not be sysvinit either and some other init system. For that, you just need to do a simple Google search on the output of the symlink of /sbin/init. Then you can use the commands that are applicable to the init system your machine has.

Many init systems usually have the same commands as start, stop, restart but the commands to run them are different as sysvinit has service command to start or stop services and the systemd has systemctl command for it. 

If the above solutions didn’t work for you, keep following the article as the solution listed below might work for you.

How to fix systemd-resolve command not found?

Another error related to systemctl status command not found is the systemd-resolve command not found. Users can be mistaken that they don’t have systemd installed and that’s why, systemd-resolve is not working. But instead, in versions of systemd 239 and above, the systemd-resolve command has been changed to resolvectl

You can thus use “resolvectl ”  to interact with the systemd-resolve utility in your linux distributions.  

The post How to Fix SystemCTL Command Not Found Issue? appeared first on Appuals.

]]>
https://appuals.com/systemctl-command-not-found/feed/ 0
Fix “zsh: permissions denied” Error in Linux or macOS https://appuals.com/zsh-permission-denied/?utm_source=rss&utm_medium=rss&utm_campaign=zsh-permission-denied https://appuals.com/zsh-permission-denied/#disqus_thread Tue, 11 Jul 2023 09:27:08 +0000 https://appuals.com/?p=346558 Zsh permission denied is an error that occurs when you try to execute a command on Linux or Mac to which you don’t have execution permissions. The command could be as straightforward as performing an ‘ls’ on a directory for which you don’t have write permissions or executing a script that performs actions your user …

The post Fix “zsh: permissions denied” Error in Linux or macOS appeared first on Appuals.

]]>
Zsh permission denied is an error that occurs when you try to execute a command on Linux or Mac to which you don’t have execution permissions. The command could be as straightforward as performing an ‘ls’ on a directory for which you don’t have write permissions or executing a script that performs actions your user doesn’t have permission to do. By permissions, we refer to read or write permissions.

Let’s take a look at the main cause of this error, then we can try each solution to see which one works the best.

Mainly this error occurs when you don’t have permissions to execute, write or read the file.

Let’s assume we are inside a Zsh shell in a Linux operating system and you are trying to list the contents of a file using ‘cat’, but you receive a ‘permission denied’ error.

Now to fix this error, first we need to list the permissions of the file. We execute “ls -l” to see the permissions.

As you can see, the permissions are such that only root user and root group can read the file, while the root user can only write on the file.

1. Use sudo

To fix this, the simplest solution would be to use ‘sudo’ with the command we want to run. This will execute the command as the root user. In your case as well, you can use ‘sudo’ when you are confident that the command you want to execute or the task you want to run won’t harm your computer.

We can thus run:

sudo cat file

2. Change permissions of the file or files

The next thing we can do is to change permissions of the file. Since permission denied error is usually caused by read or write permissions, we can change the permissions of that particular file or files. 

By executing ‘ls -l’ inside the directory where the file is located, we can see that the owner and group of the file are root.

We can change the owner to our user and then do what we want to do with the file. 

We can run:

sudo chown [user] [file-name]

In our example, as v3n0m is the user we are logged in as, we will issue the command as:

sudo chown v3n0m file

v3n0m here is our user. In your case it would be your username. 

Now, we can run cat on the file as it would no longer give us a permission denied error

3. Enable Execute permissions

You can use ./ with a filename in zsh or other shells to execute a file as a program. But if the execute permissions are not set on a file, it will give you zsh : permission denied error.

Let’s say we want to execute a script called script1. We type ./script1 in our terminal and it gives us this error: 

We do ls -la on the file to see the permissions. As you can see the execute permissions on the file are not set. 

The solution here is simple, add the execute permissions on the file.
We issue a simple command 

chmod +x script1

chmod +x would add the execute bit on the file’s permission for owner, group as well as others. 

Now we can run the file as program by typing ./script1 without any error.

This should fix the error if you are facing it on Linux, however, if you are facing this error of MacOS or Gradle keep following the article.

Edit your zshrc File (macOS)

Some users have reported in their MacOS using zsh when they are not inside the directory from where they want to execute a command. 

If you face a similar issue, then the fix for it is really simple. 

You need to edit your .zshrc file in your home/username directory and add this to the end of the file. 

setopt auto_cd

This will enable the option of auto_cd in zsh.

In order to edit the .zshrc file, you can use any graphical text editor or a command line text editor like vim or vi.

Use CHMOD Command to Set Permissions (Gradle)

Zsh permission denied error can occur if you are working on gradle and the gradlew file doesn’t have the correct permissions. 

In order to fix such an error, you need to set the correct permissions on gradlew. 

You can type this command in your terminal,

chmod 755 gradlew 

This will make the gradlew file executable and the error will be fixed.

Or you can simple type this command chmod +x gradlew 

This will also make the gradlew file executable.

If none of these solutions worked for you, feel free to comment down below and our technician will be happy to help you shortly

The post Fix “zsh: permissions denied” Error in Linux or macOS appeared first on Appuals.

]]>
https://appuals.com/zsh-permission-denied/feed/ 0
How to Fix ‘rmdir: Directory not empty’ error? https://appuals.com/how-to-fix-rmdir-directory-not-empty-error/?utm_source=rss&utm_medium=rss&utm_campaign=how-to-fix-rmdir-directory-not-empty-error https://appuals.com/how-to-fix-rmdir-directory-not-empty-error/#disqus_thread Sat, 03 Jun 2023 23:36:21 +0000 https://appuals.com/?p=342706 Rmdir is a command-line utility in Linux and Windows that can be used to delete non-empty directories. It is a useful utility compared to the standard rm utility because rm can delete directories even if they are not empty. It is helpful in cases where you only want to delete non-empty directories, and it prevents …

The post How to Fix ‘rmdir: Directory not empty’ error? appeared first on Appuals.

]]>
Rmdir is a command-line utility in Linux and Windows that can be used to delete non-empty directories. It is a useful utility compared to the standard rm utility because rm can delete directories even if they are not empty. It is helpful in cases where you only want to delete non-empty directories, and it prevents you from accidentally deleting directories that contain files.

The ‘rmdir: directory not empty’ error occurs when you run the rmdir command on a directory that is not empty, meaning it contains files or other directories inside it. This is the expected behavior of the rmdir command, and it will give you an error when you run it on a non-empty directory in Linux or other operating systems that have the rmdir utility.

How can I fix ‘rmdir: directory not empty’ in Linux?

There are a few simple fixes you can try in order to get rid of this error. Apart from running the command in a non-empty directory, this error can also occur due to symlink issues, among other things.

We will let you know about the various fixes you can try to get rid of this error.

1. Use the “rm -rf” parameter

You can use the ‘rm’ command line utility in Linux to delete directories that are not empty if you are encountering this error. To verify whether the directory is not empty and the error is not caused by anything else, simply issue an ‘ls -a’ command on the directory you want to delete. If you see files in the directory, as the output of ‘ls -a’ would show you, then you can issue the ‘rm -rf’ command to delete the directory.

Example:

We want to delete the directory abcd.

We issued an ‘ls -a’ command to check whether the directory was not empty, and it showed us that there were some files present inside the directory.

We can issue rmdir command on the directory but it will give us an error since the directory is not empty. 

The simplest solution here is to use rm -rf on the directory. 

rm -rf abcd

The -r option means recursive i.e delete everything inside the directory recursively (other directories inside it will be deleted too.)

The -f means to force delete, i.e in this case, the force option implies that delete the directory even if it’s not empty.

If you want to delete a directory on which your user doesn’t have write permissions, then you can use:

sudo rm -rf 

Using sudo with rm is only recommended when you know what you are doing and the directory you want to delete isn’t a system directory as the root user can delete system directories too.

2. Use a file manager to delete the directory:

In some scenarios, for unknown reasons users have reported that they couldn’t delete files using the rm utility even by using the -f and -r flag and were able to delete the files using a file manager. You can also try that.

In Ubuntu and many other Linux distributions, file managers are installed by default. You can use such file managers to delete directories or folders as well. 

If you are using Ubuntu, you can use the Nautilus file Manager which is installed in it by default to delete directories. Other file managers can be used as well. Nautilus is just an example.

Fix rmdir: directory not empty in Windows:

This error can also occur in Windows when trying to delete a directory using the command prompt or PowerShell. In order to fix this error in Windows, you can try the following:

  • Use rm -rf method as shown in the Linux fix above.
  • Make sure the directory you want to delete isn’t accessed by any other program. If it’s, use the task manager to kill that program.

Then try and delete the directory afterwards in cmd or powershell using rmdir or rm -rf

The post How to Fix ‘rmdir: Directory not empty’ error? appeared first on Appuals.

]]>
https://appuals.com/how-to-fix-rmdir-directory-not-empty-error/feed/ 0
SCP Permission Denied: What causes it? How to Fix? https://appuals.com/scp-permission-denied/?utm_source=rss&utm_medium=rss&utm_campaign=scp-permission-denied https://appuals.com/scp-permission-denied/#disqus_thread Mon, 29 May 2023 07:25:19 +0000 https://appuals.com/?p=342631 SCP is an open SSH file transfer utility that you can use on Linux and other supported operating systems to transfer files over SSH. It can be used to transfer files between two hosts using an SSH connection. The SCP ‘permission denied’ error can occur due to a variety of reasons, such as incorrectly specified …

The post SCP Permission Denied: What causes it? How to Fix? appeared first on Appuals.

]]>
SCP is an open SSH file transfer utility that you can use on Linux and other supported operating systems to transfer files over SSH. It can be used to transfer files between two hosts using an SSH connection.

The SCP ‘permission denied’ error can occur due to a variety of reasons, such as incorrectly specified paths or a writing permission error. We will explore some of the reasons as to why this error occurs and how to resolve it.

Cause : Not having write permissions 

One reason this error occurs is that your user does not have write permissions for the specific directory on the host where you are trying to write files. To check these permissions, you can use the ‘ls -l’ command, which will display the write permissions.

Look for a ‘w’ in the first four alphabets in the first column of the output. If you see one, it means your user has write permission for that directory. Alternatively, you can always create a file using the touch command in that directory. If you receive no errors, such as ‘permission denied,’ then it means your user has write permissions.

Example:

Let’s say you want to copy a file to a remote host using SCP, and you get permission denied because of write permissions.

scp abcd.txt user@127.0.0.1:/home/abcduser/abcd.txt

Solution 1 : Use the root account to transfer files

To fix such an error, you need to grant write permissions to your user for that directory. For that, you need root privileges or sudo. Another thing you can do is to copy the file to a directory where your user has write permissions.

In such a scenario, you either need to allow your current user the write permissions on /home/abcduser or you can use the root user account to copy that file.

To allow the root user to copy a file using scp, you need to allow root login on ssh which is not recommended for security reasons but you can use it anyway in such scenarios and disable it afterwards. 

To do that, open the openssh config at /etc/ssh/sshd_config and uncomment PermitRootLogin in a text editor in the remote host

Afterwards, connect to the remote host using its root account. 

Then run the command like this: 

scp abcd.txt root@127.0.0.1:/abcduser/abcd.txt 

Or simply this will do 

scp abcd.txt 127.0.0.1:/abcduser/abcd.txt

As they are both the same.

Solution 2: Add your user to the write permissions group:

To have a user write on a directory/file in linux, you either need to add a user to the group that owns the directory or file or make the file owned by that user. 

In our example, we run ls -l on the /home/ directory on the remote system to see which group owns /home/abcd. 

The ls -l command will give you an output, where the contents of the 4th column is the group which owns a corresponding directory/file.

In our example, it’s the abcduser group which owns the directory /home/abcduser then we can

Simply run this command on the remote system.

sudo groupadd user abcd 

It’s the ‘abcd’ group we want our user to be part of and the user we want to change the group of, is ‘user’. 

Run the ls -l command again and if you see a ‘w’ in the 6th place of the output in the first column, then it means the group has write permissions on that directory.

Then rerun the command again, which in our case would be:

scp abcd.txt user@somepc:/home/abcduser/abcd.txt

Solution 3: Use the user that owns that directory to copy the file 

The simplest solution of all is to use the user which owns that directory to copy the file to it. 

Simply run ls -l on the directory. In our case it would be: 

ls -l /home/

The output of the third column will be the user that owns that directory corresponding to the name of the directory you are interested in. In our case, it’s abcduser owns the directory /home/abcduser as seen in the screenshot above.

Then use that particular account while copying the file using scp to the remote host.
In our case, we run the command as follow:

scp abcd.txt abcduser@127.0.0.1:/home/abcduser/abcd.txt

Cause 2: Not having a private key for that user of the remote host 

You might get an error where it would say scp permission denied (public key) when you are trying to transfer files between hosts. 

That’s an authentication issue of ssh and the reason for that is you haven’t added a private key to scp while running it. 

Example: 

scp somefile user@127.0.0.1:/home/user/somefile.txt

Solution:

A simple fix for it is to run the scp command with the -i flag, thus adding the private key for that user using which you want to connect to the remote host and transfer files. 

You need to make sure you have the private key for that user and if you don’t, you need to generate it on the remote machine, and then have scp utility use it using the -i flag.

In our case, the solution would be: 

scp -i key.pem somefile user@127.0.0.1:/home/user/somefile.txt

Where key.pem is the private key file for the user ‘user’. 

Note: We have used 127.0.0.1 as the remote host just for example, in your case the remote host would likely be a remote machine and not your localhost.

The post SCP Permission Denied: What causes it? How to Fix? appeared first on Appuals.

]]>
https://appuals.com/scp-permission-denied/feed/ 0
How to Fix ‘SCP: Not a Regular File’ Error? https://appuals.com/scp-not-a-regular-file/?utm_source=rss&utm_medium=rss&utm_campaign=scp-not-a-regular-file https://appuals.com/scp-not-a-regular-file/#disqus_thread Sat, 27 May 2023 08:04:20 +0000 https://appuals.com/?p=342170 The error message ‘scp not a regular file’ indicates that you are attempting to use the SCP command to copy a file, but the specified source or destination is not a regular file. The SCP command is widely used to securely transfer files between hosts over SSH (Secure Shell) connections. It requires specifying both the …

The post How to Fix ‘SCP: Not a Regular File’ Error? appeared first on Appuals.

]]>
The error message ‘scp not a regular file’ indicates that you are attempting to use the SCP command to copy a file, but the specified source or destination is not a regular file. The SCP command is widely used to securely transfer files between hosts over SSH (Secure Shell) connections. It requires specifying both the source and destination for the file transfer. Therefore, the error usually occurs due to an incorrect file path.

The error message “scp not a regular file” can occur on various operating systems, including Unix-like systems such as ‘Linux’, ‘macOS’, and ‘BSD’. It can also occur on Windows systems that have the SCP command installed, typically as part of third-party software like ‘PuTTY’ or ‘Cygwin’

To assist you in resolving this error, we have curated a troubleshooting guide that will help you address this issue in detail.

1. Syntax issues

Unix and Linux have a reputation for strict adherence to well-defined syntax rules and standards governing commands, shell scripting, and configuration files. Following the prescribed syntax is crucial to ensure proper execution and expected behavior in these operating systems.

So, if an imperfection in the syntax is discovered, the system automatically prompts the user with an error; in this case, the error is “scp: not a regular file.” There are a number of considerations one should keep in mind when trying to copy a file.

1.1 Check Spaces

Checking for spaces in file or directory names is an important task in Unix/Linux. It ensures that there are no leading or trailing spaces that could potentially cause issues when working with commands or scripts.

For instance, let’s consider a scenario in which you have a file named ‘my_file.txt’ located in the ‘/home/user’ directory. To verify the presence of spaces in the file name, you can use the following command:

ls -Q/home/user

The -Q option is employed to display file and directory names within quotes. If any spaces exist in the file name, they will be visibly enclosed within the quotes upon running this command.

For instance, if the output shows a particular result, we should take the necessary action

"myfile.txt"

It signifies the presence of a space in the file name. In such cases, it is recommended to handle spaces in file names by using special characters or enclosing the name in quotes when working with commands or scripts.

To prevent potential issues associated with spaces in file or directory names, it is generally advisable to use filenames that do not contain spaces

1.2 Missing or extra colon

The SCP command requires the use of colons to specify the remote server and file paths. For example, using incorrect syntax like ‘scp user@host filepath’ instead of ‘scp user@host:filepath’ can cause an error. So, in order to avoid the error “scp not a regular file,” make sure that you adhere to the syntax limitations.

1.3 Mixing up Source and Destination

When using the SCP command, mixing up the source and destination paths can cause errors or unexpected behavior. It is important to maintain the correct order to ensure a successful file transfer.

To clarify, the SCP command follows the syntax:

scp <source> <destination>.

If you mistakenly swap the source and destination paths, it may lead to files being copied in the wrong direction or trigger the “scp not a regular file” error if the destination is invalid.

For instance, let’s consider copying a file named “file.txt” from the local machine to a remote server:

Correct: scp file.txt user@remote:/path/to/destination
Incorrect: scp user@remote:/path/to/destination file.txt

The incorrect usage would attempt to copy the remote file named “file.txt” to the local machine, resulting in undesired outcomes or an error. To ensure smooth file transfers, always double-check and maintain the correct order of the source and destination paths when using the SCP command.

2. Use the option “-r”

The reason you’re facing this error is that you’re probably copying a directory while not specifying to the operating system that you’re copying a directory.

By default SCP treats the file as regular files, so option -r must be added when copying a directory. The error “scp not a regular” occurs when the user is trying to copy a directory and does not specify this action by using the -r option.

When you want to copy an entire directory, along with all its subdirectories and files, you would use the “-r” option. Without the “-r” option, SCP would only copy individual files, not directories.

Here’s an example usage of scp with the “-r” option:

scp -r /path/to/source_directory user@remote:/path/to/destination_directory

This command would recursively copy the contents of the “source_directory” and all its subdirectories to the “destination_directory” on the remote server.

The post How to Fix ‘SCP: Not a Regular File’ Error? appeared first on Appuals.

]]>
https://appuals.com/scp-not-a-regular-file/feed/ 0
Fix: ModuleNotFoundError: No module named ‘tensorflow’ https://appuals.com/solved-modulenotfounderror-no-module-named-tensorflow/?utm_source=rss&utm_medium=rss&utm_campaign=solved-modulenotfounderror-no-module-named-tensorflow https://appuals.com/solved-modulenotfounderror-no-module-named-tensorflow/#disqus_thread Wed, 10 May 2023 09:40:40 +0000 https://appuals.com/?p=338107 TensorFlow is a popular open-source software library for data analysis and machine learning. It is used extensively in the fields of artificial intelligence and deep learning. However, when trying to use TensorFlow in Python, you may encounter an error that says ‘no module named “tensorflow”‘. This article will explain the reasons behind the “no module …

The post Fix: ModuleNotFoundError: No module named ‘tensorflow’ appeared first on Appuals.

]]>
TensorFlow is a popular open-source software library for data analysis and machine learning. It is used extensively in the fields of artificial intelligence and deep learning. However, when trying to use TensorFlow in Python, you may encounter an error that says ‘no module named “tensorflow”‘.

ModuleNotFoundError: No Module Named 'tensorflow'
ModuleNotFoundError: No Module Named ‘tensorflow’

This article will explain the reasons behind the “no module named TensorFlow” error and provide solutions to fix it.

Why does the ‘no module named TensorFlow’ error occur?

The ‘no module named TensorFlow’ error occurs when the TensorFlow module is not installed on your system, or when the installation is incomplete or corrupt. When you attempt to import the TensorFlow module, Python cannot locate it, resulting in this error.

Here is an example of the error message:

Solution: Install the TensorFlow Module.

To fix the no module named tensorflow error, you need to install the TensorFlow module on your system. Here are the steps to do so:

Step 1: Install pip

pip is a package installer for Python that allows you to easily install and manage Python packages. If you do not have pip installed on your system, follow the steps below to install it:

For Linux:

$ sudo apt-get install python3-pip             #For Debian and Ubuntu-Based Distributions
$ sudo yum install python3-pip                 #For CentOS/RHEL
$ sudo dnf install python3-pip                 #For Fedora
$ sudo pacman -S python-pip                    #For Arch-Based Distributions

For macOS:

$ sudo easy_install pip

For Windows:

Download the pip installer from https://bootstrap.pypa.io/get-pip.py and run the following command in the command prompt:

python get-pip.py

Step 2: Install TensorFlow

Once you have pip installed, you can install TensorFlow by running the following command:

pip install tensorflow

This will install the latest version of TensorFlow on your system.

Step 3: Verify the installation

To verify that TensorFlow is installed correctly, open a Python shell and enter the following code:

>>> import tensorflow as tf

If the installation was successful, no error message will appear and you’ll be able to proceed with using TensorFlow. However, if an error message appears, it may indicate that the installation was not successful or that there is a compatibility issue with your system. In this case, you may need to reinstall TensorFlow or consult the TensorFlow documentation for further troubleshooting steps.

The post Fix: ModuleNotFoundError: No module named ‘tensorflow’ appeared first on Appuals.

]]>
https://appuals.com/solved-modulenotfounderror-no-module-named-tensorflow/feed/ 0
Fix: Failed to load module canberra-gtk-module https://appuals.com/failed-to-load-canberra-gtk-module/?utm_source=rss&utm_medium=rss&utm_campaign=failed-to-load-canberra-gtk-module https://appuals.com/failed-to-load-canberra-gtk-module/#disqus_thread Mon, 24 Apr 2023 06:11:58 +0000 https://appuals.com/?p=315311 The Canberra GTK module is a library that provides sound event feedback for GTK+ 2 and 3 applications on Linux. It allows developers to integrate sounds with user interface events such as button clicks, dialog boxes, and menu selections. The error “failed to load module canberra-gtk-module” occurs when any application tries to load the “canberra …

The post Fix: Failed to load module canberra-gtk-module appeared first on Appuals.

]]>
The Canberra GTK module is a library that provides sound event feedback for GTK+ 2 and 3 applications on Linux. It allows developers to integrate sounds with user interface events such as button clicks, dialog boxes, and menu selections.

The error “failed to load module canberra-gtk-module” occurs when any application tries to load the “canberra GTK” module on Linux.

This post will uncover the possible reasons and the solutions to fix the error “failed to load module canberra-gtk-module.”

What causes Failed to load module canberra-gtk-module Error?

The following are the major causes of this error:

  • When the program (usually a GTK-based application) requires the “gtk” module and the machine cannot load it.
  • If the module is not installed on the system.
  • If you run the command “canberra-gtk,” it will also throw the same error, which authenticates that the system cannot find the module.

1. Install the canberra-gtk-module on Linux

The only solution to this error is to install the gtk-module on Linux. Follow the steps and the commands to install the canberra-gtk-module on various Linux distributions are provided below:

  1. The module is available on the default repositories of all the well-known Linux distributions. So, get the updated list of packages using the commands:
    For Debian/Ubuntu:

    sudo apt update
    update
    update the packages list

    For Arch-Based:

    sudo pacman -Syu

    For CentOS/RHEL:

    sudo yum check-update

    For Fedora:

    sudo dnf check-update
  2. Once the packages list is updated, use the commands listed below to install the module. The module is named libcanberra-gtk3 in Fedora/Centos, and install libcanberra-gtk-module in Debian/Ubuntu-based distributions:For Debian/Ubuntu:
    sudo apt install libcanberra-gtk-module
    install
    install the libcanberra package

    For Arch:

    sudo pacman -Syu libcanberra

    For CentOS/RHEL:

    sudo yum install libcanberra-gtk3

    For Fedora:

    sudo dnf install libcanberra-gtk3
  3. Lastly, use the export command to set the “GTK_modules” environment, which will allow loading the module correctly:
    export GTK_modules-gtk-module
environment variable
adding environment variable

2. Reinstall the canberra-gtk Module

There might be a possibility that the installed module is corrupted and the system cannot detect the module. For that, the users must remove the module first and completely reinstall the fresh copy. The steps to completely remove and reinstall the module are listed below:

  1. The complete removal of the module depends on the Linux distribution you are using:
    For Debian/Ubuntu:

    sudo apt autoremove canberra-gtk-module

    For CentOS:

    sudo yum autoremove canberra-gtk-module

    For Fedora:

    sudo dnf autoremove canberra-gtk-module
  2. Now, go to “Solution 1” in the above section and follow steps 1 and 2 to reinstall the module. Afterward, execute “step3” to set the GTK_modules environment in your system.

The error “failed to load module canberra-gtk-module” occurs in Linux-based systems when the machine tries to find or use the GTK module, and the system cannot get it. There are two possible fixes to rectify the error, i.e., install the canberra-gtk module or reinstall (uninstall and install) the fresh copy of the canberra-gtk module. After installing, the user needs to add the environment variable of the canberra-gtk-module as well.

The post Fix: Failed to load module canberra-gtk-module appeared first on Appuals.

]]>
https://appuals.com/failed-to-load-canberra-gtk-module/feed/ 0
Troubleshoot PuTTY X11 proxy: unsupported authorization protocol https://appuals.com/putty-x11-proxy-error/?utm_source=rss&utm_medium=rss&utm_campaign=putty-x11-proxy-error https://appuals.com/putty-x11-proxy-error/#disqus_thread Sat, 25 Feb 2023 18:18:27 +0000 https://appuals.com/?p=309705 The solution to PuTTY X11 proxy: unsupported authorization protocol includes Fixing Ownership of Xauthority, Removing lock files, fixing configurations, and more.

The post Troubleshoot PuTTY X11 proxy: unsupported authorization protocol appeared first on Appuals.

]]>
PuTTY X11 is a mechanism to gain remote access to applications and servers by forwarding the display and control of these applications to the local host machine. It enables the user’s local machine to interact with the GUI/SSH of remote machines which helps in easy access.

PuTTY X11 proxy unsupported authorization protocol
PuTTY X11 proxy unsupported authorization protocol Fix

However, sometimes trying to access the servers or applications, the user can run into the PuTTY X11 proxy: Unsupported authorization protocol error. This error can be caused by a number of reasons which include:

  • Wrong ownership of the Xauthority file (and Locked Files)
  • Corrupt Xauthority file
  • Invalid configuration of PuTTY
  • Incorrect authorization settings Firewall
  • X11forwarding is not configured in SSH config

This article demonstrates the methods to solve the unsupported authorization error for PuTTY.

Solution 1: Change Xauthority file ownership

The Xauthority file is the main component to use PuTTY because this file stores the cookies and credentials for the Xserver for the purpose of connection authentication. An unsupported authorization protocol error occurs when the Xauthority file is missing or the user is not the owner of the file. Let us follow the steps and solve this error.

  1. Use the given list command to find the Xauthority file and confirm its ownership:
    ls -al .Xauthority
    command to find Xauthority file
    Find the Xauthority file

    The Xauthority file is currently owned by the root user, let’s Access the server using PuTTY to see how it responds to this ownership issue:

    Unsupported authorization protocol error
    Unsupported authorization protocol

    The above output shows that it is necessary for the user to have control over the Xauthority.

  2. Shift the ownership of the Xauthority file to the logged-in user and to do that execute the following command:
    Note: Write the username that you want to use instead of “linux-user” given in the command:

    sudo chown linux-user .Xauthority
    command to change the ownership of Xauthority
    Change Xauthority ownership
  3. Once the unsupported authorization protocol error occurs, the Xauthority file is often locked. When this file is locked, having the correct ownership will also not resolve the issue. Therefore, the user needs to check for the locked files and remove them. run the ls -al command to check if Xauthority-c and Xauthority-l files exist:
    ls -al
    ls -al list show command
    Show list to find Xauthority files

    If these files exist then remove the Xauthority-c and Xauthority-l files by using the following command:

    rm .Xauthority-c .Xauthority-l


    Note
    : Restart your machine and PuTTY connection for the changes to take effect.

  4. Reconnect to the PuTTY server and call “xclock” to test the server:
    PuTTY connected
    Connected to PuTTY

    The authorization error has been successfully resolved.

Solution 2: Replace Xauthority corrupt file

In some cases, the Xauthority file can be corrupted and due to that, access to the server is not authorized. To solve this issue you will need to do the following steps

  1. Run the “ls – al” command to check if our Xauthority file exists:
    List command
  2. To remove the Xauthority file, use the following command:
    rm .Xauthority
    Command to remove Xauthority file
    Remove Xauthority file
  3. Once you have deleted the Xauthority file reconnect the server using PuTTy, this will create your new Xauthority file in the directory, and run the “xclock” command:
    Accessing server using PuTTY
    Connection established successfully

    You have successfully logged into PuTTY and accessed the Xclock.

Solution 3: Reconfigure the Invalid configuration of PuTTY

Setting up your PuTTY is also essential and sometimes, users make mistakes while configuring or setting up their PuTTY. To solve this basic error, follow the steps provided below:

  1. Open up PuTTY on your PC, click the Default Settings file, and load it:
    PuTTY configuration settings
    Load default settings
  2. Now, locate the SSH tab and click on the X11 option. Enable the X11Forwarding and set “X display location” to “localhost0”:
    SSH and X11 configuration in PuTTY
    Configuring X11 forwarding in PuTTY
  3. Now you will need to input the IP address or Host Name of the server you are going to access. After setting the Hostname or IP address, set the Port to 22 (or whatever port you have set for SSH) and then save the“Default File”:
    Host name or IP address in PuTTY
  4. Click the Open button and you will see the PuTTY terminal:
    PuTTY login
    PuTTY login

    In the PuTTY terminal, you will have to input the Username and the password of the server you are going to access. Once you pass these two arguments you will gain access to the remote server:

    PuTTY gained access
    PuTTY accessed server

    As you can see you have successfully set up PuTTY and accessed the server.

Solution 4: Allow Firewall configuration for port 22

To use the X11Forwarding and PuTTY, you will need to configure the Firewall and enable Port 22. Here, the UFW utility is used to configure the Firewall:

  1. Execute the following command in your terminal to allow the SSH server to gain access to port 22 through the Firewall:
    sudo ufw allow ssh
    Allow SSH in Firewall
    Give access to SSH server through Firewall
  2. Enable the Firewall using the following command:
    sudo ufw enable
    Enable Firewall
    Enable Firewall
  3. Check the Firewall status with the following command:
    sudo ufw status
    Check Firewall status
    Check Firewall status

    As we can see that both 22/tcp and 22/tcp (v6) are now enabled.Once we have completed these steps, reconnect the PuTTY X11 and see if the error is resolved. To connect to the PuTTY server, input the remote system login name and password to access the server.

    PuTTY accessed remote server
    PuTTY server access

    You have successfully resolved the error and gained access to the remote server.

Solution 5: Configure X11Forwarding in SSH Server config

Another configuration error due to which PuTTY X11 authorization is denied is the invalid configuration of the SSH server. To configure the SSH server you will run the following command in your terminal.

sudo nano /etc/ssh/sshd/config
  1. By running this command you will gain access to the SSH server’s config file:
    Access SSH server
    Access SSH server
  2. In the SSH configuration, find X11Forwarding, then uncomment it to enable it. Set the X11Forwarding parameter to “yes”:
    X11Forwarding enabled
    Enable X11Forwarding
  3. After that find “X11Displayoffset” also enable this setting and set the display to “10”:
    X11DisplayOffset enabled
    Enable X11Displayoffset
  4. After enabling the above settings enable the set “X11UseLocalhost” to “no”:
    X11UseLocalhost to no
    Set X11UseLocalhost to no
  5. Furthermore, enable and set the “PrintMotd” setting to “no”:
    set PrintMotd to no
    Set PrintMotd to no
  6. After completing all the above steps, save the settings by using CTRL+O and then exit the config file by using CTRL+X. After that, try to reconnect to the server using PuTTY:
    PuTTY access
    PuTTY connected to server
  7. You have successfully logged into the server. Try and access the xclock by using the following command in your PuTTY terminal:
    xclock
    PuTTY gain access
    PuTTY connected and xclock accessed

    You have successfully solved the error and gained access to the remote machine.

The PuTTY X11 proxy: unsupported authorization protocol error is where you can’t gain access to the remote server using PuTTY. The reasons for this error to occur have been mentioned in this post along with their solutions.

The post Troubleshoot PuTTY X11 proxy: unsupported authorization protocol appeared first on Appuals.

]]>
https://appuals.com/putty-x11-proxy-error/feed/ 0
ssh_exchange_identification ‘connection closed by remote host’ https://appuals.com/fix-ssh_exchange_identification-connection-closed-by-remote-host/?utm_source=rss&utm_medium=rss&utm_campaign=fix-ssh_exchange_identification-connection-closed-by-remote-host https://appuals.com/fix-ssh_exchange_identification-connection-closed-by-remote-host/#disqus_thread Thu, 23 Feb 2023 11:44:25 +0000 https://appuals.com/?p=63133 While in many cases the ssh_exchange_identification: Connection closed by remote host error can be caused by issues related to the hosts.deny and hosts.allow configuration files, there are other things that can cause the problem. If you’re reading this, then chances are you’ve already checked to make sure that both of these files weren’t blocking your …

The post ssh_exchange_identification ‘connection closed by remote host’ appeared first on Appuals.

]]>
While in many cases the ssh_exchange_identification: Connection closed by remote host error can be caused by issues related to the hosts.deny and hosts.allow configuration files, there are other things that can cause the problem. If you’re reading this, then chances are you’ve already checked to make sure that both of these files weren’t blocking your IP address from trying to use ssh on a remote server.

Assuming this is the case, then you might be looking at a dependency issue, something related to memory fragmentation or even an excessive number of sessions coming from individual clients. The good news is that once you’ve taken care of the problem you shouldn’t see the error again.

Method 1: Fixing Missing Dependencies

If you’ve gotten the ssh_exchange_identification: connection closed by remote host error only after updating OpenSSL or glibc, then you might be looking at a missing dependency. Run sudo lsof -n | grep ssh | grep DEL from the command line in this situation. This will give you a list of open files, then look only for ones that were recently deleted related to the ssh daemon.

Should you not get anything back, then you can still try restarting the daemon or the system itself. You’ll want to give a restart a try if a number of errors did get thrown back at you, though you can safely ignore those related to /run/user/1000/gvfs messages as these are caused by an unrelated issue that has to do with a virtual file system.

You could attempt to use apt-get, pacman or yum to update your packages as well if you suspect dependencies are a problem. If you’re on a Debian or Ubuntu based system, then you might want to try sudo apt-get -f upgrade and see if that fixes any broken packages that you might have fallen afoul of.

Method 2: Correcting Memory Fragmentation

If this didn’t help, then you might have an issue on the host side of the equation. Hosts that run inside of a VM don’t always have a swap partition, which can lead to memory fragmentation. Access the host by some other means, perhaps physically if possible, and then restart any services suffering from problems. MySQL, Apache, nginx and other such services might be the culprits.

While it might not always be feasible to reboot the host, this can correct the problem and might be a good idea if you’ve been alternating between this error message and one that returns an IP address. Keep in mind that if you have any sort of access to the server, then you can run the vmstat -s command and get some important stats on how memory is getting used even as a regular user in many instances.

Method 3: Check for Extra ssh Instances

Barring this, then check to see if hosts are trying to connect to the server. You might have exceeded the maximum number of ssh sessions without knowing it. Clear up the old sessions and then try to reconnect. One easy way to do this is run the who command to see which user processes are logged in. You should only see one or two users logged in. If there are a number of parallel ones, then kill the user processes and try logging back in.

This may happen if sshd can’t keep up with a script that starts many different ssh sessions in a loop. If this ever happened to you, then add the sleep 0.3 command to the loop so that the sshd daemon has time to keep up.

Method 4: Find the sshd Connection Limit

Connection problems like this are especially prevalent when attempting to use ssh to access a router or another type of discrete boxed switch since the default maximum number of connections is so small. While you don’t want to permit yourself to overload the server, you can have a look at what the default setting is.

Try running on the server to find how many connections that sshd can handle. In most cases, the system should default to 10 simultaneous connections, which should be plenty for most server structures that a majority of users are likely to need to use ssh on regularly.

The post ssh_exchange_identification ‘connection closed by remote host’ appeared first on Appuals.

]]>
https://appuals.com/fix-ssh_exchange_identification-connection-closed-by-remote-host/feed/ 0
How to Resolve (Command ‘npm’ not found) Error? https://appuals.com/command-npm-not-found/?utm_source=rss&utm_medium=rss&utm_campaign=command-npm-not-found https://appuals.com/command-npm-not-found/#disqus_thread Wed, 22 Feb 2023 10:46:07 +0000 https://appuals.com/?p=309721 NPM (Node Package Manager) manages the packages of the JavaScript and also the dependencies with those packages. It offers tens of codes that are frequently used by the developers across all the platforms, i.e., Windows/Linux/macOS. In Linux, the command not found errors are frequently observed and the main cause of these errors is that the …

The post How to Resolve (Command ‘npm’ not found) Error? appeared first on Appuals.

]]>
NPM (Node Package Manager) manages the packages of the JavaScript and also the dependencies with those packages. It offers tens of codes that are frequently used by the developers across all the platforms, i.e., Windows/Linux/macOS.

 Command npm not found
Command npm not found Fix

In Linux, the command not found errors are frequently observed and the main cause of these errors is that the system is missing the required command/keyword. The same goes with the phrase “Command ‘npm’ not found”. Therefore, the error occurs whenever users try to utilize the “npm” keyword in the absence of the Node Package Manager.

In today’s guide, we will address the possible causes and solutions of the error, “Command ‘npm’ not found”.

Why This Error Occurs?

As discussed earlier, the NPM command not found error occurs when the users try to run the NPM command from the terminal. The error snippet is shown in the figure below:

npm not found error
NPM command not found error

Solution: Install NPM

The primary solution to fix this error is to install the NPM on your Linux system. Let’s understand the solution with the steps:

Step 1: Install NPM on Linux

To install NPM on your Linux systems, use one of the following commands as per the Linux distribution you are using:

$ sudo apt install npm                                   #For Debian/Ubuntu-based Systems
$ sudo yum install npm                                   #For RHEL/CentOS-based
$ sudo dnf install npm                                   #For Fedora-based
$ sudo pacman -S npm                                     #For Arch-based
$ sudo zypper install npm                                #For OpenSUSE-based
install npm
Installing NPM 1/2
install npm
Installing NPM 2/2

Step 2: Verify the Solution

Once it is installed, verify that it is fixed using the command:

$ npm
verifying NPM
Verifying NPM

The output shows that the error has been fixed.

How to Use NPM on Linux?

Once the NPM command is working on your system, the users can utilize it to search, install, remove, and many other operations using the terminal. Some of the most used NPM commands are mentioned below:

To search for any package:

$ npm search package

To install any package:

$ npm install package

To remove any package:

$ npm uninstall package

To get the list of installed packages:

$ npm ls

The error “Command ‘npm’ not found” occurs when the “npm” is not installed on the system. In the absence of NPM, the user won’t be able to execute the NPM. To fix the error, the NPM must be installed on the Linux system as per your distribution, i.e., Debian-based, RHEL-based, CentOS-based. We have illustrated the reasons and the possible fix to the error.

The post How to Resolve (Command ‘npm’ not found) Error? appeared first on Appuals.

]]>
https://appuals.com/command-npm-not-found/feed/ 0