RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    cant apt update

    Scheduled Pinned Locked Moved Help and Support
    update
    9 Posts 3 Posters 904 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • shavecatS
      shavecat
      last edited by

      Hey
      retropie 4.6 pi4
      im login with pi and password from ssh .
      but i cant update it from the ssh

      
      pi@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 :)

      mituM muldjordM 2 Replies Last reply Reply Quote 0
      • mituM
        mitu Global Moderator @shavecat
        last edited by

        @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.

        1 Reply Last reply Reply Quote 1
        • muldjordM
          muldjord @shavecat
          last edited by

          @shavecat You are not root. :) You need to do

          sudo apt update
          
          shavecatS 1 Reply Last reply Reply Quote 1
          • shavecatS
            shavecat @muldjord
            last edited by shavecat

            @muldjord
            still

            
            pi@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
            How

            Open 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 help

            And thanks ! :))

            mituM 1 Reply Last reply Reply Quote 0
            • mituM
              mitu Global Moderator @shavecat
              last edited by

              @shavecat said in cant apt update:

              How

              How, how, what ?

              shavecatS 1 Reply Last reply Reply Quote 0
              • shavecatS
                shavecat @mitu
                last edited by

                @mitu
                how do i change it to root

                mituM 1 Reply Last reply Reply Quote 0
                • mituM
                  mitu Global Moderator @shavecat
                  last edited by

                  @shavecat You don't. As @muldjord mentioned, using sudo is enough. Looks like it worked this way.

                  shavecatS 1 Reply Last reply Reply Quote 0
                  • shavecatS
                    shavecat @mitu
                    last edited by

                    @mitu
                    thanks :)

                    muldjordM 1 Reply Last reply Reply Quote 0
                    • muldjordM
                      muldjord @shavecat
                      last edited by

                      @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 with sudo 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.

                      1 Reply Last reply Reply Quote 3
                      • First post
                        Last post

                      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.