Sunday, February 27, 2022

Raspberry Pi 4 as a low-end server (eg. NAS)

Beside multi-core, Pi 4 spec also includes Gigabit network interface and dual USB 3 ports, that makes it a good platform for a NAS with RAID 1 disks setup  ie. mirrored, duplicated

A 2GB RAM ($ 35) is good enough for this purpose.  However, the more RAM the better in my opinion - also my recommendation is to download the Raspi OS 64-bit lite version (no GUI).  2GB is too weak for GUI; you would soon experience lagging in responses; the system will write frequently to swap - the SD card, reducing its life span.  Skipping GUI saves you ~100 MB RAM.  With more memory, other servers and/or even docker containers can run.  ;)

A very straight-forward instruction is already available by mag pi.

https://magpi.raspberrypi.com/articles/build-a-raspberry-pi-nas


Labels: , , ,

Tuesday, February 15, 2022

mxlinux install mongodb issue: unrecognized service how to resolve

If you follow mongodb installation instruction,  https://docs.mongodb.com/manual/tutorial/install-mongodb-on-debian/will find error when trying to start the service.  

That's because mx linux uses SysV init instead of systemd, but the apt installation didn't include a SysV script.


How to fix:

The init script could be downloaded from https://github.com/mongodb/mongo/blob/master/debian/init.d

Save it as  /etc/init.d/mongod

Restart computer


$ sudo service mongod start


test launching succesful

$ sudo service mongod status


connect to the local mongodb server

$ mongosh





Labels: , ,

Sunday, February 13, 2022

linux to upgrade specific packages

Chances are, you have installed a lot of things in your beloved system.  Some, if not most, packages are installed once but seldom used that you prefer not wasting time upgrade.  Or, you enjoy having full control over everything.


Usually on a GUI desktop, an icon at menu bar will remind you if any packages upgrade.  For example in mx linux, a parcel (package) icon will turn green.  You could click it to upgrade all.


Instead, open a terminal window:


1. update package list

    sudo apt update

2. show available upgrades

    apt list --upgradable



Now you have 3 options:


3a. if want to upgrade all, not care what

    sudo apt upgrade

  

3b. install a package and all its dependencies 

    sudo apt install --upgrade  some-package


3c. install one and only one package

    sudo apt install --only-upgrade   some-package


Labels: , , ,