when i want to update or install any package i got this error:
for example : whealln i exec this sudo apt upgrade or sudo apt install zsh
dpkg: error processing package linux-image-4.15.0-20-generic (--remove):
installed linux-image-4.15.0-20-generic package post-removal script subprocess returned error exit status 1
Errors were encountered while processing:
linux-image-4.15.0-20-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
how to fix it?
These commands should hopefully work. They will do a full clean and reinstall.
sudo apt-get autoremove
sudo apt-get --purge remove && sudo apt-get autoclean
sudo apt-get -f install
sudo apt-get update
sudo apt-get upgrade && sudo apt-get dist-upgrade
sudo dpkg-reconfigure -a
sudo dpkg --configure -a
Related
These commands are pulled from this site: https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver16#ubuntu18
sudo su
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list > /etc/apt/sources.list.d/mssql-release.list
exit
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18
# optional: for bcp and sqlcmd
sudo ACCEPT_EULA=Y apt-get install -y mssql-tools18
echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc
source ~/.bashrc
# optional: for unixODBC development headers
sudo apt-get install -y unixodbc-dev
These are Microsoft's official steps to install ODBC drivers on Ubuntu. I am not too familiar with Linux, so I do not know if using the deprecated apt-key commands will cause me any issues in the future. Could someone let me know if this is a reasonable concern? And if it is, what is the best practice to make my environment more stable for the future?
Thanks
I am basing myself on this guide: https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver15#ubuntu18
Which gives the commands>
if ! [[ "18.04 20.04 21.04" == *"$(lsb_release -rs)"* ]];
then
echo "Ubuntu $(lsb_release -rs) is not currently supported.";
exit;
fi
sudo su
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list > /etc/apt/sources.list.d/mssql-release.list
exit
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18
# optional: for bcp and sqlcmd
sudo ACCEPT_EULA=Y apt-get install -y mssql-tools18
echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc
source ~/.bashrc
# optional: for unixODBC development headers
sudo apt-get install -y unixodbc-dev
But I keep getting the following errors
root#ip-172-31-80-13:/home/ubuntu# sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package msodbcsql18
root#ip-172-31-80-13:/home/ubuntu# # optional: for bcp and sqlcmd
root#ip-172-31-80-13:/home/ubuntu# sudo ACCEPT_EULA=Y apt-get install -y mssql-tools18
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package mssql-tools18
I have tested on a new instance and I get the same error
Does anyone successfully install pdo_sqlsrv in ubuntu php 7.2.9 environment? I only see sqlsrv on phpinfo(), pdo_sqlsrv always installed fail. Thank you very much.
I found an afternoon and finally found a solution.
The file 30-pdo_sqlsrv.ini in /etc/php/7.2/cli/conf.d ,
copy to /etc/php/7.2/apache2 , it work !!
curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get -y install msodbcsql17 mssql-tools
sudo apt-get -y install unixodbc-dev
sudo apt-get -y install gcc g++ make autoconf libc-dev pkg-config
sudo apt-get install php-pear php7.2-dev
sudo pecl install sqlsrv
sudo pecl install pdo_sqlsrv
printf "; priority=20\nextension=sqlsrv.so\n" > /etc/php/7.2/mods-available/sqlsrv.ini
printf "; priority=30\nextension=pdo_sqlsrv.so\n" > /etc/php/7.2/mods-available/pdo_sqlsrv.ini
phpenmod -v 7.2 sqlsrv pdo_sqlsrv
a2enmod mpm_prefork
a2enmod php7.2
service apache2 restart
Can you tell me how can i uninstall nagios and NRPE.
I have tried this command to uninstall NRPE:
sudo apt-get remove nagios-nrpe-server
but when I execute this command it's display to me the version of Nrpe installed
./check_nrpe -H localhost
Thank you in advance
Follow these steps in given order.
1. sudo apt-get remove nagios-nrpe-server
2. sudo apt-get remove --auto-remove nagios-nrpe-server
3. sudo apt-get purge nagios-nrpe-server
4. sudo apt-get purge --auto-remove nagios-nrpe-server
Reboot your machine ,hope this solves your issue.
Simply remove all the nagios packages by:
sudo apt-get remove nagios*
sudo apt-get build-dep octave is not working. The error message is "E: Build-Depends dependency for octave cannot be satisfied because the package automake cannot be found". I have modified the /etc/apt/sources.list file with deb replaced by deb-src. Even when I try sudo apt-get install octave, an error is displayed that the package is not located.
Octave packages http://wiki.octave.org/Octave_for_Debian_systems
Many Octave packages are also distributed by your Linux distribution. These are tested to work the best with your Octave version. For example:
sudo apt-get install octave-control octave-image octave-io octave-optim octave-signal octave-statistics
Octave's Personal Package Archive (PPA) for Ubuntu
sudo apt-add-repository ppa:octave/stable
sudo apt-get update
sudo apt-get install octave
Or
sudo apt-get autoclean
You can also Try with
wget ftp://ftp.gnu.org/gnu/octave/octave-4.0.0.tar.bz2
tar -xvf octave-4.0.0.tar.bz2
cd octave-4.0.0
./configure
make
sudo make install
More version are available at ftp://ftp.gnu.org/gnu/octave
Or
Adding a line to your /etc/apt/sources.list
amd64: http://packages.ubuntu.com/trusty/amd64/libgraphicsmagick3/filelist
i386: http://packages.ubuntu.com/trusty/i386/libgraphicsmagick3/download