Problemas ao instalar o NGINX no AWS Ubuntu 16.04 em um novo VPC

1

Eu criei um novíssimo Ubuntu 16.04 VPC e este foi o primeiro passo que dei, de acordo com o "como" postar do NGINX aqui em seu site. Eu não fiz nenhum outro passo antes disso depois que eu fiz o SSH, mas está me dando mensagens de erro.

ubuntu@ip-172-31-8-90:/$ sudo wget http://nginx.org/keys/nginx_signing.key
--2017-07-01 05:57:39--  http://nginx.org/keys/nginx_signing.key
Resolving nginx.org (nginx.org)... 206.251.255.63, 95.211.80.227, 
2001:1af8:4060:a004:21::e3, ...
Connecting to nginx.org (nginx.org)|206.251.255.63|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1561 (1.5K) [text/plain]
Saving to: ‘nginx_signing.key’

nginx_signing.key                                  100%[================================================================================================================>]   1.52K  --.-KB/s    in 0s      

2017-07-01 05:57:40 (323 MB/s) - ‘nginx_signing.key’ saved [1561/1561]

ubuntu@ip-172-31-8-90:/$ sudo apt-key add nginx_signing.key
OK
ubuntu@ip-172-31-8-90:/$ sudo nano /etc/apt/sources.list

Anexado source.list com

deb http://nginx.org/packages/ubuntu xenial nginx
deb-src http://nginx.org/packages/ubuntu xenial nginx

então

ubuntu@ip-172-31-8-90:/$ sudo apt-get update
Hit:1 http://us-west-1.ec2.archive.ubuntu.com/ubuntu xenial InRelease
Hit:2 http://us-west-1.ec2.archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:3 http://us-west-1.ec2.archive.ubuntu.com/ubuntu xenial-backports InRelease
Hit:4 http://nginx.org/packages/ubuntu xenial InRelease                         
Get:5 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Fetched 102 kB in 0s (136 kB/s)    
Reading package lists... Done
ubuntu@ip-172-31-8-90:/$ sudo apt-get install nginx
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  fontconfig-config fonts-dejavu-core libfontconfig1 libgd3 libjbig0 libjpeg-turbo8 libjpeg8 libtiff5 libvpx3 libxpm4 libxslt1.1 nginx-common nginx-core
Use 'sudo apt autoremove' to remove them.
The following packages will be upgraded:
  nginx
1 upgraded, 0 newly installed, 0 to remove and 30 not upgraded.
Need to get 0 B/786 kB of archives.
After this operation, 2,777 kB of additional disk space will be used.
(Reading database ... 51251 files and directories currently installed.)
Preparing to unpack .../nginx_1.12.0-1~xenial_amd64.deb ...
Unpacking nginx (1.12.0-1~xenial) over (1.10.3-0ubuntu0.16.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/nginx_1.12.0-1~xenial_amd64.deb (--unpack):
 trying to overwrite '/usr/share/nginx/html/index.html', which is also in package nginx-common 1.10.3-0ubuntu0.16.04.1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Processing triggers for man-db (2.7.5-1) ...
Errors were encountered while processing:
 /var/cache/apt/archives/nginx_1.12.0-1~xenial_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
    
por alilland 01.07.2017 / 20:32

1 resposta

0

Para corrigir seu problema, execute

sudo dpkg -i --force-overwrite /var/cache/apt/archives/nginx_1.12.0-1~xenial_amd64.deb

verifique se tudo está corrigido executando:

sudo apt-get -f install
    
por ADDB 01.07.2017 / 20:47