1 1
renky

orange pi one how do I get permission to update?

Recommended Posts

orange pi one desktop

apt-get update

apt-get upgrade

 

https://docs.armbian.com/User-Guide_Getting-Started/

 

I cannot update and upgrade.

I get these messages
 

$ apt-get update

Reading package lists... Done

W: chmod 0700 of directory /var/lib/apt/lists/partial failed - SetupAPTPartialDirectory (1: Operation not permitted)

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)

$ apt-get upgrade

E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)

E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

$

Makes no difference if I write sudo first or run su.

 

How can I update? Thanks.

Share this post


Link to post
Share on other sites

You need to be root --> # at the command prompt (which you should get after su and the root-password), because as user you cant 

apt update & upgrade.

 

Check the user with the command id

 

If you running a desktop environment you also have to close something like the software-center or graphical updater.

 

If only apt update does work then wait for the end of the "daily update" :)

use the command ps -ef|grep apt

to see if apt is working (this is setting the lock file /var/lib/dpkg/lock).

 

When apt has ended its work (only the grep for apt is shown)

root# ps -ef|grep apt
root      3536  1495  0 17:34 pts/0    00:00:00 grep apt

 then you should be able to

apt upgrade

Share this post


Link to post
Share on other sites

Use sudo before your commands.
sudo apt-get update && sudo apt-get upgrade

 

And when I get : E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
Then I do,

sudo rm /var/lib/dpkg/lock
 

After that it works. Don't know if that's the right way, but it works.

Share this post


Link to post
Share on other sites
4 hours ago, NicoD said:

Then I do,

sudo rm /var/lib/dpkg/lock

 

Not exactly the best way :) There could be some automated apt process with some purpose in the background. For example, we run index updates (apt update) every 21 days which means usually also at the first boot. This is getting some changes lately ... but on most images, it goes that way. 

The best tactic is to wait for a minute that index is updated, then proceed with apt get ...

Share this post


Link to post
Share on other sites

As I wrote

sudo apt-get update

sudo apt-get upgrade

does not work either.

 

Nor does

su + enter.

 

Is it a common error?

Being able to update should be a mundane task.

 

 

 

 

 

Share this post


Link to post
Share on other sites
16 minutes ago, renky said:

Nor does

su + enter.

What does the OPi One after si+enter?

Doenst it ask for the root password.
Did you create at the first boot of armbian a root password ( from 1234 to your password) and a new user?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
1 1