How to backup locally-installed apt package?
How can I backup a locally-installed apt package?
I'm troubleshooting a NVIDIA driver issue and I would like to try removing package oem-fix-gfx-nvidia-ondemandmode
. I want to backup the package before I remove it, in case something really breaks. This package was installed by the laptop manufacturer (pre-installed Ubuntu) and I have no idea what it does, other than the fact that it's messing with my NVIDIA drivers. Nothing comes up by googling the package name.
Most options for "backing up apt packages" involve simply making lists of packages to download, which obviously is not going to work out for a locally-installed package. I also tried apt-clone, but that wasn't able to create a copy of this package either.
$ apt-cache policy oem-fix-gfx-nvidia-ondemandmode
oem-fix-gfx-nvidia-ondemandmode:
Installed: 1.4
Candidate: 1.4
Version table:
*** 1.4 100
100 /var/lib/dpkg/status
$ dpkg -L oem-fix-gfx-nvidia-ondemandmode
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/oem-fix-gfx-nvidia-ondemandmode
/usr/share/doc/oem-fix-gfx-nvidia-ondemandmode/changelog.gz
/usr/share/doc/oem-fix-gfx-nvidia-ondemandmode/copyright
Solution 1:
Option 1: Contact your OEM support. They provided the software. Since Ubuntu did not provide the package, the Ubuntu repositories do NOT have a copy of it.
Option 2: Use the command dpkg -L oem-fix-gfx-nvidia-ondemandmode
to show you a list of all the files included in that package. You can manually back up and restore those files, though not in the form of a package; this is a somewhat kludgy workaround. Warning: If you make a mistake or a file gets corrupted during copy, apt cannot magically recover since it lacks a .deb to work from.