Howtodojo logo
  • Home 
  • About 
  • Certifications 
  • Sample Database 
  • Cheatsheet 
  • Glossary 
  • Blog 
  • Tags 
  1.   Blog
  1. Home
  2. Blog
  3. yum whatprovides apt alternatives

yum whatprovides apt alternatives

Share via
Howtodojo
Link copied to clipboard

If you're using rpm based Linux distribution, most likely you're familiar with `yum whatprovides` command. Using this command we can search which packages provides a specific file. In Ubuntu or Debian-based Linux distribution we can also do similar action using dpkg and apt-file.

On this page
Searching File Using dpkg -S   Searching File Using apt-file   Install apt-file   Update apt-file database   Search file using apt-file  
yum whatprovides apt alternatives

If you’re using rpm based Linux distribution, most likely you’re familiar with yum whatprovides command. Using this command we can search which packages provides a specific file.

In Ubuntu or Debian-based Linux distribution we can also do similar action using dpkg and apt-file.

Searching File Using dpkg -S  

To get which packages provides a specific file we can use dpkg command using -S option. We only need to provide the file name that we want to search.

For example we can search which package providing lscpu using command below.

$ dpkg -S lscpu
util-linux: /usr/share/man/man1/lscpu.1.gz
util-linux: /usr/share/bash-completion/completions/lscpu
util-linux: /usr/bin/lscpu

Searching File Using apt-file  

Install apt-file  

If apt-file is not installed on your system yet, you can use command below to install apt-file

sudo apt-get install apt-file

Update apt-file database  

After installing apt-file we need to update apt-file database using command below

sudo apt-file update

Search file using apt-file  

To search the same file lscpu using apt-file command below

$ apt-file search lscpu
fish-common: /usr/share/fish/completions/lscpu.fish
manpages-de: /usr/share/man/de/man1/lscpu.1.gz
manpages-fr-extra: /usr/share/man/fr/man1/lscpu.1.gz
manpages-pl: /usr/share/man/pl/man1/lscpu.1.gz
util-linux: /usr/bin/lscpu
util-linux: /usr/share/bash-completion/completions/lscpu
util-linux: /usr/share/man/man1/lscpu.1.gz

To search for a specific file we can use a full / absolute path of the file. For example

$ apt-file search /usr/bin/lscpu
util-linux: /usr/bin/lscpu  

I hope this will be useful for you. Until next time.

 How To Install Postgresql 10 on Ubuntu 20.04
AWS Service Prefix (A Complete List) 
On this page:
Searching File Using dpkg -S   Searching File Using apt-file   Install apt-file   Update apt-file database   Search file using apt-file  
Follow me

We publish tutorials, tips and tricks about Linux, open source, cloud computing, and infrastructure

     
Copyright © 2012 - 2025 howtodojo.com. |
Howtodojo
Code copied to clipboard