How to run/start VsCode in Centos 7 - visual-studio-code

I have installed vscode on a remote server(which means I have to use ssh) running on Centos 7. The version of vscode is 1.54.3.
When I run code, the line get executed but the vscode does not start. When I try /usr/share/code/code I get an error
:FATAL:setuid_sandbox_host.cc(158)] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /usr/share/code/chrome-sandbox is owned by root and has mode 4755.
I have tried solving it using
cd /usr/share/code/
sudo chown root:root chrome-sandbox
sudo chmod 4755 chrome-sandbox
and
/usr/share/code/code --no-sandbox
But it does not work.
Where could I be doing wrong?

What worked for me
Reboot the host after installation
Update vscode: sudo yum update code
Change directory: cd /usr/share/code
Run: sudo chown root:root chrome-sandbox
Run: sudo chmod 4755 chrome-sandbox
Start vscode: code .

The latest version that is supported in CENTOS 7 is 1.53. You can download it from the developer's website: https://code.visualstudio.com/updates/v1_53

Related

Error while adding dependencies in order to install apache age

In order to install Apache age from source,
i am installing development files for PostgreSQL server-side programming. For this i am using following command on my Ubuntu OS.
sudo apt install postgresql-server-dev-11
But i am getting this error "Unable to locate package postgresql-server-dev-11"
image of the error
i am searching online but did not find yet.It would be great if someone help.
This is because you do not have the correct Ubuntu version and the package does not exist.
To determine the major PostgreSQL version in a given release of Ubuntu find it here in Ubuntu Packages
18.04 has PostgreSQL 10 (postgresql-server-dev-10)
19.04 has PostgreSQL 11 (postgresql-server-dev-11)
20.04 has PostgreSQL 12 (postgresql-server-dev-12)
If you have ubuntu 19.04 you can follow this guide
In the case there is no maintainer for the Version of PostgreSQL you are trying to install you have to build from source.
Download your PostgreSQL version source code. Then run these commands.
tar xf postgresql-version.tar.bz2
cd postgresql-version
Install dependencies. Then run the following.
./configure
make
su
make install
adduser postgres
mkdir -p /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
su - postgres
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start
/usr/local/pgsql/bin/createdb test
/usr/local/pgsql/bin/psql test
Reference from Official Docs
Seems the package is not available from your package manager. But, since you want development files, it's best to get the source code directly from GitHub.
In your home directory do:
git clone https://github.com/postgres/postgres.git
cd postgres
git checkout "REL_11_STABLE"
then follow this guide https://www.thegeekstuff.com/2009/04/linux-postgresql-install-and-configure-from-source/
Official documentation for installing from source is here https://www.postgresql.org/docs/current/installation.html
You should follow these steps:
sudo apt-get update
sudo apt-get -y install postgresql-12 postgresql-client-12
sudo systemctl status postgresql
I was also facing the same problem and i just updated my Ubunutu and the error got resolved when i run the command again
I faced the same issue on Ubuntu jammy(22.04 LTS).
If you are on the same version of Ubuntu as me, try using
sudo apt install postgresql-server-dev-all
Because neither
sudo apt install postgresql-server-dev-12
nor
sudo apt install postgresql-server-dev-11
worked for me.

Cannot load VSCode

I cannot load VSCOde onto my old Toshiba laptop using Fedoa23. I follow the instructions from the web and finally get the message "No package code availale". I have previously installes VSCode on an old computer using Fedora23 but this time it does not work? Where do I go wrong?
Thanks.
Don't know, but this works for me.
You can use these step to install VSCode:
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'
Then update the package cache and install the package using dnf (Fedora 22 and above):
dnf check-update
sudo dnf install code
Or on older versions using yum:
yum check-update
sudo yum install code

Error installing PostgreSQL via Homebrew on Mac

When installing PostgreSQL via Homebrew on Mac (OSX 10.11.6) I get the following errors:
Error: The `brew link` step did not complete successfully The formula
built, but is not symlinked into /usr/local
and
initdb: file "/usr/local/share/postgresql/postgres.bki" does not exist
This might mean you have a corrupted installation or identified the
wrong directory with the invocation option -L.
The /postgresql folder doesn't exist.
Not sure if it's relevant, but I already have OpenSSL 1.0.2o_2 and Readline 7.0.5 installed via Homebrew.
Does anyone know why this error occurs and how I can solve it?
In my case, I had installed libpq which prevented postgresql from linking. Unlinking libpq followed by linking postgresql fixed the issue for me.
brew unlink libpq
brew link postgresql
brew postinstall postgresql
Managed to solve the problem. It's a permissions issue. The original answer can be found here: Homebrew: Could not symlink, /usr/local/bin is not writable
In short, perform the following commands:
sudo chown -R `whoami`:admin /usr/local/bin
sudo chown -R `whoami`:admin /usr/local/share
sudo chown -R `whoami`:admin /usr/local/opt

Mac OS - Failed to install mongodb with Homebrew due to Permission Issue

I followed the official guide to install mongodb but failed many times.
Firstly, I tried to use brew install mongodb
brew --version
Homebrew 1.4.3
brew install mongodb
Error:
Error: Permission denied # rb_sysopen - /usr/local/var/homebrew/locks/scons.formula.lock
I tried to use sudo
sudo brew install mongodb
Error:
Error: Running Homebrew as root is extremely dangerous and no longer supported.
As Homebrew does not drop privileges on installation you would be giving all
build scripts full access to your system.
I am still trying to download the binaries and extracted through the tar command, but it is more complicated and I encountered many other problems. So I hope to solve this problem firstly... Any ideas? Thanks a lot.
sudo chown -R $USER:admin /usr/local
Update:
Whilst the above solves your issue just fine, there is a much nicer way.
# allow admins to manage homebrew's local install directory
chgrp -R admin /usr/local
chmod -R g+w /usr/local
# allow admins to homebrew's local cache of formulae and source files
chgrp -R admin /Library/Caches/Homebrew
chmod -R g+w /Library/Caches/Homebrew
# if you are using cask then allow admins to manager cask install too
chgrp -R admin /opt/homebrew-cask
chmod -R g+w /opt/homebrew-cask
source: https://gist.github.com/jaibeee/9a4ea6aa9d428bc77925
I got stuck in a bit of a loop with permissions issues. I eventually uninstalled and reinstalled Homebrew and it worked for me. Here's a reference: https://github.com/Homebrew/install

Can not install postgres in ubuntu

I tried to install postgresql using the following command
apt-get install -t squeeze-backports postgresql-9.1 postgresql-client-9.1 postgresql-contrib-9.1
but i got the following error message.
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
how to fix this?
It looks to me like you aren't running the command as root. Prefix it with "sudo".
sudo apt-get install -t squeeze-backports postgresql-9.1 postgresql-client-9.1 postgresql-contrib-9.1
per the error message:
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
However, it looks like you don't understand the command, as you're running Ubuntu and Squeeze is a Debian dist. I think you need to go back to the basics and read the instructions:
Ubuntu help for Pg.
PostgreSQL-supplied packages of newer versions
Some other program has a lock on download operations. Have you got another terminal open or synaptic package manager or anything? Close everything and try again. You can also delete this file /var/lib/dpkg/lock if that doesnt work. Or it might be a root access issue. try running with sudo
Simple steps to install postgresql latest version (Believe me -- try these commends to install postgresql..it will works perfectly )
sudo bash -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/
precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
sudo apt-get update
sudo apt-get install postgresql-9.3 pgadmin3
For Open Terminal of postgres
sudo -u postgres psql postgres