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 | | ------------------------------------- | ----
目录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
| Filename | Type | Size | Used | Priority |
|---|---|---|---|---|
| /dev/md321 | partition | 8283708 | 2373820 | -2 |
| /dev/md256 | partition | 530108 | 0 | -3 |
| /dev/md322 | partition | 7235132 | 0 | -4 |
| /share/CACHEDEV1_DATA/.swap/qnap_swap | file | 16777212 | 0 | -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 GitHub Release: https://github.com/Entware/Entware
- The QNAP Club mentioned above; just go in and search
- Entware website: http://bin.entware.net/other/Entware_1.03std.qpkg
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 updateupdate sourcesopkg upgradeupgrade installed softwareopkg install 包名install softwareopkg remove 包名remove softwareopkg list | grep -e 包名search for software
References
- Installing Entware on QNAP - https://blog.phpgao.com/qnap_install_entware.html
- QNAP Tinkering Part 1: Installing QNAP qpkg packages from the command line - https://einverne.github.io/post/2018/06/qnap-install-qpkg-from-command-line.html
Rants (from the referenced blogger)
- 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;
- QNAP's customized Linux is really a hassle; /usr/bin gets reset, and it's not the only directory that gets reset;
Blog references
- My Home Server Journey - https://blog.csdn.net/hanziyuan08/category_9817235.html
- The same author's GitHub blog - https://github.com/Bpazy/blog/issues
- Playing with QNAP Column - https://post.smzdm.com/xilie/73788/
_EOF_
Personal Data Preservation Plan: (4) Basic Environment Configuration
- 本文作者:
- 程序设计实验室
- 版权声明:
- 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
相关文章
个人数据保全计划:安装Jellyfin
选择镜像:nyanmisaka/jellyfin Jellyfin中国特供版+Docker镜像,含驱动,免折腾开箱即用:https://post.smzdm.com/p/a3gw6g47/ 使用 docker-compose 部署 cd /share/Container/docker-apps/jellyfin mkdir cache config docker命令 docker run -d -
2022-11-04 · 个人数据保全计划 · 约 1 分钟
个人数据保全计划:(3)RAID与存储方案
iNode越小,可用空间也越小
2022-11-04 · 个人数据保全计划 · 约 1 分钟
个人数据保全计划:从印象笔记迁移到joplin
事实上我已经很多年没用印象笔记了,上次使用似乎还是很多年前大学时,当时还开了好几年会员,用来收藏网页、微信公众号文章,挺好用的。 可惜印象笔记(evernote)从某一年开始搞了中国特供版和国际版彻底切割,吃相越来越难看,而且导出格式也改成了专有格式,越来越封闭,这不是一个好兆头,我最怕被绑定在某个平台或者生态里。
2025-01-24 · 个人数据保全计划 · 约 1 分钟
为什么我给虚拟机分了 32G 硬盘,Ubuntu 却只识别 16G?
32G硬盘在PVE里明明分配好了,到Ubuntu就变15G,LVM这鬼东西把空间藏哪儿去了?根目录就分了一半?这算哪门子逻辑,简直离谱。扩容三步走倒是简单,但谁特喵会用到这种坑爹设计。
2025-10-10 · 个人数据保全计划 · 约 1 分钟
讨论
共 0 条加载评论中…