
Instalé Ubuntu recientemente y he estado intentando instalar algunos programas usando apt-get pero nunca parece funcionar, ni siquiera apt-get update funciona, esto es lo que obtengo cuando intento instalar algo, en este caso: jdk-7 de Java usando:
apt-get install openjdk-7-jre-headless
esto es lo que obtengo:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
linux-headers-3.2.0-29 linux-headers-3.2.0-29-generic-pae
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 24 not upgraded.
mkhas@mkhas-Inspiron-3520:~/Downloads$ sudo apt-get install openjdk-7-jre-headless
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
linux-headers-3.2.0-29 linux-headers-3.2.0-29-generic-pae
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
ca-certificates-java icedtea-7-jre-jamvm java-common openjdk-7-jre-lib tzdata-java
Suggested packages:
default-jre equivs sun-java6-fonts ttf-dejavu-extra fonts-ipafont-gothic
fonts-ipafont-mincho ttf-telugu-fonts ttf-oriya-fonts ttf-kannada-fonts
ttf-bengali-fonts
The following NEW packages will be installed:
ca-certificates-java icedtea-7-jre-jamvm java-common openjdk-7-jre-headless
openjdk-7-jre-lib tzdata-java
0 upgraded, 6 newly installed, 0 to remove and 24 not upgraded.
Need to get 44.1 MB of archives.
After this operation, 63.5 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
WARNING: The following packages cannot be authenticated!
openjdk-7-jre-lib ca-certificates-java tzdata-java java-common openjdk-7-jre- headless
icedtea-7-jre-jamvm
Install these packages without verification [y/N]? y
0% [Connecting to lb.archive.ubuntu.com (91.189.91.13)]
Y simplemente se queda atascado en 0%
Editar: Sí, Internet funciona bien en mi sistema.
Una cosa que intenté fue cambiar el servidor espejo desde el cual supuestamente recupera los paquetes de lb.archives.ubuntu.com a archives.ubuntu.com en /etc/apt/sources.list pero dice que ese archivo es de solo lectura y yo No puedo hacer ningún cambio.
Intenté actualizar apt-get through
apt-get update
pero me sale esto cada vez que intento hacer eso:
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
EDITAR: Problema resuelto, no estaba usando sudo apt-get update y solo estaba usando apt-get update
Respuesta1
El apt-get
comando requiere privilegios de root, por lo que debe ejecutarlo con sudo
. Por ejemplo:
sudo apt-get update
Luego puedes instalar tus paquetes:
sudo apt-get install openjdk-7-jre-headless