2

I am beginner with ubuntu. I've got stuck with an error. I can't install application. Any ideas what may be wrong?

usic@hosttt:~$ sudo apt-get install /myprogram/program.deb
Reading package lists... Error!
E: read, still have 59 to read but none left
E: Error reading archive member header
E: Could not read meta data from /myprogram/program.deb
E: The package lists or status file could not be parsed or opened.
Serp
  • 23
  • Where is the program located? Most likely the path is wrong. – Pilot6 Jun 07 '20 at 15:08
  • @Pilot6 My path is like /customFolder/customerFolder/program.deb I don't use any default folders here. I couldn't install with apt but I've managed to do it with dpkg after manual dependency resolving. – Serp Jun 07 '20 at 15:26
  • Is the first "customFolder" really in the root of the FS? – Pilot6 Jun 07 '20 at 15:27
  • @N0rbert partly yes. But anyway I don't understand why I couldn't install local package with apt – Serp Jun 07 '20 at 15:28
  • @Pilot6 Yes, it is. It is on the same level with root and home directories – Serp Jun 07 '20 at 15:29
  • It looks weird to me. Why would you place debs in such a place? Anyway you could cd to the place where the deb is and install in by sudo apt ./program.deb. apt would fix the dependencies automatically. – Pilot6 Jun 07 '20 at 15:32
  • @Pilot6 I've moved to directory with my .deb and run sudo apt ./program.deb. It shows me error Invalid operation ./program.deb Then I changed to sudo apt install ./program.deb and now I'm experiencing the same issue like in my first post. But sudo dpkg -i /myprogram.deb works fine – Serp Jun 07 '20 at 15:57
  • I've recently saw "Reading package lists... Error! E: Could not read meta data". The issue was that I had apt build w/out some non-essential libraries, adding and rebuilding helped. Also w/out those libraries helped to copy file to /var/cache/apt/archives and running sudo apt-get install --assume-yes --no-install-recommends /var/cache/apt/archives/*.deb – Alex Martian Feb 12 '23 at 08:40

2 Answers2

2

When installing local DEB packages, you should use dpkg instead of apt, since apt is designed for installing packages from the remote repositories. To install your package with dpkg, use the following command:

sudo dpkg -i /path/to/my/package.deb

Replace /path/to/my/package.deb with the actual path of your own package.

In some cases, this command may fail with missing dependency errors. If this is the case, issue the following command:

sudo apt --fix-broken install

This will install the dependencies. After that, re-run the first dpkg command to install your package.

Alternatively, the program gdebi can be used instead of dpkg, since it has better resolution of dependencies without needing to apt --fix-broken install. To install gdebi, run this command:

sudo apt install gdebi-core

Now you can install your program directly using:

sudo gdebi /path/to/my/package.deb
Daniel M.
  • 1,903
  • 1
    apt installs local packages even better than dkpg. It resolves dependencies. – Pilot6 Jun 07 '20 at 15:07
  • @Daniel Massey Thank you. I made use dpkg it showed me dependency error. I've resolved this error with sudo apt-get install programm. Eventually I've installed my .deb with dpkg. Thanks again and other guys too. – Serp Jun 07 '20 at 15:15
  • apt takes case of (pre)-dependencies processing debs in proper order, dpkg does not. So sometimes for set of several debs which are one package to be installed with one go apt needed. – Alex Martian Feb 11 '23 at 20:33
1

If the myprogram directory is in you Home, then the path is wrong.

Run

sudo apt install ~/myprogram/program.deb
Pilot6
  • 90,100
  • 91
  • 213
  • 324