0

Just trying to install VS studio. I'm following the project odin tutorial, have downloaded the file, but when I run the next line:

sudo apt install ./code-latest.deb

I get the error: .

USER is not in the sudoers file

I've tried

sudo adduser USER sudo

and

sudo usermod -a -G sudo USER

I'm running this on a freshly installed Ubuntu 22.04, in VirtualBox.

I don't understand what I'm doing, or why it's not working in the first place. I'm just starting to learn to code, please help.

rubo77
  • 31,573
  • 49
  • 159
  • 281
  • You mention doing it on Ubuntu 22 OS; but the 22 Ubuntu product doesn't use the `apt` command as it's a *snap* only system, are you sure you're using 22 & not 22.04 or 22.10 (the *year* [eg. 22] products differ to the more widely used *year.month* [eg. 22.04 or 22.10] format products) – guiverc Feb 04 '23 at 00:41
  • FYI: Ubuntu's main products are *year.month* in format, eg. Ubuntu 22.04 LTS is the 2022-April release of Ubuntu Desktop, Ubuntu Server etc. (2000 is added to the year). There are also specialist *snap* only versions available, eg. Ubuntu Core 22 (released on 2022-June) is specialist *flavor* of Ubuntu 22.04 LTS Server, ie. 22 & 22.04 represent different products. Whilst 22.04 (or any *year.month* products, thus also 22.10) can use *deb* and *snap* packages (ie. can use the `apt install` and `snap install` commands), the 22 *flavor* is *snap* only thus can only use `snap install`) – guiverc Feb 04 '23 at 01:05
  • If you installed Ubuntu 22.04 LTS Desktop, then I'd expect the user you created to be found in the *sudoers* file, however Ubuntu has many products with various ISOs that can install with different options; you weren't clear mentioning only 22 (I'm a Desktop user thus more familiar with the *year.month* products such as 22.04 & 22.10) so your install's defaults depend on your actually installed product, and Ubuntu 22 OS is very unclear (*Ubuntu Core 22 being the closest*). Being precise with details, help us to provide more useful advice in reply. – guiverc Feb 04 '23 at 01:21
  • Apologies, I'm using 22.04.1. I just tried using sudo snap install ./code-latest.deb and it didn't work either. It raised the same error 'user is not in the sudoers file.' – Mike Landress Feb 04 '23 at 01:48
  • You should correct your question when it's incorrect (22 vs 22.04; the .1 to me anyway is optional), but code-latest.deb clearly shows it's likely a DEB file & thus `snap install` won't work. If the file may have been renamed, you can ask the system to confirm what type it is (using `file` which looks at the contents of the file for its report) with SNAP files installed using `snap`, and DEB files installed with `dpkg` (or front-ends like `apt`). Ubuntu 22.04 still doesn't tell us if you installed Ubuntu 22.04 LTS Server, Ubuntu 22.04 LTS Desktop etc.. as they can have different defaults. – guiverc Feb 04 '23 at 02:07

0 Answers0