运行以下命令时我遇到此错误
wget http://us.mirrors.quenda.co/apache/maven/maven-3/3.6.0/binaries/apache-maven-3.6.0-bin.zip -O apache-maven-3.6.0.zip
apache-maven-3.6.0.zip: Permission denied
答案1
这是因为您位于当前用户不可写入的目录中。
尝试一下这个。你会发现应用程序已下载并保存到你的桌面。
cd ~/Desktop/
wget http://us.mirrors.quenda.co/apache/maven/maven-3/3.6.0/binaries/apache-maven-3.6.0-bin.zip -O apache-maven-3.6.0.zip
例子:
在我的主目录中,下载成功:
subroot@subroot:~$ wget http://us.mirrors.quenda.co/apache/maven/maven-3/3.6.0/binaries/apache-maven-3.6.0-bin.zip -O apache-maven-3.6.0.zip
--2019-05-15 11:06:47-- http://us.mirrors.quenda.co/apache/maven/maven-3/3.6.0/binaries/apache-maven-3.6.0-bin.zip
Resolving us.mirrors.quenda.co (us.mirrors.quenda.co)... 108.61.245.101, 2001:19f0:a:5::28a6
Connecting to us.mirrors.quenda.co (us.mirrors.quenda.co)|108.61.245.101|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9102386 (8.7M) [application/zip]
Saving to: ‘apache-maven-3.6.0.zip’
apache-maven-3.6.0.zip 100%[================================================================================>] 8.68M 1.59MB/s in 13s
2019-05-15 11:07:01 (700 KB/s) - ‘apache-maven-3.6.0.zip’ saved [9102386/9102386]
subroot@subroot:~$
但是如果我更改到根文件夹,/
我就无法下载,因为我没有写入该文件夹的权限。
subroot@subroot:~$ cd /
subroot@subroot:/$ wget http://us.mirrors.quenda.co/apache/maven/maven-3/3.6.0/binaries/apache-maven-3.6.0-bin.zip -O apache-maven-3.6.0.zip
apache-maven-3.6.0.zip: Permission denied
subroot@subroot:/$