Ubuntu: Can't install software from the Snap store

Hi,

I have a freshly installed Ubuntu system however despite doing the following command lines to add the one and only user "home" to the sudo group I cannot install software via the snap store. Can anyone please advise?

[email protected]:~$ sudo usermod -aG sudo home
[sudo] password for home:
[email protected]:~$

[email protected]:~$ sudo whoami
[sudo] password for home:
root
[email protected]:~$

Hi :slight_smile:
Did you rebooted since added the user to sudo group ?
You can also add the user to adm group.

LOL I tried doing the same command with adm in place of sudo and it wont install ffmpeg or gimp or even tell me I am not allowed to install it. However when I went to install a mp3 splitting program it stills says I cant install that.

Can you write in a terminal :

groups home and post it here ? :slight_smile:

[email protected]:~$ groups home
home : home adm cdrom sudo dip plugdev lpadmin lxd sambashare
[email protected]:~$

I can install things via command line so why not in snap store?

Hmmm maybe something broken about your snap directory inside your home profile.
Can you run this commands ?

whoami
cd ~
ls -lt snap
ls -lt ~/snap/

Snap installs are a bit different than the apt ones. They will install to /home/user/snap
It needs to be able to write there.

[email protected]:~$ whoami
home
[email protected]:~$ cd ~
[email protected]:~$ ls -lt snap
total 4
drwxr-xr-x 4 home home 4096 Mar 2 17:57 snap-store
[email protected]:~$ ls -lt ~/snap/

looks ok, how about running :
snap install gimp would it work ?

sudo snap install gimp has started the download, this is interesting, it had asked me to do it via sudo. I am not entirely clear on the point of putting home user into the sudo group if you still have to type sudo and put in the admin password too??

Now when I go to the site Reddit when I go to log in it instantly logs me out, I am starting to think this latest Ubuntu has some significant issues going on.

[email protected]:~$ snap install gimp
error: access denied (try with sudo)
[email protected]:~$ sudo snap install gimp
[sudo] password for home:
gimp 2.10.22 from Snapcrafters installed
[email protected]:~$

On another note, I just tried to open up gparted which I installed via the terminal and it wont run. I used GRUB to install the bootloader however I think its running MBR on here now and now the newer type of bootloader GPT, I was in windows and realised since the install I cant access the other hdd I have. How do I correct this?

MY goodness me, I have had to run gparted as a sudo command to get it open???

about sudo, it's normal behavior.
sudo is a framework that let your regular user to perform tasks that needs super powers.
If you add a user inside sudo group, it will only allow your user to use sudo framework.

It is normal that in both cases, it asked for a password once you are doing sudo something :slight_smile:
If you need a user to have all privileges without using sudo, you can try adding it to group root that I strongly not advise.

On ubuntu and ubuntu like systems, the root account is disabled by default for security and stability reasons. Reason why, the best and most secure way is to use a regular user like yours, that will use the sudo framework to perform administrative tasks like snap install or manage partitions with gparted.

Btw, nice desktop look :slight_smile:

1 Like

sudo allows a normal, non root user to temporarily elevate privelages to run a command. Gparted is one such command that needs to be run as root.

Adding yourself to the sudo group means you can now use sudo.

1 Like

Yes but why doesn't the software in snap store run as a sudo if I am a sudo group member?

It is starting without asking special privileges. Next, once you done your shopping, and you are clicking install, it is asking you for a password :slight_smile:

OK well we can forget this thread, I reinstalled linux 20.04 now.

Just because you are in the sudo group, does not mean that programs automatically run with sudo (i.e. root) privelages. Being in the sudo group allows you to type

sudo some_program

You are basically saying "Run this program with root privelages, I am allowed to tell you to do this".

This is by design. This is how it is meant to work.

2 Likes

Ok but still, why if I have installed Ubuntu with just one account, why doesn't it have the ability to install programmes??? This does not make any sense. Mind you, the matter is cleared now as I installed 20.04 which works properly. I do have another weird graphics issue, on another thread which I would be grateful for input on.