You are not logged in.
Pages: 1
I use apt-file to find which package contains a given file. This is extremely handy and sometimes is the only way I know to get such information.
While apt-file works flawlessly in Debian Jessie, in Devuan Jessie apt-file cannot find what it needs to build its cache:
bruno@devuan:~$ sudo apt-file update
Ignoring source without Contents File:
http://us.mirror.devuan.org/merged/dists/jessie/main/Contents-amd64.gz
Ignoring source without Contents File:
http://us.mirror.devuan.org/merged/dists/jessie-security/main/Contents-amd64.gz
Ignoring source without Contents File:
http://us.mirror.devuan.org/merged/dists/jessie-updates/main/Contents-amd64.gz
bruno@devuan:~$ apt-file search foo
E: The cache is empty. You need to run 'apt-file update' first.
Is this a problem on my end or is something missing from Devuan's repositories? It seems more likely to be the latter. If it's a repository problem as I suspect, does anyone know whether there are plans to add the missing "Contents Files" to Devuan's repositories? Thanks!
Last edited by GNUser (2017-03-25 11:23:12)
Offline
This is a known issue.
Online
Oops, my bad. Sorry for missing that.
Offline
No worries. Welcome to the forum btw!
Online
Thank you. I'm very happy to be part of this new community--it's truly an island of sanity. I have no interest in making my system orders of magnitude more complex so that I can (maybe) shave a few seconds off my boot time. When it comes to my OS, I'll take something I can more easily understand and control over something new and (supposedly) faster *anyday* Long live Devuan!
Last edited by GNUser (2017-03-18 15:18:07)
Offline
I was chrooting into an old wheezy installation to run apt-file until someone showed me these:
To find what package a file comes from:
dpkg -S <file>
To find what files come with a package:
dpkg -L <package>
Offline
Could you possibly add that to your Package manager magic incantations? And while you're there would be nice to have code tags around the commands.
Online
Very nice, but has one drawback: "dpkg -S" can only search the contents of packages that are already installed on the system. If the purpose of the search is to determine which package to install, "dpkg -S" isn't going to help.
Last edited by GNUser (2017-03-21 18:32:02)
Offline
Here's a robust workaround for the time being:
1. On a Debian Jessie system:
$ sudo apt-file update
2. Copy /var/cache/apt/apt-file directory from Debian to Devuan
3. Copy /etc/apt/sources.list from Debian to Devuan, renaming it /etc/apt/debian-sources.list in Devuan so it doesn't conflict with Devuan's "real" sources.list
4. Put this in your ~/.bashrc:
alias apt-file='apt-file --sources-list /etc/apt/debian-sources.list'
Now apt-file searches work as expected, regardless of whether the package containing the file is already installed on your system or not. We're obviously searching through Debian's packages, but 99% of the time it'll be close enough. Just make sure to run apt-file as regular user, since regular user is the one who has the alias:
$ apt-file search foo
Offline
Thank you for that gem! I've been missing apt-file for a long time.
Slight modification: I didn't copy the cache file. I copied the debian sources.list to my user's home and ran 'apt-file -s sources.list update' and it put an apt-file directory in ~/.cache.
Offline
Hats off, fsmithred. Your modification is much more elegant. Very nice.
Offline
Here's a robust workaround for the time being
Its robustness was short-lived as that option to apt-file no longer exists.
Offline
GNUser wrote:Here's a robust workaround for the time being
Its robustness was short-lived as that option to apt-file no longer exists.
More information as to why not would be helpful. Perhaps it was PEBKAC . . .
Online
Count_Cucaracha wrote:GNUser wrote:Here's a robust workaround for the time being
Its robustness was short-lived as that option to apt-file no longer exists.
More information as to why not would be helpful. Perhaps it was PEBKAC . . .
that "workaround" wont help, because it searches the contents of the copied apt-file caches and uses the Debian repos, NOT the Devuan repos and caches created from them.
https://dev1galaxy.org/viewtopic.php?id=2291
looks for "dir/Content-_arch_.gz" instead of "dir/binary-_arch_/Packages.gz"
Cheers
Paul
Offline
there is now a 100% solution, no patch needed the Devuan Jessie repos
EDIT: in fact after a quick check it turns out @golinux is right, there is no issue with the original script IF your repo points to deb.devuan.org:
https://dev1galaxy.org/viewtopic.php?pid=11397#p11397
Last edited by paulwratt (2018-08-19 13:47:04)
Offline
If there is not already a bug report please submit one at bugs.devuan.org
Online
If there is not already a bug report please submit one at bugs.devuan.org
I edited the other thread and the above post to reflect the situation.
Offline
Pages: 1