我最近安装了Ubuntu,我一直试图使用apt-get安装一些程序,但它似乎从来都不起作用,甚至apt-get更新也不起作用,下面是我尝试安装一些东西时得到的结果,在本例中:java的jdk-7使用:
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.
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)] 它只会被困在0%
编辑:是的,互联网在我的系统上运行得很好。
我尝试过的一件事是更改镜像服务器,它应该从镜像服务器检索/etc/apt/ archives.ubuntu.com中的包到/etc/apt/archives.ubuntu.com,但是它说该文件是只读的,我不能对它做任何更改。
我试着更新了
apt-get update 但每当我想这么做的时候,我都会得到它:
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?编辑:问题解决了,我没有使用sudo apt-get更新,而只是使用apt-get更新。
发布于 2013-05-08 17:54:40
apt-get命令需要根权限,因此您需要使用sudo运行它。例如:
sudo apt-get update然后,您可以安装您的软件包:
sudo apt-get install openjdk-7-jre-headlesshttps://askubuntu.com/questions/292658
复制相似问题