Score:1

How to backup locally-installed apt package?

mx flag

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
user535733 avatar
cn flag
Are you saying that you do not have the original .deb package?
Atte Juvonen avatar
mx flag
The package was preinstalled on this laptop. I don't know if a corresponding .deb package exists somewhere or not.
N0rbert avatar
zw flag
Please add output of `apt-cache policy oem-fix-gfx-nvidia-ondemandmode` to the question by editing it.
N0rbert avatar
zw flag
Please run `dpkg -L oem-fix-gfx-nvidia-ondemandmode` and `find /var/lib/dpkg/ -name "oem-fix-gfx-nvidia-ondemandmode.*"` and add their output to the question. I'm not sure is it same package or not, but there is [some PPA](https://launchpad.net/~kchsieh/+archive/ubuntu/verification/+packages?field.name_filter=oem-fix-gfx-nvidia-ondemandmode&field.status_filter=published&field.series_filter=focal) with version 1.5.
Score:2
cn flag

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.

Score:0
zw flag

If I understand things correctly, then this package came from OEM packagers, like this PPA.

The oem-fix-gfx-nvidia-ondemandmode_1.5 package itself is almost empty, as it has only 2 objects:

/usr/share/doc/oem-fix-gfx-nvidia-ondemandmode/changelog.gz
/usr/share/doc/oem-fix-gfx-nvidia-ondemandmode/copyright

But the most interesting part of package is its post-install script.

You have to find it at /var/lib/dpkg/info/oem-fix-gfx-nvidia-ondemandmode.postinst and backup.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.