piątek, 18 lutego 2011

Ubuntu: apt-get - how to install already installed package

Let's imagine a case where one has been removed by chance some files comes with one of deb packages installed with apt-get utility.

For sake of this example lets remove /usr/lib/php5/20060613/pdo_mysql.so file.

Now after Apache restart the following entry will appear in /var/log/apache2/error.log
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20060613/pdo_mysql.so' 
- /usr/lib/php5/20060613/pdo_mysql.so: cannot open shared object file: 
No such file or directory in Unknown on line 0

In this particular case is quite easy to guess which package pdo_mysql.so file comes with. But in general dpkg --search can help.

$ dpkg --search /usr/lib/php5/20060613/pdo_mysql.so
php5-mysql: /usr/lib/php5/20060613/pdo_mysql.so

Now we know for sure which packed needs to be installed again. To ask apt-get to install package which already is installed --reinstall option needs to be used.

sudo apt-get --reinstall install php5-mysql

Now pdo_mysql.so should be again on its place.

Brak komentarzy:

Prześlij komentarz