apt-get update/upgrade

Other software discussion
Post Reply
NiamoR42
Posts: 4
Joined: Wed May 22, 2019 8:17 pm

apt-get update/upgrade

Post by NiamoR42 »

Hello,

I just start to use my stereoPi and the first think I would like to do is :

Code: Select all

sudo apt-get update
the result is :

Code: Select all

Ign:1 http://raspbian.raspberrypi.org/raspbian stretch InRelease
Ign:2 http://archive.raspberrypi.org/debian stretch InRelease
Err:3 http://archive.raspberrypi.org/debian stretch Release
  Could not open file /var/lib/apt/lists/partial/archive.raspberrypi.org_debian_dists_stretch_Release - open (30: Read-only file system) [IP: 93.93.130.104 80]
Err:4 http://raspbian.raspberrypi.org/raspbian stretch Release
  Could not open file /var/lib/apt/lists/partial/raspbian.raspberrypi.org_raspbian_dists_stretch_Release - open (30: Read-only file system)
Reading package lists... Done
W: chown to _apt:root of directory /var/lib/apt/lists/partial failed - SetupAPTPartialDirectory (30: Read-only file system)
W: chmod 0700 of directory /var/lib/apt/lists/partial failed - SetupAPTPartialDirectory (30: Read-only file system)
W: Not using locking for read only lock file /var/lib/apt/lists/lock
W: Problem unlinking the file /var/lib/apt/lists/partial/.apt-acquire-privs-test.PYgw7i - IsAccessibleBySandboxUser (30: Read-only file system)
W: Problem unlinking the file /var/lib/apt/lists/partial/.apt-acquire-privs-test.UZyKf8 - IsAccessibleBySandboxUser (30: Read-only file system)
W: Problem unlinking the file /var/lib/apt/lists/partial/raspbian.raspberrypi.org_raspbian_dists_stretch_InRelease - PrepareFiles (30: Read-only file system)
W: Problem unlinking the file /var/lib/apt/lists/partial/archive.raspberrypi.org_debian_dists_stretch_InRelease - PrepareFiles (30: Read-only file system)
W: Problem unlinking the file /var/lib/apt/lists/partial/archive.raspberrypi.org_debian_dists_stretch_Release - PrepareFiles (30: Read-only file system)
E: The repository 'http://archive.raspberrypi.org/debian stretch Release' does no longer have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: Problem unlinking the file /var/lib/apt/lists/partial/raspbian.raspberrypi.org_raspbian_dists_stretch_Release - PrepareFiles (30: Read-only file system)
E: The repository 'http://raspbian.raspberrypi.org/raspbian stretch Release' does no longer have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (30: Read-only file system)
W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (30: Read-only file system)
so, is it normal that it doesn't work out of the box ?

stereomaton
Posts: 215
Joined: Tue May 21, 2019 12:33 pm
Location: France

Re: apt-get update/upgrade

Post by stereomaton »

If you read[1] your error message, you can easily understand what happens:
Could not open file [...] - open (30: Read-only file system)
As I noticed when I received my stereopi, the root file system is read-only (which totally makes sense for embedded systems) thus you have to remount it read-write to perform your operation. The command line to do so is

Code: Select all

mount -o remount,rw /
The way around, to remount read-only you can use

Code: Select all

mount -o remount,ro /
[1] Reading is truly an amazing superpower too often negligated
Stereophotographer and hacker
Despite my quite active participation in the forum, I am not in the StereoPi team
StereoPi (v1) Standard Edition + CM3Lite module + a few cameras

Blinky
Posts: 38
Joined: Wed May 01, 2019 11:18 pm

Re: apt-get update/upgrade

Post by Blinky »

NiamiO, take a look in the Videos, Photos ..., part of the forum and look for First Boot, it explains a lot.

Regards,
Blinky

User avatar
Realizator
Site Admin
Posts: 900
Joined: Tue Apr 16, 2019 9:23 am
Contact:

Re: apt-get update/upgrade

Post by Realizator »

NiamoR42, if you want to update S.L.P. image, it is a bit tricky.
This image is designed for special active use, so there are two useful (for users), but problematic (for updaters) features:

1. Filesystem is read-only. This feature allow you to save all data and ability to work in a case of occasional poweroff (no data damaged this way). Stereomaton provide you with cite from our Wiki, how to do FS writeable.
2. We did Linux file system as small as possible (2Gb in our case). It allows, for example, to upload it to 4Gb eMMC, and also have 2Gb of a free space for user's needs. But in a case of apt-get upgrade you may face lack of free space. The easiest way here is to insert micro SD in Ubuntu and increase partition size to 4 Gb or more (delete FAT32 before doing this). After that you can do update and upgrade as you like.

Blinky, all of us was in NiamoR42 shoes, when we have too many questions, too small time to read all the docs, and a great desire to run our projects ASAP. :-) For me such a questions on forum only means, that our Wiki and start guides are not so good as they might be. So I plan to improve them on the base of users questions on this forum.
Eugene a.k.a. Realizator

NiamoR42
Posts: 4
Joined: Wed May 22, 2019 8:17 pm

Re: apt-get update/upgrade

Post by NiamoR42 »

thanks for all the answers.
my feedback :
  • I would like to use this tuto https://medium.com/stereopi/opencv-and- ... cb6792bbed I tried to do it from my computer and saw that there is no ip adress in source code : I understand we need to execute python code inside the stereopi (it makes sence :D ).
    I tried to copy the git project inside the pi but it seams that no git is install : that's why I did apt-get update before to install git and other dependancy :
    • Raspbian Stretch (kernel 4.14.98-v7+)
    • Python 3.5.3
    • OpenCV 3.4.4 (pre-compiled, 'pip' from Python Wheels)
    • Picamera 1.13

    So, is it better to use the Ready-to-use Raspbian Image than to install all manualy ?
  • when you said that :
    the root file system is read-only (which totally makes sense for embedded systems)
    I understand it's important only for this :
    ability to work in a case of occasional poweroff (no data damaged this way)
    because I bought the "StereoPi Starter Kit" and doesn't have embeded eMMC, so no "space problem" (or I can change the sd card) ?
  • and the last point about :
    [1] Reading is truly an amazing superpower too often negligated
    I understood what mean the messages but, before to do a mistake, I prefer to ask cause : if someone took the decision to do it, I prefer to understand the reason before to do modifications :roll: :geek:
perhaps it's another tread : do you know if it's a good idea to fix the ip adress of lan in order to have a direct access from a computer (without router) ?
if yes, it could be good to add this in the web interface :D

User avatar
Realizator
Site Admin
Posts: 900
Joined: Tue Apr 16, 2019 9:23 am
Contact:

Re: apt-get update/upgrade

Post by Realizator »

NiamoR42 wrote:
Thu May 23, 2019 11:08 am
thanks for all the answers.
my feedback :
There are 2 different images. All read-only features concerns S.L.P. image. For OpenCV I'd recommend you to use ready-to-use image. It is a stock Raspbian, but with installed OpenCV. Also python3 is set as a default.
You can also install all components by yourself on a clean Raspbian, but it takes a lot of time. I think I'll do a guide for this in the future.
Key point for you: at OpenCV Raspbian image there are no any read-only options, so you can do all updates without a tricks.
Our OpenCV image is intended for work with keyboard, mouse and monitor. You can start this way, and write all ethernet settings you need. Please notice, that there are lot of GUI-based tasks with OpenCV, so I thing starting with a monitor is a better option.
NiamoR42 wrote:
Thu May 23, 2019 11:08 am
because I bought the "StereoPi Starter Kit" and doesn't have embeded eMMC, so no "space problem" (or I can change the sd card) ?
S.L.P. image can be used by others on a small-sized micro SD card or with eMMC, that's why we optimized its size. Your pre-written image in Starter Kit has no space problems. :D My recommendation is to use another micro SD card for OpenCV experiments. If you want to mix S.L.P. image and OpenCV, you need to dive deep inside and manage out a lot of details.
NiamoR42 wrote:
Thu May 23, 2019 11:08 am
  • and the last point about :
    [1] Reading is truly an amazing superpower too often negligated
    I understood what mean the messages but, before to do a mistake, I prefer to ask cause : if someone took the decision to do it, I prefer to understand the reason before to do modifications :roll: :geek:
:D Agree!
NiamoR42 wrote:
Thu May 23, 2019 11:08 am
perhaps it's another tread : do you know if it's a good idea to fix the ip adress of lan in order to have a direct access from a computer (without router) ?
if yes, it could be good to add this in the web interface :D
As for myself, I don't use this approach. Usually I need several devices (like computer, Oculus Go and so on) in the same network. So I do it with a router.

UPD> Links to our OpenCV Raspbian image can be found here: https://github.com/realizator/stereopi-tutorial
UPD2> Do not be afraid to broke your S.L.P. or OpenCV image, as you may download and write it again!
UPD3> To start "from scratch" you can start with a stock Raspbian, and just add dt-blob.bin to BOOT partition (Wiki)
Eugene a.k.a. Realizator

stereomaton
Posts: 215
Joined: Tue May 21, 2019 12:33 pm
Location: France

Re: apt-get update/upgrade

Post by stereomaton »

NiamoR42 wrote:
Thu May 23, 2019 11:08 am
[1] Reading is truly an amazing superpower too often negligated
I understood what mean the messages but, before to do a mistake, I prefer to ask cause : if someone took the decision to do it, I prefer to understand the reason before to do modifications :roll: :geek:
Sorry for this little sarcasm, but I see too often people (not only students) asking for help because they just simply did not have read the messages. As your question did not pinpoint it, I assumed you did not noticed.

Read-only filesystems are often used in embedded world to avoid file system corruption in case of power failure (which is frequent as people do not like to shutdown properly, or because often the only way is to shutdown by cutting power). It also avoids to write data (such as never read logs) on a size-constrained partition that might eventually (soon) exhaust space and prevent system to boot.
Stereophotographer and hacker
Despite my quite active participation in the forum, I am not in the StereoPi team
StereoPi (v1) Standard Edition + CM3Lite module + a few cameras

Post Reply