cant apt update
-
Hey
retropie 4.6 pi4
im login with pi and password from ssh .
but i cant update it from the sshpi@retropie:~ $ apt update Reading package lists... Done E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied) E: Unable to lock directory /var/lib/apt/lists/ W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied) W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)
For some reason . pretty sure im root
thanks a head for helping :) -
@shavecat said in cant apt update:
Hey
retropie 4.6 pi4
im login with pi and password from ssh .pi@retropie:~ $ apt update
The above shows you're logging in and you're executing the command as
pi
- regular user.For some reason . pretty sure im root
No, you're not.
-
@shavecat You are not root. :) You need to do
sudo apt update
-
@muldjord
stillpi@retropie:~ $ sudo apt update Hit:1 http://archive.raspberrypi.org/debian buster InRelease Hit:2 http://pipplware.pplware.pt/pipplware/dists/buster/main/binary ./ InRelease Get:3 http://packages.microsoft.com/repos/code stable InRelease [10.4 kB] Hit:4 http://raspbian.raspberrypi.org/raspbian buster InRelease Get:5 http://packages.microsoft.com/repos/code stable/main armhf Packages [14.3 kB] Get:6 http://packages.microsoft.com/repos/code stable/main arm64 Packages [14.5 kB] Get:7 http://packages.microsoft.com/repos/code stable/main amd64 Packages [13.9 kB] Fetched 53.1 kB in 1s (38.8 kB/s) Reading package lists... Done Building dependency tree Reading state information... Done 2 packages can be upgraded. Run 'apt list --upgradable' to see them. N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'http://raspbian.raspberrypi.org/raspbian buster InRelease' doesn't support architecture 'i386' N: Skipping acquire of configured file 'contrib/binary-i386/Packages' as repository 'http://raspbian.raspberrypi.org/raspbian buster InRelease' doesn't support architecture 'i386' N: Skipping acquire of configured file 'non-free/binary-i386/Packages' as repository 'http://raspbian.raspberrypi.org/raspbian buster InRelease' doesn't support architecture 'i386' N: Skipping acquire of configured file 'rpi/binary-i386/Packages' as repository 'http://raspbian.raspberrypi.org/raspbian buster InRelease' doesn't support architecture 'i386'
@mitu
HowOpen file sshd_config located in etc/ssh: sudo nano /etc/ssh/sshd_config Find line: PermitRootLogin without-password Comment it out (or delete) it and replace with: PermitRootLogin yes Save changes (CTRL + X) Set root password: sudo passwd root Reboot your Raspberry Pi
did that
didnt helpAnd thanks ! :))
-
-
@mitu
how do i change it to root -
-
@mitu
thanks :) -
@shavecat To elaborate a bit (because I'm a little bored this evening): You pretty much don't ever need to be acting as the actual root user. Especially if you are new to Linux. There is a high chance of messing things up if you start working directly as the root user.
Instead, as we've mentioned, you should use
sudo
. But only when you need to!sudo
stands for super user do. The super user is the root user. In other words: When you run a command withsudo
in front of it, you are running it as the root user for just that one command. It's a nice way to elevate your rights temporarily when needed.But I can't stress this enough: Don't run commands as sudo unless you absolutely have to! Any file or path that is created while sudo'ing, will be owned by root. And if that was not the intention, you will have issues later on, when the ordinary pi user tries to access those files or paths.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.