0

I'm trying to use an Ubuntu 18.04 LiveUSB to recover a lost file. I've booted into the LiveUSB. Now, I need to install the 'testdisk' package.

I can run $ sudo apt update and $ sudo apt upgrade with normal output and no errors. However, I can't install packages. If I use apt-cache show to find a package, I always get a "No packages found" error. For instance:

$ apt-cache show testdisk
N: Unable to locate package testdisk
E: No packages found
$ apt-cache show cowsay
N: Unable to locate package cowsay
E: No packages found

If I try to install, I always get results like

$ sudo apt install testdisk
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package testdisk.

I am connected to the network and can browse the Internet normally from the LiveUSB.

This AskUbuntu answer says that I ought to be able to install packages to the LiveUSB. I don't need it to be persistent, I just need testdisk long enough to recover a file.

How can I install packages in an Ubuntu 18.04 LiveUSB?

  • 3
    Run sudo apt update again. Read the output. If you don't understand the output, then paste the output into your question. – user535733 May 10 '21 at 20:41

2 Answers2

2

Adding testdisk to a Live USB

Testdisk is located in the Universe Repository.

To enable, in terminal run: sudo add-apt-repository universe

Then run: sudo apt update and then sudo apt install testdisk

That should do it.

Bruni
  • 10,542
C.S.Cameron
  • 19,519
0

as you can use browser - you can download this as apt/deb from unofficial source and install from filemanager/terminal, you don't even have to use network because file installations are offline and as you downloaded it - save to another pendrive cause it can help you in future ;)

  • and here you have link to OFFICIAL source : https://www.cgsecurity.org/wiki/TestDisk_Download , it's even more official than in apt ;) – hacknorris May 10 '21 at 19:08