- Debian upgrade or update a single package using apt-get
- How to Debian upgrade or update a single package
- How to upgrade a single package using apt-get?
- Conclusion
- Ubuntu upgrade or update a single package using apt-get
- How to Ubuntu upgrade or update a single package
- How to upgrade a single package using apt-get?
- Examples
- Conclusion
Debian upgrade or update a single package using apt-get
How to Debian upgrade or update a single package
The procedure to update a a specific package on Debian:
- Open the Terminal application by visiting menus in the GUI
- Update package index by running sudo apt update command
- Now only update nginx package by running sudo apt install nginx command.
- If nginx package already installed it will try to update to the latest version. If you do not want to install new packages; when used in conjunction with install, only-upgrade will install upgrades for already installed packages only and ignore requests to install new packages. Try sudo apt —only-upgrade install nginx
Let us see all commands in details for Debian Linux 6.x/7.x/8.x/9.x server.
How to upgrade a single package using apt-get?
As usual you need to fetch an updated index from the Internet:
$ sudo apt-get update
Sample outputs:
- No ads and tracking
- In-depth guides for developers and sysadmins at Opensourceflare✨
- Join my Patreon to support independent content creators and start reading latest guides:
- How to set up Redis sentinel cluster on Ubuntu or Debian Linux
- How To Set Up SSH Keys With YubiKey as two-factor authentication (U2F/FIDO2)
- How to set up Mariadb Galera cluster on Ubuntu or Debian Linux
- A podman tutorial for beginners – part I (run Linux containers without Docker and in daemonless mode)
- How to protect Linux against rogue USB devices using USBGuard
Join Patreon ➔
You need to use following format with the apt-get command:
$ sudo apt-get —only-upgrade install Package
$ sudo apt-get install Package
Let us try to upgrade apache2 web server:
$ sudo apt-get install apache2
If apache2 package is already installed it will try to update to latest version:
However, the following will not install a new nginx package if not installed:
$ sudo apt-get —only-upgrade install apache2
In this following example, apache2 is installed and I am requesting update. However, nginx package not installed on a Debian and I am still requesting an update for it:
$ sudo apt-get install apache2
$ sudo apt-get —only-upgrade install nginx
Conclusion
You learned how to update a specific package on Debian Linux based system or server. Please note that you need to pass the —only-upgrade to the apt command when you only want that single package upgrade provided that it is installed. See apt man page here for more info.
🐧 Get the latest tutorials on Linux, Open Source & DevOps via
Источник
Ubuntu upgrade or update a single package using apt-get
How to Ubuntu upgrade or update a single package
The procedure to update a a specific package on Ubuntu:
- Open the Terminal application
- Fetch package index by running sudo apt update command
- Now only update apache2 package by running sudo apt install apache2 command.
- If apache2 package already installed it will try to update to the latest version. If you do not want to install new packages; when used in conjunction with install, only-upgrade will install upgrades for already installed packages only and ignore requests to install new packages. Try sudo apt —only-upgrade install apache2
Let us see all commands and examples in details.
How to upgrade a single package using apt-get?
As usual you need to fetch an updated index from the Internet:
$ sudo apt-get update
You need to use following format with the apt-get command/apt command:
$ sudo apt-get —only-upgrade install Package
$ sudo apt-get install Package
Let us try to upgrade nginx web server:
$ sudo apt-get install nginx
If nginx package is already installed it will try to update to latest version:
However, the following will not install a new nginx package if not installed:
$ sudo apt-get —only-upgrade install nginx
In this following example, htop is installed and I am requesting update. However, atop not installed and I am still requesting an update for it:
$ sudo apt-get install htop
$ sudo apt-get —only-upgrade install atop
Examples
First, download package information from all configured source:
$ sudo apt-get update
Run the to see availble updates:
$ sudo apt list —upgradable
- No ads and tracking
- In-depth guides for developers and sysadmins at Opensourceflare✨
- Join my Patreon to support independent content creators and start reading latest guides:
- How to set up Redis sentinel cluster on Ubuntu or Debian Linux
- How To Set Up SSH Keys With YubiKey as two-factor authentication (U2F/FIDO2)
- How to set up Mariadb Galera cluster on Ubuntu or Debian Linux
- A podman tutorial for beginners – part I (run Linux containers without Docker and in daemonless mode)
- How to protect Linux against rogue USB devices using USBGuard
Join Patreon ➔
We have 9 updates available but we are just going to update ppp package:
$ sudo apt-get —only-upgrade install ppp
## OR ##
$ sudo apt —only-upgrade install ppp
Conclusion
You learned how to update a specific package on Ubuntu Linux. Please note that you need to pass the —only-upgrade to the apt command when you only want that single package upgrade provided that it is installed. See apt/apt-get man page online here for more information or type the following man command:
$ man apt
$ man apt-get
🐧 Get the latest tutorials on Linux, Open Source & DevOps via
Источник