Error installing NGINX package on ubuntu 18.04
5,630
You already have nginx installed so you have to remove that version to be able to build and install from source.
Check for the new install of nginx and remove it
dpkg -l nginx*
- You should see the version
1.14.2
, remove it withsudo dpkg remove nginx-1.14.2
, and be sure you use the right version number.
- You should see the version
Now do
sudo apt update
andsudo apt upgrade
to make sure they are no issues.Now remove the old version
sudo apt purge <nginx-1.14.0>
- Now build that new version and install and if any issues run
sudo apt install -f
Related videos on Youtube
Author by
sachin makwana
Updated on September 18, 2022Comments
-
sachin makwana over 1 year
I am new to Ubuntu. I need to enable brotli compression on nginx server.
I am trying to install NGINX with BROTLI from the below link. https://www.howtoforge.com/tutorial/how-to-install-nginx-with-brotli-compression-on-ubuntu-1804/
when I am trying to install build package as per the link I am getting error.
root@sachin-virtual-machine:/usr/local/src# ls nginx-1.14.2 nginx_1.14.2-1~bionic.dsc nginx_1.14.2-1~bionic_amd64.buildinfo nginx_1.14.2.orig.tar.gz nginx_1.14.2-1~bionic_amd64.changes nginx-dbg_1.14.2-1~bionic_amd64.deb nginx_1.14.2-1~bionic_amd64.deb ngx_brotli nginx_1.14.2-1~bionic.debian.tar.xz root@sachin-virtual-machine:/usr/local/src# sudo dpkg -i *.deb dpkg: regarding nginx_1.14.2-1~bionic_amd64.deb containing nginx: nginx conflicts with nginx-common nginx-common (version 1.14.0-0ubuntu1.2) is present and installed. dpkg: error processing archive nginx_1.14.2-1~bionic_amd64.deb (--install): conflicting packages - not installing nginx (Reading database ... 175249 files and directories currently installed.) Preparing to unpack nginx-dbg_1.14.2-1~bionic_amd64.deb ... Unpacking nginx-dbg (1.14.2-1~bionic) over (1.14.2-1~bionic) ... dpkg: dependency problems prevent configuration of nginx-dbg: nginx-dbg depends on nginx (= 1.14.2-1~bionic); however: Version of nginx on system is 1.14.0-0ubuntu1.2. Version of nginx on system, provided by nginx-core:amd64, is <none>. dpkg: error processing package nginx-dbg (--install): dependency problems - leaving unconfigured Errors were encountered while processing: nginx_1.14.2-1~bionic_amd64.deb nginx-dbg root@sachin-virtual-machine:/usr/local/src#
Please guide me with this.
-
George Udosen over 5 yearsYou are trying to install a different version of nginx from the one installed on your system!
-
George Udosen over 5 yearsAre you not aware that you have nginx already installed? Remove that other installed version and then build and install from source!
-
user535733 over 5 yearsWhy are you using 'sudo' when you already seem to be root?
-
sachin makwana over 5 years@user535733 its just copy paste so forgot to remove sudo
-
-
sachin makwana over 5 yearsthis worked and I was able to install the package. but now I am getting following error.
root@sachin-virtual-machine:/etc/nginx# nginx -t nginx: [emerg] BIO_new_file("/etc/letsencrypt/live/nginx.hakase-labs.io/fullchain.pem") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/letsencrypt/live/nginx.hakase-labs.io/fullchain.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file) nginx: configuration file /etc/nginx/nginx.conf test failed
-
George Udosen over 5 yearsThis is a different question but do you have letsencrypt installed on nginx?
-
sachin makwana over 5 yearsNo it wasnt'. For the localhost I needed to generate and configure own-signed privatekey and certificate. I did it and website is working fine in local environment.