Score:0

USER is not in the sudoers file - can't install VS code

as flag

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.

guiverc avatar
cn flag
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 avatar
cn flag
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 avatar
cn flag
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.
Mike Landress avatar
as flag
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.'
guiverc avatar
cn flag
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.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.