I've made a deb package which contains binaries of my software. Also I've made a repo and configured it so user can install updates using sudo apt-get update mypackage && sudo apt-get install mypackage
. After installation binaries of my application will be extracted to /opt/mypackage
and .desktop file will be extracted to /usr/share/applications
so user can launch the application without issues.
What I want to know is how can I install updates of my application from code when they are available in the user system as it's done in other applications? I'm asking because it requires root password when running apt-get install
or sudo gdebi mypackage
.
At the moment when I want to push new updates - I build new .deb package and put it to the repository. Should I do it in the other way? Or maybe I was wrong when decided to put binaries in /opt directory?
Any help will be appreciated. If you know some open-source projects where this part of the functionality is implemented could you please share it? Also, I can create a simple repository which reproduces what I tried to explain here.
wget sourceforge.net/projects/ubuntuzilla/files/mozilla/apt/pool/main/f/firefox-mozilla-build/firefox-mozilla-build_39.0.3-0ubuntu1_amd64.deb
then installed it withsudo dpkg -i firefox-mozilla-build_39.0.3-0ubuntu1_amd64.deb
. After first launch it coudn't install update because of permissions. Then I restarted it withsudo firefox
- openned Home->About tab. Then application downloaded updates and installed it