permission denied to execute '/usr/bin/spin' in WSL (ubuntu 18.04) - ubuntu-18.04

I have been using the Windows Subsytem for Linux for SPIN(Promela) for quite some time.
However, without any changes in the setup, suddenly since 28 Oct 2019, I am getting error 'Permission denied' error for '/usr/bin/spin'.
Other commands in the same location '/usr/bin/..' work just normally like earlier. I verified for clear, gcc -v, yacc -v and sudo apt install gcc.
The command location in WSL is under directory 'rootfs', which cannot be accessed using 'cd' or 'chmod'. So I do not know if it actually is a rights problem, because other commands in the same location work fine.
What is weird is that 'sudo apt install spin' says "spin is already the newest version (6.4.6+dfsg-2)." But 'spin -v' says "-bash: /usr/bin/spin: Permission denied"

The trivial solution given by Patrick seemed to work. ;)
Since there was this permission denied error for the file in rootfs/usr/bin removal was also not possible. So I first manually deleted the file from the location, followed by sudo apt remove spin and then 'sudo apt install spin'.
Now spin seems to work just fine.

Related

php7.4 in ubuntu 21.10: apache2 fails to start

I try to run php7.4 in ubuntu 21.10 but I get this error.
apache2: Syntax error on line 146 of /etc/apache2/apache2.conf: Syntax error on line 3 of /etc/apache2/mods-enabled/php7.4.load: Cannot load /usr/lib/apache2/modules/libphp7.4.so into server: /usr/lib/apache2/modules/libphp7.4.so: cannot open shared object file: No such file or directory
Missing libphp7.4.so
I installed libphp7.4-embed but the problem persists. The files are installed in /usr/lib/ not in /usr/lib/apache2/modules/. Symbolic link did not help (undefined symbol: php7_module).
How to make php7.4 run in ubuntu 21.10?
I try some commands
$ sudo a2enconf php7.4-fpm
Conf php7.4-fpm already enabled
$ sudo a2enmod php7.4-fpm
ERROR: Module php7.4-fpm does not exist!
Both OP and #Andrew have pieced together a good solution, but since I just had to do this, let me put it all together, with a few extra clarification steps.
First: What version of PHP do you have now / will you use?
php -v
Returns PHP 8.1.2 so 8.1 in my case.
Next, disable the existing apache2 module that was giving you trouble:
sudo a2dismod php7.4
Finally, enable the one you found above:
sudo a2enmod php8.1
Restart apache2 and you're all set.
sudo systemctl restart apache2
after much try and error:
rm /etc/apache2/mods-enabled/php7.4.load
Now it works.
(there is only one php* in mods-enabled: php7.4.conf. I don't know if it matters.)

system-uuid on Linux (Ubuntu 20.04)

I got a question.
That is I want to retrieve a system uuid to generate an identity. But I found that root privilege is needed if I execute command cat /sys/devices/virtual/dmi/id/product_uuid.Just same as dmidecode -s system-uuid,Someone tell me that I can install lshal. But I don't want to install it. Because code will not work if others computer didn't install lshal.
So I want to get product_uuid without root privilege.

How do i resolve "Failed to parse remote port from server"

I'm setting up a new remote host and every time i initiate it i get the following error output: Any feedback or direction on how to resolve this issue?
Pseudo-terminal will not be allocated because stdin is not a terminal.
Linux Destiny 4.9.0-9-amd64 #1 SMP Debian 4.9.168-1 (2019-04-12) x86_64
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
mesg: ttyname failed: Inappropriate ioctl for device
bash: cannot set terminal process group (3202): Inappropriate ioctl for device
bash: no job control in this shell
mesg: ttyname failed: Inappropriate ioctl for device
Installing...
Downloading with wget
WARNING: tar exited with non-0 exit code
Found running server...
*
* Reminder: You may only use this software with Visual Studio family products,
* as described in the license (https://go.microsoft.com/fwlink/?linkid=2077057)
*
cat: /root/.vscode-remote/.473af338e1bd9ad4d9853933da1cd9d5d9e07dc9.log: No such
file or directory
Server did not start successfully. Full server log:
cat: /root/.vscode-remote/.X.log51ec4692-
4da4-4ec0-b613-5a3563034cf1====
: No such file or directory
"install" terminal command done
Received install output: : No such file or directory
Failed to parse remote port from server output: : No such file or directory
If the server fails to shut down properly, sometimes it leaves dangling lockfiles. This can cause startup to fail and produce the "Failed to parse remote port from server output" error message. In this case the solution is to simply to delete the lockfiles:
.vscode-server/bin/[:xdigit:]*/vscode-remote-lock.*
Fixed the issue. It appears I had 2 other server agents running incorrectly. I killed both server agents using kill (PID) and removed ".vscode_remote" directory from user home directory. Then i reinitialized remote-ssh from vscode. Successfully connected!
On remote machine you do not have a tar installed. It's in log output
Installing... Downloading with wget
WARNING: tar exited with non-0 exit code
so under a root run:
apt-get install tar
or with sudo, if you have a user with sudoers configured:
sudo apt-get install tar
I also got the same issue and my workaround was to provide proper rights to the home or user folder, so vscode can create a remote folder and do the required installation on it.
Example :
sudo chmod -R 777 home/
In this case, I have provided all rights to my home folder and It worked like a charm for all the users.
I ssh'd onto the remote server (linux) and then deleted both directories as follows:
$ rm -r .vscode-server.backup2022-04-03T16:20:18-05:00
$ rm -r .vscode-server
In case someone else encounters the same issue - I had an instance where remote target had no space left on device. After extending root volume of target machine, connection worked fine.
I had the same issue because vscode was looking for my .vscode-server directory in the wrong location (it was in a custom location due to restrictions on where files can be saved). This can be fixed by using How to change vscode-server directory. Specifically add:
"remote.SSH.lockfilesInTmp": true,
"remote.SSH.serverInstallPath":{
"hostname":"/path/to/.vscode-server/.."
}
To your settings.json
In my case, it wasn't working because of server asking for new password when starting a session. What I did was to open a new default terminal (not VSC terminal but your OS default terminal like ZSH, CMD, and so on). And I used the ssh command to login. I logged in successfully and changed the password. Then I tried connecting with the new password and it worked because the server didn't asked for password change now.
Command:
ssh username#IP
Enter password and you'll get asked to change the password. Change the password and try connecting again with new password using SSH VSC extension.
If yout authorize by ssh-key - also check the value of User parameter in VsCode ssh config. User must have matching key in ~/.ssh/authorized_keys on remote host.
#Sachin's answer directed me in the right direction, VSCode needs permissions in order to create some files, but instead of giving 777 permissions to your home folder (which can be dangerous) you can just chown the user that wants to log in (the user for me was ubuntu):
sudo chown -R ubuntu /home
I also got the same issue and my workaround was to provide proper rights to the home or user folder, so vscode can create a remote folder and do the required installation on it.
Step 1: Add port to your config file :
Host hostname
Port 22
User username
Step 2 : Go to File->Prefrences ->Open settings.json fle
Search for lockfilesInTmp
and check the box next to that

xcrun: error: invalid active developer path [duplicate]

I just upgraded from Yosemite to El Capitan (and replicated the problem upgrading from El Capitan to Sierra), and when I try to type for example git status inside a terminal, I get the following error:
xcrun: error: invalid active developer path
(/Library/Developer/CommandLineTools), missing xcrun at:
/Library/Developer/CommandLineTools/usr/bin/xcrun
I don't have Xcode installed, never did.
Anyone have a solution?
Found the fix for the problem here.
xcode-select --install
This will bring up a prompt to install the necessary command line tools.
If you have issues with the xcode-select --install command; e.g. I kept getting a network problem timeout, then try downloading the dmg at developer.apple.com/downloads (Command line tools OS X 10.11) for Xcode 7.1
In macOS 10.14 this issue may also occur if you have two or more versions installed. If you like xCode GUI you can do it by going into preferences - CMD + ,, selecting Locations tab and choosing version of Command Line Tools. Please refer to the attached print screen.
I tried the solution xcode-select --install but it don't help me, I update from Sierra to High and happened this, my solution:
sudo xcode-select --reset
Reassigning the path Xcode is configured with worked for me.
sudo xcode-select -switch /Applications/Xcode.app
You'll then likely be prompted (after trying a command) to agree to the license agreement.
I had the same issue after upgrading to macOS Catalina.
This didn't work for me:
xcode-select --install
Downloading and installing Command Line Tools for Xcode 12 did it!
For me, after I've removed Xcode, I have to switch active developer path as follows:
sudo xcode-select -s /
I just updated to High Sierra and I couldn't just run xcode-select --install. First, I had to actually install xcode from the app store. Then I ran xcode-select --install. Then I had to run sudo xcodebuild -license, agree to the terms, then I could finally run git commands again.
Updated to High Sierra 10.13.2
xcode-select --install ALONE did not work for me.
Download X-code from app store
$xcode-select --install
a. May need to update after install using softwareupdate in command line. $sudo softwareupdate -i "Command Line Tools (macOS High Sierra version 10.13) for Xcode-9.1"
$sudo xcodebuild -license
For Mojave
Uninstall Any old version of Command Line Tools:
sudo rm -rf /Library/Developer/CommandLineTools
Download and Install Command Line Tools 10.14 Mojave.
For those also having issues with heroku command line tools after upgrading, I also had to do the following in my terminal:
xcode-select --install
brew install heroku/brew/heroku
brew link --overwrite heroku
It seems the upgrade to High Sierra messed with my symlinks in addition to forcing me to reinstall xcode tools. I kept getting 'not a directory' errors:
▸ stat /Users/mattymc/.local/share/heroku/client/bin/heroku: not a directory
▸ fork/exec /Users/mattmcinnis/.local/share/heroku/client/bin/heroku: not a directory
Hope that saves someone an hour :)
After update to macOS 10.13.3
After updating do macOS 10.13, I had to install
"Command Line Tools (macOS 10.13) for Xcode 9.3"
downloaded from https://developer.apple.com/download/more/
I upgraded mac os to macOS High Sierra - 10.13.3 and faced a similar issue while trying to install watchman (with command - brew install watchman).
ran the command: xcode-select --install, then ran "brew install watchman" - Everything works fine!
For the most recent version Mojave version 10.14.1, I use
solved by downloaded from https://developer.apple.com/download/more/ " login by apple id, and download
Command line tool newest stable version.dmg
That makes everything work
the old answer
xcode-select --install
doesn't work for me.
sudo xcode-select -s /Applications/Xcode-beta.app/Contents/Developer
Work for me.
Even if you do xcode-select --install it was not fixing that for me as it showed some network error. The problem was that it could not connect to the app store. I did the following to fix it.
Open keystore
Go to system root and select certificates.
Open digicert high assurance EV.
Expand the trust section, mark it as never trust.
Restart system now repeat step 1, 2, 3. and mark the trust policy as
back to use system defaults.
Your app store should work now and you should be able to run xcode-select --install

Lost ability to run as sudo following MacPorts upgrade

I recently updgraded MacPorts from 1.9.2 to 2.0.3. Since then, I've lost the ability to run as sudo.
sudo: can't stat /opt/local/etc/sudoers: No such file or directory
sudo: no valid sudoers sources found, quitting
Unsure if these are related, but I'm wondering what the best course of action is at this point.
port installed returns
sudo #1.7.4p2_0
sudo #1.7.7_0 (active)
Further investigation suggests I've installed MacPorts' sudo without an accompanying /opt/local/etc/sudoers file. I've managed to create such a file using visudo, copying the content of /etc/sudoers, chmod to 0440 and ownership to root:wheel.
I guess the question now is whether I should use MacPorts' sudo or uninstall it? And how did I end up with installing the MacPorts' sudo?
Not a Mac man myself, but have a look at this page:
http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man5/sudoers.5.html
...and also a look at the man page for visudo, which is used to edit the sudoers file:
http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man8/visudo.8.html#//apple_ref/doc/man/8/visudo

Resources