2

I have installed a package with apt-get install package. I will now have to upgrade to a newer version that is only available as package.deb from the vendor's web site.

So how can I go about upgrading a package that was installed with apt-get with dpkg (after downloading the .deb file)?

One option that comes to mind is apt-get remove package && dpkg --install package.deb, but this seems sub-optimal e.g. because it can run into difficulties when package.deb adds new dependencies. Is there a better way to go?

2
  • 1
    If the package is actually an upgrade (keeps the same name, maintainer scripts can handle previous version), then you don't need to remove it. But this is not always the case if the new package comes from the vendor (who may or may not respect the existing package's conventions of names, versions, file locations, etc.).
    – muru
    Aug 9, 2017 at 5:34
  • 1
    I agree with @muru .. I've just dpkg -i installed any upgrades if its not in a repo|ppa without issues with the few apps I've had to upgrade on debian|ubuntu.
    – guiverc
    Aug 9, 2017 at 5:43

1 Answer 1

3

Download the new version of your software, cd into its directory and then simply run:

sudo apt install package.deb

The apt utility can handle installing .deb files while handling their dependencies too.

Just make sure the package.deb that you are downloading has been created for your Ubuntu version, for example do not install a deb file which is created for zesty on xenial.

2
  • does this then install the dependencies as well? What happens if the apt repo version at some point in time catches up with the version from the deb?
    – lucidbrot
    Feb 16, 2023 at 18:34
  • 1
    It also installs the dependencies (if they exist in the repositories). If the version catches up in some point, it gets replaced with the newer version unless you hold the package using apt-mark.
    – Ravexina
    Feb 16, 2023 at 18:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .