/usr/local/
사용할 파일을 추출하려고 합니다.
$ sudo tar -xvzf /home/vyom/Downloads/go1.19.4.linux-amd64.tar.gz -C /usr/local/
tar (child): gzip: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
하지만 내가 액세스할 수 있는 디렉토리(예: - /home/vyom/abc
)를 변경하면 정상적으로 작동합니다.
$ tar -xvzf /home/vyom/Downloads/go1.19.4.linux-amd64.tar.gz -C /home/vyom/abc
go/test/typeparam/mdempsky/7.dir/b.go
go/test/typeparam/mdempsky/7.go
go/test/typeparam/mdempsky/8.dir/
go/test/typeparam/mdempsky/8.dir/a.go
go/test/typeparam/mdempsky/8.dir/b.go
go/test/typeparam/mdempsky/8.go
go/test/typeparam/mdempsky/9.go
go/test/typeparam/metrics.go
go/test/typeparam/min.go
....
gzip
부족하지도 않아요
$ gzip --version
gzip 1.12
Copyright (C) 2018 Free Software Foundation, Inc.
Copyright (C) 1993 Jean-loup Gailly.
This is free software. You may redistribute copies of it under the terms of
the GNU General Public License <https://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.
Written by Jean-loup Gailly.
편집하다:
이에 대해 몇 가지 정보를 얻은 후 secure_path
확인했습니다.
$ echo $PATH
/home/vyom/.sdkman/candidates/groovy/current/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/lib/jvm/java-17-openjdk-17.0.5.0.8-1.fc37.x86_64/bin:/usr/local/go/bin
$ sudo cat /etc/sudoers | grep "secure_path"
Defaults secure_path = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/var/lib/snapd/snap/bin
안전한 경로에는 모든 폴더가 포함 되어 */bin
있지만 .-E env "PATH=$PATH"
sudo
$ sudo sudo -V | grep "Value to override user's"
Value to override user's $PATH with: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/var/lib/snapd/snap/bin
관련 내용의 출처는 다음과 같습니다./etc/sudoers
Defaults !visiblepw
Defaults always_set_home
Defaults match_group_by_gid
Defaults always_query_group_plugin
Defaults env_reset
Defaults env_keep = "COLORS DISPLAY HOSTNAME HISTSIZE KDEDIR LS_COLORS"
Defaults env_keep += "MAIL QTDIR USERNAME LANG LC_ADDRESS LC_CTYPE"
Defaults env_keep += "LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES"
Defaults env_keep += "LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE"
Defaults env_keep += "LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY"
Defaults secure_path = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/var/lib/snapd/snap/bin
여기에 문제가 있나요?