.

.

.

.

.

today LZ When running a program , Can't find so Database :

>$ ./core
./core: error while loading shared libraries: libudev.so.: cannot open shared object file: No such file or directory
>$

You can see it , core This program relies on a program called libudev.so The library of , But this library can't be found in the system , Then you need to install .

But if it passes apt-get If it's installed in the same way , Need to know libudev.so In which package .

So here comes the question , How to find one so Which package is the library in ?

adopt apt-file The command will look up .

First apt-file Orders don't look like apt-get command , It's not pre installed in the system , We need to install it manually :

>$ sudo apt-get install apt-file
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
curl libconfig-file-perl libregexp-assemble-perl
The following NEW packages will be installed:
apt-file curl libconfig-file-perl libregexp-assemble-perl
upgraded, newly installed, to remove and not upgraded.
Need to get kB of archives.
After this operation, kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get: http://cn.archive.ubuntu.com/ubuntu/ trusty-updates/main curl amd64 7.35.0-1ubuntu2.6 [123 kB]
Get: http://cn.archive.ubuntu.com/ubuntu/ trusty/universe libconfig-file-perl all 1.50-2 [10.1 kB]
Get: http://cn.archive.ubuntu.com/ubuntu/ trusty/universe libregexp-assemble-perl all 0.35-8 [81.2 kB]
Get: http://cn.archive.ubuntu.com/ubuntu/ trusty/universe apt-file all 2.5.2ubuntu1 [27.1 kB]
Fetched kB in 10s (22.2 kB/s)
Selecting previously unselected package curl.
(Reading database ... files and directories currently installed.)
Preparing to unpack .../curl_7.35.0-1ubuntu2.6_amd64.deb ...
Unpacking curl (7.35.-1ubuntu2.) ...
Selecting previously unselected package libconfig-file-perl.
Preparing to unpack .../libconfig-file-perl_1.-2_all.deb ...
Unpacking libconfig-file-perl (1.50-) ...
Selecting previously unselected package libregexp-assemble-perl.
Preparing to unpack .../libregexp-assemble-perl_0.-8_all.deb ...
Unpacking libregexp-assemble-perl (0.35-) ...
Selecting previously unselected package apt-file.
Preparing to unpack .../apt-file_2..2ubuntu1_all.deb ...
Unpacking apt-file (2.5.2ubuntu1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up curl (7.35.-1ubuntu2.) ...
Setting up libconfig-file-perl (1.50-) ...
Setting up libregexp-assemble-perl (0.35-) ...
Setting up apt-file (2.5.2ubuntu1) ...
The system-wide cache is empty. You may want to run 'apt-file update'
as root to update the cache. You can also run 'apt-file update' as
normal user to use a cache in the user's home directory.
>$

Install well apt-file You can't find it right after the tool , You have to update its index file first .

You can see from the tips above , Update index file must use root identity , So don't forget to use sudo command .

>$ sudo apt-file update
Downloading complete file http://cn.archive.ubuntu.com/ubuntu/dists/trusty/Contents-amd64.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
28.0M 28.0M :: :: --:--:--
Downloading complete file http://cn.archive.ubuntu.com/ubuntu/dists/trusty-updates/Contents-amd64.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
25.5M 25.5M :: :: --:--:--
Downloading Index http://cn.archive.ubuntu.com/ubuntu/dists/trusty/Contents-amd64.diff/Index:
No Index available.
Downloading complete file http://cn.archive.ubuntu.com/ubuntu/dists/trusty/Contents-amd64.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
28.0M --:--:-- --:--:-- --:--:--
File is up-to-date.
Downloading Index http://cn.archive.ubuntu.com/ubuntu/dists/trusty-updates/Contents-amd64.diff/Index:
No Index available.
Downloading complete file http://cn.archive.ubuntu.com/ubuntu/dists/trusty-updates/Contents-amd64.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
25.5M --:--:-- --:--:-- --:--:--
File is up-to-date.
Downloading Index http://cn.archive.ubuntu.com/ubuntu/dists/trusty/Contents-amd64.diff/Index:
No Index available.
Downloading complete file http://cn.archive.ubuntu.com/ubuntu/dists/trusty/Contents-amd64.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
28.0M --:--:-- --:--:-- --:--:--
File is up-to-date.
Downloading Index http://cn.archive.ubuntu.com/ubuntu/dists/trusty-updates/Contents-amd64.diff/Index:
No Index available.
Downloading complete file http://cn.archive.ubuntu.com/ubuntu/dists/trusty-updates/Contents-amd64.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
25.5M --:--:-- :: --:--:--
File is up-to-date.
Downloading complete file http://cn.archive.ubuntu.com/ubuntu/dists/trusty-backports/Contents-amd64.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
285k 285k :: :: --:--:--
Downloading complete file http://security.ubuntu.com/ubuntu/dists/trusty-security/Contents-amd64.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
22.6M 22.6M :: :: --:--:-- 100k
Downloading Index http://security.ubuntu.com/ubuntu/dists/trusty-security/Contents-amd64.diff/Index:
No Index available.
Downloading complete file http://security.ubuntu.com/ubuntu/dists/trusty-security/Contents-amd64.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
--:--:-- --:--:-- --:--:--
File is up-to-date.
Downloading Index http://security.ubuntu.com/ubuntu/dists/trusty-security/Contents-amd64.diff/Index:
No Index available.
Downloading complete file http://security.ubuntu.com/ubuntu/dists/trusty-security/Contents-amd64.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
--:--:-- --:--:-- --:--:--
File is up-to-date.
Ignoring source without Contents File:
http://extras.ubuntu.com/ubuntu/dists/trusty/Contents-amd64.gz
>$

Wait patiently for these packages to be updated , Then we can find the library we want . Fortunately, these index files are not very large , It won't take long to update .

Next use apt-file Command to find our so In which package in .

>$ sudo apt-file search libudev.so
libudev-dev: /usr/lib/x86_64-linux-gnu/libudev.so
libudev1: /lib/x86_64-linux-gnu/libudev.so.
libudev1: /lib/x86_64-linux-gnu/libudev.so.1.3.
>$

Originally LZ The search is libudev.so.0, But there was no search for , So we have to put the last .0 Get rid of it to search for a larger area .

In the search results , On the left is package, On the right is so The path of , So we found out package After passage apt-get Command to install it .

>$ sudo apt-get install libudev1
Reading package lists... Done
Building dependency tree
Reading state information... Done
libudev1 is already the newest version.
upgraded, newly installed, to remove and not upgraded.
>$

====================== Split line ====================

LZ My luck is always bad , use libudev.so.0 This library is not typical enough for chestnuts , Because this library is somewhat special , It can be seen from the above installation results , libudev1 The library was not installed successfully , Because it's already installed .

Now that we're running ./core The prompt in the program cannot be found libudev.so.0, And there's only one of our systems libudev.so.1, So just make a symbolic link .

>$ sudo ln -s /lib/x86_64-linux-gnu/libudev.so. /lib/x86_64-linux-gnu/libudev.so.
>$

In the vast majority of cases , adopt apt-file Command basis so Counter check the ownership of package, And then through apt-get Command to install this package That's all right. .

In a few cases , such as LZ In this case , We need some flexible means .

Ubuntu Inquire about so Attributable package More articles about

  1. With innocence ip database .dat File query ip ascription

    website :http://www.cz88.net/ After downloading and installing , There is this document : The installation path /ip/qqwry.dat When creating an instance, pass in the file path , You can call . /** * From innocence IP Address library query ip ascription * ...

  2. call webservice Search for the location of the mobile phone number

    Web Services It is an online application service released by an enterprise to fulfill its specific business needs , Other companies or applications can use Internet To access and use this online service . Here we use soap The agreement goes to webservice Send a message , however ...

  3. jquery Using Taobao interface to cross domain query mobile phone number home instance

    <h1> Mobile phone number ownership inquiry </h1>    <div class="outer">        <p> Please enter your mobile number </p& ...

  4. ubuntu Query about a library

    Environmental Science :Ubuntu 14.04 64bit 1. Such as : Inquire about libjpeg Location of the library ldconfig -p |grep libjpeg 2. Such as : Inquire about libjpeg The related name of the library dpkg -l '*jpeg ...

  5. Ubuntu Of Unable to locate package The source problem solution could not be updated

    https://blog.csdn.net/long19910605/article/details/47017889/ problem : When updating the source, you will be prompted that you cannot connect to the network (does the network require ...

  6. ubuntu Conduct apt-get When it comes to Package ssh is not available, but is referred to by another package error

    In today's ubuntu Conduct ssh During installation , The following error occurred . Reading package lists... Done Building dependency tree... Done Package s ...

  7. Ubuntu:Unable to locate package ***

    stay Ubuntu Upper use apt-get Encountered while installing package   Unable to locate package Information about Solution : A finer apt-get Then reinstall #sudo apt-get update   ...

  8. ubuntu Query the installation path of the software installed on the command line

    which git // Inquire about git Installation path for

  9. lookup Ubuntu The ownership of the next package

    It's making today docker when , I found that some of the packages my program depends on are not easy to find what to install . stay centos below , You can use the command : rpm -qf <libraryname> stay Ubuntu below , Find a website basic ...

Random recommendation

  1. 【BZOJ-2476】 The number of battlefields Matrix multiplication + Recurrence

    2476: The number of battlefields Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 58  Solved: 38[Submit][Status][Discuss] D ...

  2. SCRUM Process steps 2: Spring plan

    1. product backlog. 2.  Split the story further into tasks .   5. formation Sprint backlog. Scrum master Come on stage , Organize everyone according to SCRUM technological process , Step by step, work smoothly ...

  3. Map location IOS8 The positioning after that

    from ios8 Start , Apple has further strengthened the protection of users' privacy . When app When you want to access a user's privacy information   The system will no longer automatically pop up a dialog box for user authorization resolvent : (1) call ios8.0 Of API Actively request user authorization - (voi ...

  4. PHP socket Programming needs to understand some basic knowledge

    We talked about  fsockopen  All kinds of situations , It involves a lot of other knowledge , such as chunked Segmented transmission ,Keep-Alive,HTTP Additional knowledge such as header fields , If you know little about it , It will affect PHP Of sock ...

  5. Late WPF Study —— Routing events

    1. Understand routing events :WPF Through event routing (event routing) The concept enhances the ability and scope of traditional event execution , Allow events originating from one element to be raised by another , for example , Event routing allows a button on the toolbar to click on the event to be replaced ...

  6. new thoughts over function pointers

    Previous works do not relate to function pointers, but reading some documents reading and learning S ...

  7. UITableViewStyleGrouped Extra spacing in mode

    first section The excess space on the top // hide UITableViewStyleGrouped The extra space above _tableView.tableHeaderView = [[UIView alloc] ...

  8. Multiple vulnerabilities in DASAN H660RM GPON router firmware

    CVE-2019-9974: diag_tool.cgi on DASAN H660RM devices with firmware 1.03-0022 allows spawning ping pr ...

  9. maven Dynamic packaging function of

    about maven for , Packaging is a very important feature , It's not just a simple concept of compilation and packaging , It also supports various flexible packaging strategies through various plug-ins . Here is an example to show how to dynamically implement a web The packaging of the project : demand : Now it's time for a web project ...

  10. Use swagger Generate Flask RESTful API

    Use swagger Generate Flask RESTful API http://www.voidcn.com/article/p-rcvzjvpf-e.html swagger Official website https://swa ...