apt-get updateとapt-get Upgradeを組み合わせたエイリアスが正しく機能するかどうかはわかりません。

apt-get updateとapt-get Upgradeを組み合わせたエイリアスが正しく機能するかどうかはわかりません。

問題のエイリアスは次のとおりです。

alias update='sudo apt-get update'
alias upgrade='sudo apt-get upgrade'
alias upgrate='sudo apt-get update && sudo apt-get upgrade'

アップデート実行時の出力は次のとおりです。

[Wed Jul 08 20:47] gsw @ MacWoody:~ $ update
[sudo] password for gsw: 
Hit:1 http://security.debian.org/debian-security buster/updates InRelease
Hit:2 http://deb.debian.org/debian buster InRelease                              
Hit:3 http://deb.debian.org/debian buster-updates InRelease                      
Hit:4 https://dl.yarnpkg.com/debian stable InRelease                             
Ign:5 http://ppa.launchpad.net/djcj/screenfetch/ubuntu groovy InRelease          
Hit:6 http://repository.spotify.com stable InRelease
Err:7 http://ppa.launchpad.net/djcj/screenfetch/ubuntu groovy Release
  404  Not Found [IP: 91.189.95.83 80]
Reading package lists... Done
E: The repository 'http://ppa.launchpad.net/djcj/screenfetch/ubuntu groovy Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

アップグレード実行時の出力は次のとおりです。

[Wed Jul 08 20:47] gsw @ MacWoody:~ $ upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

これは、2つのプロセスを組み合わせる必要がある更新プログラムを実行したときの出力です。コマンドのアップグレード部分を実行していないようです。理由はよくわかりません。

[Wed Jul 08 20:48] gsw @ MacWoody:~ $ upgrate
Hit:1 http://security.debian.org/debian-security buster/updates InRelease
Hit:2 https://dl.yarnpkg.com/debian stable InRelease                             
Ign:3 http://ppa.launchpad.net/djcj/screenfetch/ubuntu groovy InRelease          
Hit:4 http://repository.spotify.com stable InRelease                
Hit:5 http://deb.debian.org/debian buster InRelease                      
Hit:6 http://deb.debian.org/debian buster-updates InRelease              
Err:7 http://ppa.launchpad.net/djcj/screenfetch/ubuntu groovy Release
  404  Not Found [IP: 91.189.95.83 80]
Reading package lists... Done
E: The repository 'http://ppa.launchpad.net/djcj/screenfetch/ubuntu groovy Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

アップグレード結果によれば、リポジトリのみを更新し、パッケージのアップグレードは進行しないようです。提供できるヘルプや情報に感謝します。ありがとうございます。

ベストアンサー1

&&つまり、次のコマンドは、前のコマンドがで終了した場合にのみ実行されます0

apt-get updateエラーが生成されるため、対応する戻りコードは実行され0ません。apt-get upgrade

解決策:

alias upgrate='sudo apt-get update; sudo apt-get upgrade'

おすすめ記事