Menu

#4079 Webmin's use of 'apt-get -y install' is undesirable

1.580
open
5
2014-07-06
2012-04-06
Ben Johnson
No

The mailing list thread on this discussion has died-out, so I am reviving the issue here.

Webmin uses 'apt-get -y install' to upgrade packages. This approach causes problems relating to package dependencies.

For example, whenever I upgrade the apache2 package, libapache2-mod-php5 is removed in the process and never reinstalled. This causes Apache to fail to start after the upgrade (due to syntax errors resulting from libapache2-mod-php5's absence). I have to reinstall libapache2-mod-php5 manually every time.

Initially, I thought that this was a problem with Ubuntu's apache2 package, and I opened a ticket ( https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/969426 ), but the folks at Ubuntu clarified the issue and explained why 'apt-get -y install' is not the right approach to upgrading packages.

Discussion

  • Ben Johnson

    Ben Johnson - 2012-04-06

    Screenshot denoting possible Dry-Run Only checkbox

     
  • Ben Johnson

    Ben Johnson - 2012-04-06

    As discussed on the mailing list, it seems that adding a "Dry-Run Only" checkbox to the Update Packages module interface would be a powerful addition to Webmin. Please see attached screenshot for possible placement.

     
  • Jamie Cameron

    Jamie Cameron - 2012-04-06

    So unless there is some way to upgrade a single package other than apt-get install , I'm not willing to switch to using "apt-get upgrade". Admins typically want the flexibility to do selective upgrades, not update the whole system at once.

     
  • Ben Johnson

    Ben Johnson - 2012-04-06

    I agree completely; the ability to update packages selectively is an absolute must.

    Consider the fact that Ubuntu provides for this functionality in its graphical utility, Update Manager. How is this accomplished? I don't know. I have asked this question in the Ubuntu bug tracker thread at https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/969426 . Hopefully one of the developers will respond. I don't know whether the Update Manager "exploits" apt-get in some way (e.g., by manipulating its configuration with apt_preferences) or uses a different utility (that is, not apt-get) altogether.

    In any event, it seems possible to achieve the desired behavior.

    If and until the package upgrading mechanism is improved to avoid the pitfall I've outlined, adding the "Dry Run Only" checkbox seems worthwhile.

    Thanks, Jamie!

     
  • Jamie Cameron

    Jamie Cameron - 2012-04-06

    If debian's developers explain a proper way of doing this, please let me know and I will update Webmin to use it.

     
  • Mike Robinson

    Mike Robinson - 2012-05-22

    What about adding the --no-remove option?

    From the man page: "If any packages are to be removed apt-get immediately aborts without prompting. Configuration Item: APT::Get::Remove."

    It's probably better to have a package not update than to have it update and remove something else.

     
  • Jamie Cameron

    Jamie Cameron - 2012-05-22

    That could be used .. but wouldn't it break the case where an update legitimately needs to replace one dependency with another?

     
  • Steven Page

    Steven Page - 2014-07-05

    I also have had this problem a number of times. Coming back after a weekend, to find that mod_fastcgid has been removed, in favor of mod_php (for example), is a serious concern.

    As a workaround, I created a script. this script checks to see if package X is installed, and if not, simply reinstall it. so if mod_fastcgid gets removed during a package update... every hour, it checks for its existence, and replaced mod_php with mod_fastcgid.

    could something like this be done for essential packages used by webmin? I realize that this isn't really a fix for the issue, but only a hack. but currently, the latter seems much more undersireable.

     
  • Jamie Cameron

    Jamie Cameron - 2014-07-05

    Automatically re-installing missing packages would be tough to add to Webmin, as the list depends heavily on the distro, version and purpose of the system.

     
  • Steven Page

    Steven Page - 2014-07-06

    right. never thought about that. it was pretty late when i found this post XD. sorry about that.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.