Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 485205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T01:22:40+00:00 2026-05-13T01:22:40+00:00

I am distributing one of my applications using a .deb package, but have a

  • 0

I am distributing one of my applications using a .deb package, but have a problem relating to one of the files.

The distribution includes a database file which is constantly updated by the app, on a fresh install I want the installer to copy a new, empty db file onto the users system, but on an upgrade I want the installer to leave the existing copy in place (overwriting it would result in all the users data getting lost).

Currently I have included the file in the ‘conffiles’ file, so the installer always asks the user whether to overwrite the existing file or not, but this isn’t the behaviour I want – overwriting the file is never the right thing to do and I’m concerned that a user may pick the wrong option during an upgrade and hose their data.

Is there any way to tell the installer that if the db file already exists just leave it alone and don’t ask the user what to do?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T01:22:41+00:00Added an answer on May 13, 2026 at 1:22 am

    Yes, use a preinst/postinst script. The usual method is to name the file in the package with a special name ending with dpkg-new, for instance /var/lib/myapp/mydb.data.dpkg-new. Then write a ‘postinst‘ script to put in the DEBIAN directory of your package to check for the existence of the database, and rename or delete the dpkg-new file accordingly, something like:

    #!/bin/bash
    
    if [ -f /var/lib/myapp/mydb.data ]; then
        rm /var/lib/myapp/mydb.data.dpkg-new
    else
       mv /var/lib/myapp/mydb.data.dpkg-new /var/lib/myapp/mydb.data
    fi
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a problem to distributing application with 2 project (one project with sub-project
I'm using an Ant build script to collate my Eclipse-based application for distribution. One
Supposing I have one perl in /usr/bin (which came along with my os-distribution) and
When I'm maintaining and distributing a Python package, should I keep the MANIFEST file
I have a cherrypy server distributing xml files to webpages. While my server runs,
I have 2 desktop applications that I wish to integrate with external applications. One
Possible Duplicate: Sending large files reliably in PHP I will be distributing a PHP
Do we still need to bother with vcredist.exe when distributing windows native applications ?
Collecting the admin-media files from different django application is one of the not-so-good things
I have a web application that I'll be distributing to customers. I'll give them

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.