###### tags: `tutorials` `linux` `ubuntu` # Disable Ubuntu auto update and upgrade ## 禁止 ubuntu 自動更新 kernel ### 使用 `apt-mark` #### 鎖住 kernel ```bash= $ sudo apt-mark hold $(uname -r) ``` #### 檢視被鎖住的套件 ```bash= $ apt-mark showhold ``` #### 取消鎖定 kernel ```bash= $ sudo apt-mark unhold $(uname -r) ``` :::warning 更多相關指令用法請看 ```bash= ! $ apt-mark --help ``` ::: ## 禁止 ubuntu 自動更新套件 ```bash= ! $ sudo systemctl disable --now apt-daily{,-upgrade}.{timer,service} && sudo sed -i 's/APT::Periodic::Update-Package-Lists "1"/APT::Periodic::Update-Package-Lists "0"/' /etc/apt/apt.conf.d/20auto-upgrades ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up