曦远 (DealiAxy)一份私人的文字刊物

StarBlog
返回文章列表折页手记阅读全文
个人数据保全计划

Personal Data Preservation Plan: (4) Basic Environment Configuration

Disable swap If you have enough memory (8GB or more), you can consider disabling swap to improve system performance Check which swaps are enabled cat /proc/swaps Output | Filename | Type | Size | Used | Priority | | ------------------------------------- | ----

曦远 (DealiAxy)约 13 分钟
目录7 个章节

Disable swap

If you have enough memory (8GB or more), you can consider disabling swap to improve system performance

Check which swaps are enabled

cat /proc/swaps

Output

FilenameTypeSizeUsedPriority
/dev/md321partition82837082373820-2
/dev/md256partition5301080-3
/dev/md322partition72351320-4
/share/CACHEDEV1_DATA/.swap/qnap_swapfile167772120-5

Disable all swaps at once

swapoff -a

However, because QNAP's system directories are read-only, they will still be turned back on after the next reboot, so the change is only effective during the current boot session

You can turn them back on manually; just specify the corresponding swap to enable.

swapon /dev/md321
swapon /dev/md256

Add third-party sources

Currently there are two options: one is Europe's QNAP Club, and the other is the Entware package manager.

QNAP Club

This can be managed and installed directly in App Center

Click the gear button in the upper right corner of App Center, go to the "App Repository" tab, click Add, set a name—I just set it to QNAP Club—paste in the following URL, and confirm

https://www.qnapclub.eu/repo.xml

After adding it, an extra icon will appear in the left sidebar of App Center, with the name you just set

Clicking into it should be completely blank; click All Apps. Because its servers are in Europe, it will take a while before they show up~

After trying it out, I found this quite convenient. There are many more packages than the official ones (though of course not as many as Entware). The download speed is slow, but still acceptable

Entware

This is a package manager, similar to Brew on Mac. After installation, you can use it from the command line. It can be used to install a lot of software that QNAP's customized Linux doesn't include, such as git, openssh, and the like.

Entware itself is an open-source project that can be installed on embedded devices such as routers. Officially it also provides support for QNAP NAS, offering installation packages in qpkg format.

Entware installs all software under /opt, so its command is opkg

There are several ways to download it:

Official wiki: https://github.com/Entware/Entware/wiki/Install-on-QNAP-NAS

The latest version is currently 1.03. After downloading, open App Center, click Manual Install in the upper right corner, upload the package and install it. Oh, you need to enable unknown digital signatures in the settings first.

When I installed it, it kept getting stuck at 45%. I closed App Center, reopened it, canceled the installation, and after repeating this several times I finally got it installed. After searching for a long time I think it was probably a network issue in China. App Center doesn't show command-line output during installation, which is really a hassle—when something goes wrong you don't even know where to look.

PS: I now know you can install software directly with sh xxx.qpkg.

After installation, running opkg gives command not found

You still need to add the path to the PATH environment variable

Edit ~/.bashrc

export PATH=/opt/bin:$PATH

Then run source ~/.bashrc to take effect

It seems you have to do this every time you log in via ssh. Not sure if there's any other solution

A few commonly used commands:

  • opkg update update sources
  • opkg upgrade upgrade installed software
  • opkg install 包名 install software
  • opkg remove 包名 remove software
  • opkg list | grep -e 包名 search for software

References

Rants (from the referenced blogger)

  1. After installing python3, perl, and nodejs in App Center, they are also missing from the environment variables, so you also need to manually add these three programs to the environment variables;
  2. QNAP's customized Linux is really a hassle; /usr/bin gets reset, and it's not the only directory that gets reset;

Blog references

_EOF_

Personal Data Preservation Plan: (4) Basic Environment Configuration

本文作者:
程序设计实验室
版权声明:
本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!

相关文章

讨论

共 0 条

良言一句三冬暖,恶语伤人六月寒。

加载评论中…