pkg是一个轻量级的包管理系统,专门设计用于存储能力有限的嵌入式设备上运行的Linux系统.

env

  • ds920+

为群晖DSM系统安装ipkg包管理器,实现更多软件自定义安装

1.查看synology-nas cpu信息

登录控制台 -> 控制面板 -> 信息中心 -> CPU INTEL Celeron J4125 //intel系列芯片

2.optware(intel syno-i686)

3.安装bootstrap

//stable
wget http://ipkg.nslu2-linux.org/feeds/optware/syno-i686/cross/stable/syno-i686-bootstrap_1.2-7_i686.xsh

chmod +x syno-i686-bootstrap_1.2-7_i686.xsh
sh syno-i686-bootstrap_1.2-7_i686.xsh

root@slg-testing:~/tmp# chmod +x syno-i686-bootstrap_1.2-7_i686.xsh
root@slg-testing:~/tmp# sh syno-i686-bootstrap_1.2-7_i686.xsh
Optware Bootstrap for syno-i686.
Extracting archive... please wait
1216+1 records in
1216+1 records out
249302 bytes (249 kB, 243 KiB) copied, 0.00755666 s, 33.0 MB/s
bootstrap/
bootstrap/bootstrap.sh
bootstrap/ipkg-opt.ipk
bootstrap/ipkg.sh
bootstrap/optware-bootstrap.ipk
bootstrap/wget.ipk
Creating temporary ipkg repository...
Installing optware-bootstrap package...
Unpacking optware-bootstrap.ipk...Done.
Configuring optware-bootstrap.ipk...Modifying /etc/rc.local
Done.
Installing ipkg...
Unpacking ipkg-opt.ipk...Done.
Configuring ipkg-opt.ipk...Done.
Removing temporary ipkg repository...
Installing wget...
Installing wget (1.12-2) to root...
Configuring wget
Successfully terminated.
Creating /opt/etc/ipkg/cross-feed.conf...
Setup complete.


info:
root@slg-testing:~/tmp# ll /opt/   //chroot
total 4
drwxr-xr-x  1 root root   46 Dec  6 16:48 .
drwxr-xr-x 21 root root 4096 May 19  2010 ..
drwxr-xr-x  1 root root   70 Dec  6 16:48 bin
drwxr-xr-x  1 root root   70 Dec  6 16:48 etc
drwxr-xr-x  1 root root   84 Dec  6 16:48 lib
drwxr-xr-x  1 root root    8 Dec  6 16:48 man
drwxr-xr-x  1 root root    8 May 19  2010 share
drwxr-xr-t  1 root root    0 Feb 19  2012 tmp
drwxr-xr-x  1 root root    6 Feb 19  2012 var

root@slg-testing:~/tmp# ll /opt/bin/
total 316
drwxr-xr-x 1 root root     70 Dec  6 16:48 .
drwxr-xr-x 1 root root     46 Dec  6 16:48 ..
-rwxr-xr-x 1 root root   3008 May 19  2010 ipkg
lrwxrwxrwx 1 root root      4 May 19  2010 ipkg-opt -> ipkg
-rwxr-xr-x 1 root root   4248 May 19  2010 update-alternatives
-rwxr-xr-x 1 root root 304444 Feb 19  2012 wget
root@slg-testing:~/tmp# cat /etc/rc.local   //自启动脚本
#!/bin/sh

# Optware setup
[ -x /etc/rc.optware ] && /etc/rc.optware start

exit 0

root@slg-testing:~/tmp# cat /opt/etc/ipkg/cross-feed.conf   //源
src/gz cross http://ipkg.nslu2-linux.org/feeds/optware/syno-i686/cross/unstable

//unstable
wget http://ipkg.nslu2-linux.org/feeds/optware/syno-i686/cross/unstable/syno-i686-bootstrap_1.2-7_i686.xsh
chmod +x syno-i686-bootstrap_1.2-7_i686.xsh
sh syno-i686-bootstrap_1.2-7_i686.xsh

4.ipkg

#首先更新软件源
ipkg update

#安装命令
ipkg install 软件包名称

#查看已安装
ipkg list_installed

#卸载命令如下
ipkg remove 软件包名称

4.1更新源

root@slg-testing:~/tmp# 
root@slg-testing:~/tmp# ipkg update
Downloading http://ipkg.nslu2-linux.org/feeds/optware/syno-i686/cross/unstable/Packages.gz
Inflating http://ipkg.nslu2-linux.org/feeds/optware/syno-i686/cross/unstable/Packages.gz
Updated list of available packages in /opt/lib/ipkg/lists/cross
Successfully terminated.
root@slg-testing:~/tmp# 

4.2安装包

ipkg install screen

root@slg-testing:~/tmp# ipkg install screen
Installing screen (4.0.3-2) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/syno-i686/cross/unstable/screen_4.0.3-2_i686.ipk
Installing termcap (1.3.1-2) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/syno-i686/cross/unstable/termcap_1.3.1-2_i686.ipk
Configuring screen
Configuring termcap
Successfully terminated.
root@slg-testing:~/tmp# screen -h
Use: screen [-opts] [cmd [args]]
 or: screen -r [host.tty]
 ...

root@slg-testing:~/tmp# ipkg install lrzsz
Installing lrzsz (0.12.20-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/syno-i686/cross/unstable/lrzsz_0.12.20-1_i686.ipk
Configuring lrzsz
Successfully terminated.

注意:默认命令lrzl/lsz,需要做链接 cd /opt/bin/ && ln lrz rz && ln lsz sz


jiangzl@DS920:/$ sudo ipkg install unzip
Password: 
Installing unzip (6.0-2) on /opt/.
Downloading http://ipkg.nslu2-linux.org/optware-ng/buildroot-x86_64/unzip_6.0-2_x86_64.ipk.
Installing bzip2 (1.0.6-2) on /opt/.
Downloading http://ipkg.nslu2-linux.org/optware-ng/buildroot-x86_64/bzip2_1.0.6-2_x86_64.ipk.
Configuring bzip2.
update-alternatives: Linking //opt/bin/bzip2 to /opt/bin/bzip2-bzip2
Configuring unzip.
update-alternatives: Linking //opt/bin/unzip to /opt/bin/unzip-unzip

默认安装二进制到/opt/bin/ /opt/ -> root, /opt 目录下是否存在Optware的相关文件和文件夹