![為什麼 apt 不將軟體加入 PATH ?](https://rvso.com/image/1684224/%E7%82%BA%E4%BB%80%E9%BA%BC%20apt%20%E4%B8%8D%E5%B0%87%E8%BB%9F%E9%AB%94%E5%8A%A0%E5%85%A5%20PATH%20%EF%BC%9F%20.png)
我正在比較snap
和apt
安裝方法。首先我嘗試過snap
:
sudo apt update
- 我不確定,使用 snap 時更新和升級儲存庫是否有任何意義,但無論如何還是這麼做了sudo apt upgrade
sudo snap find kdenlive
- 確保有正確的按扣sudo snap install kdenlive
kdenlive
- 它啟動應用程式- 從 GUI 關閉應用程式
sudo snap remove kdenlive
sudo apt autoremove
- 不確定是否要與 snap 一起使用,但還是這麼做了
然後我繼續處理apt
函數:
sudo apt update
sudo apt upgrade
sudo apt list kdenlive
- 尋找 kdenlive pack,但這裡我不明白輸出sudo apt install kdenlive
kdenlive
- 導致錯誤 (bash: /snap/bin/kdenlive: No such file or directory
)./kdenlive
- 導致同樣的錯誤,我只能從 GUI 運行應用程式- 比我以與上面相同的方式卸載
那為什麼會發生這種情況呢?
答案1
你的 shell – bash – 保留路徑查找的記憶體快取。在您執行kdenlive
一次並且解析為後/snap/bin/kdenlive
,該特定的 shell 程序將直接地從那一點開始/snap/bin/kdenlive
,不管 $PATH 說什麼。
如果程式已從一個位置移動到另一個位置,則需要執行hash -r
或重新啟動 shell 才能使變更生效。