This Tutorial guides you through the steps needed to restore IPKG and the /opt/ folder after updating the DSM-Version.

1.) Restart the NAS (optional)

Restart (reboot) the NAS using the graphical interface from DSM after upgrading the DSM-version.

2.) Restore symbolic link /opt

While upgrading the DSM-version the symbolic link /opt gets lost. With the following command we are going to restore that.

NAS> ln -s /volume1/@optware/ /opt

3.) Check file /root/.profile

Check the file "/root/.profile" using vi (nano does not work jet). For editing press "i", this puts the vi editor into insert mode. Press "<esc>" to exit the insert mode.
Use ":x <Return>" to quit vi and save changes.
Use ":q!<Return>" to quit vi without saving.

NAS> vi /root/.profile

The file "/root/.profile" should look somthing like this:

umask 022

#PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin
#export PATH

#This fixes the backspace when telnetting in.
#if [ "$TERM" != "linux" ]; then
#        stty erase
#fi

HOME=/root
export HOME

TERM=${TERM:-cons25}
export TERM

PAGER=more
export PAGER

PS1="`hostname`> "


alias dir="ls -al"
alias ll="ls -la"

# special library path def
#
LD_LIBRARY_PATH=/opt/lib:/opt/include
#
export LD_LIBRARY_PATH

4.) Check file /etc/profile

Check the file "/etc/profile" using vi (if nano was instaled /opt/bin/nano should work). For editing press "i", this puts the vi editor into insert mode. Press "<esc>" to exit the insert mode.
Use ":x <Return>" to quit vi and save changes.
Use ":q!<Return>" to quit vi without saving.

NAS> vi /etc/profile

The file "/etc/profile" should look somthing like this:

#/etc/profile: system-wide .profile file for ash.

umask 022

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin
export PATH

#This fixes the backspace when telnetting in.
#if [ "$TERM" != "linux" ]; then
# stty erase
#fi
PGDATA=/var/services/pgsql
export PGDATA

TERMINFO=/usr/share/terminfo
export TERMINFO

TERM=${TERM:-cons25}
export TERM

PAGER=more
export PAGER

export LC_ALL=en_US.utf8
export LANG=en_US.utf8

PS1="`hostname`> "

alias dir="ls -al"
alias ll="ls -la"

ulimit -c unlimited
PATH=/opt/bin:/opt/sbin:$PATH

5.) Check file /etc/rc.local

Check the file "/etc/rc.local" using vi.

NAS> vi /etc/rc.local

The file "/etc/rc.local" should look somthing like this:

#!/bin/sh

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

exit 0

6.) Restart the NAS

After restarting the NAS everything should be like it was before upgrading the DSM-version. The "ipkg" command should be available and all the packages that were installed, for example "nano" :-)

DSM, Restart NAS

Console, ipkg list_installed

Console, /root/.profile

Console, /etc/profile