不确定结合 apt-get update 和 apt-get Upgrade 的别名是否正常工作

Inv*_*Vim 3 alias apt upgrade software-updates

以下是有问题的别名:

\n
alias update='sudo apt-get update'\nalias upgrade='sudo apt-get upgrade'\nalias upgrate='sudo apt-get update && sudo apt-get upgrade'\n
Run Code Online (Sandbox Code Playgroud)\n

这是我运行更新时的输出:

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

这是我运行升级时的输出:

\n
[Wed Jul 08 20:47] gsw @ MacWoody:~ $ upgrade\nReading package lists... Done\nBuilding dependency tree       \nReading state information... Done\nCalculating upgrade... Done\n0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.\n
Run Code Online (Sandbox Code Playgroud)\n

这是我运行 update 时的输出,它应该结合两个进程。在我看来,它好像没有执行命令的升级部分,我不确定为什么:

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

根据upgrate的输出,看起来好像它\xe2\x80\x99只更新存储库,但不继续升级包。感谢您提供的任何帮助或信息,谢谢

\n

Pan*_*nki 6

&&意味着只有前一个命令以 . 退出时,以下命令才会运行0

由于apt-get update会产生错误,因此它的返回代码不会0- 因此apt-get upgrade不会被执行。

解决方法:

alias upgrate='sudo apt-get update; sudo apt-get upgrade'
Run Code Online (Sandbox Code Playgroud)