apt – TecAdmin https://tecadmin.net How to guide for System Administrator's and Developers Wed, 04 Jan 2023 10:46:50 +0000 en-US hourly 1 https://wordpress.org/?v=6.1.1 12 Apt Command Examples in Ubuntu & Debian Linux https://tecadmin.net/apt-command-in-linux/ https://tecadmin.net/apt-command-in-linux/#comments Tue, 03 Jan 2023 15:35:28 +0000 https://tecadmin.net/?p=33552 The apt command is one of the most powerful and versatile tools in the Linux operating system. It provides users with a powerful, yet easy-to-use, package management system that can be used to easily manage and install the software. With the apt command, users can quickly and easily search for, install, upgrade, and uninstall software [...]

The post 12 Apt Command Examples in Ubuntu & Debian Linux appeared first on TecAdmin.

]]>
The apt command is one of the most powerful and versatile tools in the Linux operating system. It provides users with a powerful, yet easy-to-use, package management system that can be used to easily manage and install the software. With the apt command, users can quickly and easily search for, install, upgrade, and uninstall software applications from their systems.

This guide provides a detailed overview of the apt command and explains how to use it to manage software on a Linux system. It explains the different commands and options available and outlines how to use them to manage software, resolve software dependencies, and keep your system running smoothly and efficiently.

The apt package manager is used in several Linux distributions, including:

  • Debian and its derivatives (such as Ubuntu and Linux Mint)
  • Kali Linux
  • Linaro
  • SteamOS

Updating Apt Index (apt update)

Before you can use the Apt package manager, you will need to update the package repositories. The package repositories are online databases that contain information about available packages. To update the package repositories, use the update command:

sudo apt update 

This will download the latest package information from the repositories.

Installing Packages (apt install)

By default, the Apt package manager will install the latest available version of a package. To install a package named `foo` type:

sudo apt install foo 

However, sometimes you may need to install a specific version of a package. To do this, use the = operator followed by the version number when installing the package. For example, to install version 1.2 of the package foo, run the following command:

sudo apt install foo=1.2 

Searching for a Package (apt search)

You can use the `apt search` command followed by the search string. For example, to search for packages related to the word “foo”, run the following command:

sudo apt search foo 

This will display a list of packages that match the keyword.

Keep Your System Up to Date (apt ugprade)

One of the most important best practices for managing packages with the Apt package manager is to keep your system up to date. New versions of packages are released regularly to fix bugs and security vulnerabilities. To update your system, use the upgrade command:

sudo apt upgrade 

This will upgrade all installed packages to their latest available version.

To upgrade a specific package, you should use the apt install command with the `--only-upgrade` option.

sudo apt --only-upgrade install foo 

This will install the latest version of the package only if it is already installed.

Downgrading a Package to a Previous Version

To downgrade a package to a previous version, use the install command with the = operator and the version number of the previous version. For example, to downgrade the package foo to version 1.2, run the following command:

sudo apt install foo=1.2 

Note that this will overwrite the current version of the package, so be sure to make any necessary backups before downgrading.

Remove Packages (apt remove)

You can use the `apt remove` command to remove specific packages. For example, to remove the package foo, run the following command:

sudo apt remove foo 

This will remove the package, but it will leave behind any dependencies that are still needed by other packages.

Removing Unused Dependencies (apt autoremove)

When you install a package, it may bring in other packages as dependencies. These dependencies are required for the package to function correctly. However, once you remove the package, these dependencies may no longer be needed. To remove these unused dependencies, use the autoremove command:

sudo apt autoremove 

This will remove any dependencies that are no longer needed by any installed packages.

Use Apt Pinning to Control Package Upgrades

Apt pinning allows you to control which packages are upgraded and when they are upgraded. This can be useful if you want to prevent a specific package from being upgraded to a newer version. To use Apt pinning, you will need to edit the /etc/apt/preferences file and add a pinning rule.

For example, to prevent the package foo from being upgraded, add the following line to the `/etc/apt/preferences` file:

Package: foo
Pin: version *
Pin-Priority: 1001

This will prevent the package foo from being upgraded, but it will still be updated if a security vulnerability is discovered.

Use Apt Snapshots to Roll Back Package Upgrades

Apt snapshots allow you to roll back package upgrades to a previous version if something goes wrong. To create a snapshot, use the apt-mark command to mark all installed packages as “manual”:

sudo apt-mark manual `apt-mark showmanual` 

Then, use the apt-get command to create a snapshot:

sudo apt-get install apt-rdepends 
sudo apt-rdepends -d --state-show=installed package_name > apt-snapshot.txt 

Replace “package_name” with your package name. This will create a snapshot file called apt-snapshot.txt that contains a list of all installed packages and their dependencies. To roll back to a previous snapshot, use the apt-get install command and specify the snapshot file:

sudo apt-get install --reinstall -y \
      -o APT::Get::ReInstall=true \
      -o APT::Get::Show-Upgraded=true \
      -o Debug::pkgProblemResolver=true \
      -f -V < apt-snapshot.txt 

Show Pacakge Information (apt show)

This command allows you to view all the information about a specific package, including its version, its dependencies, and more. With apt show, you can quickly find out what a certain package does, and whether it's right for your system. You can also check to make sure that you have the latest version of a package, or even downgrade it if necessary. So if you're a Linux user looking for detailed package information.

sudo apt show foo 

So if you're a Linux user looking for detailed package information, you can use `apt show` to find it quickly and easily.

Cleaning the Package Cache (apt clean)

The Apt package manager keeps a cache of all the packages that you have installed or downloaded. Over time, this cache can become large and take up a lot of disk space. To clean the package cache and free up disk space, use the clean command:

sudo apt clean 

This will remove all the packages from the cache that are no longer needed.

Conclusion

In this article, we covered some advanced techniques for using the Apt package manager. We showed you how to install a specific version of a package, upgrade all packages to their latest version, downgrade a package to a previous version, remove unused dependencies, and clean the package cache. These techniques can help you more effectively manage packages on your Linux system.

The post 12 Apt Command Examples in Ubuntu & Debian Linux appeared first on TecAdmin.

]]>
https://tecadmin.net/apt-command-in-linux/feed/ 1
How to Remove Packages from Ubuntu & Debian https://tecadmin.net/how-to-remove-packages-from-ubuntu/ https://tecadmin.net/how-to-remove-packages-from-ubuntu/#respond Sat, 17 Apr 2021 02:59:41 +0000 https://tecadmin.net/?p=25204 The APT (Advanced Package Tool) is a powerful package management tool for Debian based systems. It provides powerful command-line tool like “apt” or “apt-get”. Which is used to install, upgrade or remove a software package on your Debian system. In this tutorial, you will learn to how to uninstall or remove packages from a Ubuntu [...]

The post How to Remove Packages from Ubuntu & Debian appeared first on TecAdmin.

]]>
The APT (Advanced Package Tool) is a powerful package management tool for Debian based systems. It provides powerful command-line tool like “apt” or “apt-get”. Which is used to install, upgrade or remove a software package on your Debian system.

In this tutorial, you will learn to how to uninstall or remove packages from a Ubuntu or Debian Linux system.

How to Remove Packages via Command Line

You can use “apt” command line tool for removing packages from your system. For older version of operating systems use “apt-get” command with the same options.

Use one of the below options to remove, purge packages from system. Clean the cache files to remove unused software’s from the system.

Using remove option:

To remove a specific package, use the apt remove command:

sudo apt remove [package-name] 

This command prompts apt to scan through the installed applications and attempt to remove or repair any that are broken.

Using purge option:

The default remove command only deletes the software files from the system, but keep all the configuration files for safety purpose. In case of accidental deletion the configuration and data files are safe.

If you want to completely remove all the data, application and configuration files, use –purge option with the above command. like:

sudo apt remove ––purge [package-name] 

Using clean option:

Use this option with apt to delete all the cache files of deleted software from your system.

Also removes the apt package manager cache from system.

sudo apt clean 

Using autoremove option:

Most of the software’s installed the dependent packages on your system. Which you can see during the installation of any software on your system. But they still remains on your system after removing the original package your installed.

With the help of this command, you can remove orphaned dependencies from system

sudo apt autoremove 

Any users don’t feel comfert with command line can use the graphical interface to remove packages from system.

Uninstall Packages via Graphical Interface

The Desktop users can remove packages using the Ubuntu software center. The Ubuntu software center provides you a graphical interface for installation, update and removal of the packages from system.

Search for the Ubuntu software center under the applications and launch it.

Open Ubuntu Software Center

Go to the installed tab. Here you will find a list of all packages installed on your Ubuntu system. Find your package and click “Remove” button in front of the package name. See below image:

Remove package from Ubuntu

A confirmation dialog will appear here. Again click click to complete deletion.

Delete Software from Ubuntu

You may prompted for a sudo password of your account to complete the package removal process.

Conclusion

This tutorial describes a several ways to remove packages from a Ubuntu Linux systems.

The post How to Remove Packages from Ubuntu & Debian appeared first on TecAdmin.

]]>
https://tecadmin.net/how-to-remove-packages-from-ubuntu/feed/ 0
(Solved) apt-add-repository command not found – Ubuntu & Debian https://tecadmin.net/apt-add-repository-command-not-found-debian/ https://tecadmin.net/apt-add-repository-command-not-found-debian/#respond Mon, 09 Nov 2020 18:37:10 +0000 https://tecadmin.net/?p=23560 The apt-add-repository command is a symlink of the add-apt-repository command. Which is used to add third party PPA to our Ubuntu or Debian systems. This command comes under software-properties-common debian package. Which is not available under the minimal Ubuntu installation, but this package can be installed from default system repositories. If you found apt-add-repository command [...]

The post (Solved) apt-add-repository command not found – Ubuntu & Debian appeared first on TecAdmin.

]]>
The apt-add-repository command is a symlink of the add-apt-repository command. Which is used to add third party PPA to our Ubuntu or Debian systems.

This command comes under software-properties-common debian package. Which is not available under the minimal Ubuntu installation, but this package can be installed from default system repositories.

If you found apt-add-repository command not found error on your system, Follow this article to add this command to your system.

On Latest Ubuntu & Debian Version’s

The latest version of Ubuntu 20.10, 20.04, 18.04, 16.04 and Debian 10/9/8, apt-add-repository command utility is available under the software-properties-common package.

Open a terminal and execute following command:

sudo apt update 
sudo apt install software-properties-common 

That’s it. You can now use apt-add-repository command to add PPA’s.

Ubuntu 13.10/Debian 7 and Older Versions

The systems running with older versions like Ubuntu 13.10 or Debian 7 (Wheezy) or its earlier versions, Needed to install python-software-properties package to add apt-add-repository command.

sudo apt update 
sudo apt install python-software-properties 

Conclusion

This tutorial explained you to how to resolved the issue apt-add-repository command not found on your system.

The post (Solved) apt-add-repository command not found – Ubuntu & Debian appeared first on TecAdmin.

]]>
https://tecadmin.net/apt-add-repository-command-not-found-debian/feed/ 0
How to List Installed Repositories In Ubuntu & Debian https://tecadmin.net/view-installed-repositories-in-ubuntu/ https://tecadmin.net/view-installed-repositories-in-ubuntu/#respond Mon, 05 Oct 2020 15:28:12 +0000 https://tecadmin.net/?p=23056 A repository is the collection of packages for a Linux operating system. You can create a central repository containing the actual packages. Then configure your other systems to connect with the main repository. From where, you can install, update packages. The Ubuntu and other Debian based systems uses APT (Advanced Packages Tool) as package manager. [...]

The post How to List Installed Repositories In Ubuntu & Debian appeared first on TecAdmin.

]]>
A repository is the collection of packages for a Linux operating system. You can create a central repository containing the actual packages. Then configure your other systems to connect with the main repository. From where, you can install, update packages.

The Ubuntu and other Debian based systems uses APT (Advanced Packages Tool) as package manager. Apt keeps all the configuration files under /etc/apt directory.

This tutorial will help you to list all installed repositories under a Ubuntu or Debian based system via command line.

List Installed Repositories In Ubuntu

The remote repository references are configured in /etc/apt/sources.list file and all files under /etc/apt/sources.list.d/ directory.

Use the following command to list all the configured repositories on apt based system:

sudo grep -rhE ^deb /etc/apt/sources.list* 

You will see the output like below:

deb http://mirrors.digitalocean.com/ubuntu/ xenial main restricted
deb-src http://mirrors.digitalocean.com/ubuntu/ xenial main restricted
deb http://mirrors.digitalocean.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.digitalocean.com/ubuntu/ xenial-updates main restricted
deb http://mirrors.digitalocean.com/ubuntu/ xenial universe
deb-src http://mirrors.digitalocean.com/ubuntu/ xenial universe
.
.
.
deb http://security.ubuntu.com/ubuntu xenial-security universe
deb-src http://security.ubuntu.com/ubuntu xenial-security universe
deb http://security.ubuntu.com/ubuntu xenial-security multiverse
deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse

Alternatively, you can use apt-cache command to list all repositories. This command will provide also provide more details about the repository.

Let’s try below command:

sudo apt-cache policy 

Output:

Package files:
 100 /var/lib/dpkg/status
     release a=now
 500 http://ppa.launchpad.net/ondrej/php/ubuntu xenial/main amd64 Packages
     release v=16.04,o=LP-PPA-ondrej-php,a=xenial,n=xenial,l=***** The main PPA for supported PHP versions with many PECL extensions *****,c=main,b=amd64
     origin ppa.launchpad.net
 500 https://deb.nodesource.com/node_13.x xenial/main amd64 Packages
     release o=Node Source,n=xenial,l=Node Source,c=main,b=amd64
     origin deb.nodesource.com
.
.
.
 500 http://mirrors.digitalocean.com/ubuntu xenial/main amd64 Packages
     release v=16.04,o=Ubuntu,a=xenial,n=xenial,l=Ubuntu,c=main,b=amd64
     origin mirrors.digitalocean.com
Pinned packages:

Conclusion

In this tutorial, you have learned to find all the repositories configured on Ubuntu or Debian based system.

The post How to List Installed Repositories In Ubuntu & Debian appeared first on TecAdmin.

]]>
https://tecadmin.net/view-installed-repositories-in-ubuntu/feed/ 0
How to List All Packages Available in a Repository on Ubuntu https://tecadmin.net/list-all-packages-available-in-a-repository-on-ubuntu/ https://tecadmin.net/list-all-packages-available-in-a-repository-on-ubuntu/#respond Sun, 04 Oct 2020 06:19:14 +0000 https://tecadmin.net/?p=23051 APT or Advanced Package Tool is an software package used to install, update and remove packages on Debian based systems. It is the default package manager on Ubuntu and Debian based systems. The apt, apt-get and apt-cache are quickly used commands to manage packages and configuration on system. Apt don’t provide any command to list [...]

The post How to List All Packages Available in a Repository on Ubuntu appeared first on TecAdmin.

]]>
APT or Advanced Package Tool is an software package used to install, update and remove packages on Debian based systems. It is the default package manager on Ubuntu and Debian based systems. The apt, apt-get and apt-cache are quickly used commands to manage packages and configuration on system.

Apt don’t provide any command to list available package under the specific repository. But you can find the list from a cache file, which contains list of available package to that repository with other details.

This tutorial will help you to find all the available packages in a repository on Ubuntu and other Debian based systems.

Find Packages Details in Repository

Apt keeps all repository cache files under /var/lib/apt/lists directory. So, first update the apt cache on your system

sudo apt-get update 

Now, navigate to /var/lib/apt/lists directory. Then search for the file with the repository name, path and architecture, ends with _Packages in there name.

See the content of *_Packages to view details about all packages available under that repository.

List available packages in a repository on Ubuntu and Debian

To list the packages only available in file, execute below like:

grep -h -P -o "^Package: \K.*" /var/lib/apt/lists/ppa.launchpad.net_*_Packages | sort -u 

Conclusion

In this article, you have learned to find all the available packages in a specific repository.

The post How to List All Packages Available in a Repository on Ubuntu appeared first on TecAdmin.

]]>
https://tecadmin.net/list-all-packages-available-in-a-repository-on-ubuntu/feed/ 0
How to Solve an Expired Key (EXPKEYSIG) with Apt https://tecadmin.net/expired-key-expkeysig-with-apt/ https://tecadmin.net/expired-key-expkeysig-with-apt/#comments Fri, 01 Feb 2019 06:42:20 +0000 https://tecadmin.net/?p=18069 During the update of apt-cache or packages installation with the apt package manager, I get the signature expiration message (EXPKEYSIG 8C718D3B5072E1F5). This means that the gpg signature key is expired. Error Here is logs on my Debian 9 system: sudo apt update Hit:1 http://security.debian.org stretch/updates InRelease Get:2 http://repo.mysql.com/apt/debian stretch InRelease [19.2 kB] Hit:3 https://deb.nodesource.com/node_10.x stretch [...]

The post How to Solve an Expired Key (EXPKEYSIG) with Apt appeared first on TecAdmin.

]]>
During the update of apt-cache or packages installation with the apt package manager, I get the signature expiration message (EXPKEYSIG 8C718D3B5072E1F5). This means that the gpg signature key is expired.

Error

Here is logs on my Debian 9 system:

sudo apt update

Hit:1 http://security.debian.org stretch/updates InRelease
Get:2 http://repo.mysql.com/apt/debian stretch InRelease [19.2 kB]
Hit:3 https://deb.nodesource.com/node_10.x stretch InRelease
Err:2 http://repo.mysql.com/apt/debian stretch InRelease
  The following signatures were invalid: EXPKEYSIG 8C718D3B5072E1F5 MySQL Release Engineering 
Hit:4 https://packages.sury.org/php stretch InRelease
Ign:5 http://mirrors.digitalocean.com/debian stretch InRelease
Get:6 http://mirrors.digitalocean.com/debian stretch-updates InRelease [91.0 kB]
Hit:7 http://mirrors.digitalocean.com/debian stretch Release
Reading package lists... Done
...
...

Use the following command to list all keys configured for apt on your system.

sudo apt-key list

You will see the expired key like this.

Expired Key (EXPKEYSIG)

Solution:

Now, update the expired key by running the below command. Here 8C718D3B5072E1F5 is the key was expired on my system.

sudo apt-key adv --keyserver keys.gnupg.net --recv-keys 8C718D3B5072E1F5

You must change 8C718D3B5072E1F5 with the expired key on your system.

The post How to Solve an Expired Key (EXPKEYSIG) with Apt appeared first on TecAdmin.

]]>
https://tecadmin.net/expired-key-expkeysig-with-apt/feed/ 20
How to Upgrade Packages on Ubuntu via Command Line https://tecadmin.net/upgrading-ubuntu-packages-command-line/ https://tecadmin.net/upgrading-ubuntu-packages-command-line/#comments Wed, 05 Dec 2018 09:18:24 +0000 https://tecadmin.net/?p=17782 It is recommended for all Linux system users to keep packages up to date. All the Linux distributions provide security and package upgrades from time to time. You must keep the Ubuntu packages updated. This tutorial will help you to update the latest packages on a Ubuntu system. You can also apply only security updates [...]

The post How to Upgrade Packages on Ubuntu via Command Line appeared first on TecAdmin.

]]>
It is recommended for all Linux system users to keep packages up to date. All the Linux distributions provide security and package upgrades from time to time. You must keep the Ubuntu packages updated.

This tutorial will help you to update the latest packages on a Ubuntu system. You can also apply only security updates silently via the command line.

Update Ubuntu Packages

Use the ‘apt update‘ command to download the package information from all the configured sources from all repositories on your system.

sudo apt update 

Then run the upgrade command to upgrade currently installed packages to the latest available versions from the configured sources.

sudo apt upgrade 

Now, run the dist-upgrade which intelligently handles changing dependencies with new versions of packages. It also removes obsolete packages from your system.

sudo apt dist-upgrade 

Apply Security Updates Only

You may don’t like to update all the packages on your Ubuntu system. But we still recommend you apply security updates to your systems. These upgrades are highly recommended for the production system to keep them secure.

Use the unattended upgrade to silently install updates without user interaction on your Ubuntu system.

sudo apt install unattended-upgrades 

But, if you want to run an interactive installation or upgrade use the (-d) display parameter.

sudo apt install unattended-upgrades -d 

Conclusion

In this quick write-up, you have learned about upgrading packages on Ubuntu via the command line.

The post How to Upgrade Packages on Ubuntu via Command Line appeared first on TecAdmin.

]]>
https://tecadmin.net/upgrading-ubuntu-packages-command-line/feed/ 2
How to Add Apt Repository In Ubuntu & Debian https://tecadmin.net/add-apt-repository-ubuntu/ https://tecadmin.net/add-apt-repository-ubuntu/#comments Fri, 20 Apr 2018 15:04:40 +0000 https://tecadmin.net/?p=15851 An APT repository is a collection of software packages that are available for download and installation on a computer running the Ubuntu operating system. The Ubuntu software repository is a great example of an APT repository. It contains thousands of software packages that are available for download and installation on Ubuntu. In this article, we’ll [...]

The post How to Add Apt Repository In Ubuntu & Debian appeared first on TecAdmin.

]]>
An APT repository is a collection of software packages that are available for download and installation on a computer running the Ubuntu operating system. The Ubuntu software repository is a great example of an APT repository. It contains thousands of software packages that are available for download and installation on Ubuntu. In this article, we’ll show you how to add an APT repository to your Ubuntu system. We’ll also show you how to search for and install software packages from the repository.

What is an APT repository?

An APT repository is a collection of software packages that are available for download and installation on a computer running the Ubuntu operating system. The software packages in an APT repository are called packages for historical reasons. A package is one or more files containing the software instructions (source code) and data needed to run that software, along with information about how the package can be installed. The package is handed over to a computer program called a package manager, which installs the package on the computer and manages the software’s installation and uninstallation.

The Ubuntu software repository is a great example of an APT repository. It contains thousands of software packages that are available for download and installation on Ubuntu.

Method 1 – Add Repository with add-apt-repository

You you can use Ubuntu software center or the command line interface (CLI) to add the repository. To use the CLI to add a repository, open a Terminal window and then enter the following command at the prompt:

sudo add-apt-repository ppa:libreoffice/ppa 

You can fixed error add-apt-repository command not found if occurred.

For other hosted repositories, can be also configured by providing its reference as below:

sudo add-apt-repository 'deb http://archive.getdeb.net/ubuntu wily-getdeb games' 

Method 2 – By Creating Repository Files

You can just create a file in /etc/apt/sources.list.d directory. The file name must end with a .list extension. The apt package manager also reads repository configuration files from here.

For example:

sudo vim /etc/apt/sources.list.d/games.list 

Add the repository paths as below.

deb http://archive.getdeb.net/ubuntu wily-getdeb games

It’s good to use one repository per file but you can add multiple repository references in a single file as much as required.

How to Remove APT Repository in Ubuntu?

You can remove an APT repository from your Ubuntu system if you decide that you don’t want to use it. However, if you remove a default APT repository, you will not be able to install software from it.

You can remove an APT repository using the Ubuntu Software application or the CLI. To use the CLI to remove a repository, open a Terminal window and then enter the following command at the prompt:

sudo add-apt-repository --remove ppa:libreoffice/ppa  

If you have created a file under /etc/apt/sources.list.d directory, then remove it manually.

Conclusion

The APT repository is a great way to install and update software on your Ubuntu computer. If a software package that you need is not available from the default repositories, you can add an APT repository to your system and install the package from it. Apt Repositories allow software developers to publish their applications so that anyone who uses the Ubuntu operating system can install them. Anyone can create and publish an APT repository, and Ubuntu users can add that repository to their system to install the software that it contains.

The post How to Add Apt Repository In Ubuntu & Debian appeared first on TecAdmin.

]]>
https://tecadmin.net/add-apt-repository-ubuntu/feed/ 6
How To Exclude Packages from Apt-Get Upgrade https://tecadmin.net/exclude-packages-from-apt-upgrade/ https://tecadmin.net/exclude-packages-from-apt-upgrade/#comments Sun, 02 Apr 2017 10:36:06 +0000 https://tecadmin.net/?p=12224 Sometimes we upgrade packages accidentally which is not to update. It also happens during the full update or automatic packages upgrade process. This creates serious issues on the server. For example, You need to exclude kernel, PHP, MySQL and Apache packages from getting updated while updating system via apt update. This tutorial will help you [...]

The post How To Exclude Packages from Apt-Get Upgrade appeared first on TecAdmin.

]]>
Sometimes we upgrade packages accidentally which is not to update. It also happens during the full update or automatic packages upgrade process. This creates serious issues on the server. For example, You need to exclude kernel, PHP, MySQL and Apache packages from getting updated while updating system via apt update. This tutorial will help you find the answer of how to exclude packages from Apt-get update? How to use exclude package in Ubuntu? How to prevent packages from auto update using apt?

Hold or Exclude Packages from Upgrade

Use the following command to exclude or hold specific Debian package from an update. This will turn off the updates of specified packages from an automatic upgrade or manual upgrades.

  • Using apt
    sudo apt-mark hold package_name 
    
  • Using dpkg
    echo "package_name hold" | sudo dpkg --set-selections 
    
  • Using aptitude
    sudo aptitude hold package_name 
    

Change the package_name with your actual package name to be set on hold.

List Packages on Hold

You can check the packages on hold anytime. Use the following command to view all packages already set to hold.

sudo dpkg --get-selections | grep "hold" 

exclude package upgrades with apt-get

Unhold or Enable Package Upgrade

In future, If you need to upgrade any package set on hold. You need to unhold any package before an upgrade. Use one of the following commands to unhold any package.

  • Using apt
    sudo apt-mark unhold package_name 
    
  • Using dpkg
    echo "package_name install" | sudo dpkg --set-selections 
    
  • Using aptitude
    sudo aptitude unhold package_name 
    

Now, the unhold packages will be upgraded with apt upgrade or unattended upgrades.

Conclusion

In this tutorial, you have learned to hold packages from unnecessary upgrades. You can remove hold any time from package to allow upgrade again.

The post How To Exclude Packages from Apt-Get Upgrade appeared first on TecAdmin.

]]>
https://tecadmin.net/exclude-packages-from-apt-upgrade/feed/ 4
(Resolved) add-apt-repository command not found – Ubuntu & Debian https://tecadmin.net/add-apt-repository-command-not-found-debain-ubuntu/ https://tecadmin.net/add-apt-repository-command-not-found-debain-ubuntu/#comments Sun, 29 Mar 2015 03:46:27 +0000 https://tecadmin.net/?p=7675 The command add-apt-repository is used for adding PPA reference to our Ubuntu or Debian systems. For newer installations, this command may not available in your system. Use the following commands to add this command utility in your system as per your operating systems. Ubuntu & Debian Latest Version The latest version of Ubuntu 19.10, 18.04, [...]

The post (Resolved) add-apt-repository command not found – Ubuntu & Debian appeared first on TecAdmin.

]]>
The command add-apt-repository is used for adding PPA reference to our Ubuntu or Debian systems. For newer installations, this command may not available in your system. Use the following commands to add this command utility in your system as per your operating systems.

Ubuntu & Debian Latest Version

The latest version of Ubuntu 19.10, 18.04, 16.04 and Debian 10/9/8, add-apt-repository command utility is available under the software-properties-common package. So use the following command to install it.

sudo apt-get install software-properties-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  gir1.2-goa-1.0 gir1.2-snapd-1
Use 'apt autoremove' to remove them.
The following NEW packages will be installed:
  software-properties-common
0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded.
Need to get 0 B/9,912 B of archives.
After this operation, 197 kB of additional disk space will be used.
Selecting previously unselected package software-properties-common.
(Reading database ... 186717 files and directories currently installed.)
Preparing to unpack .../software-properties-common_0.96.24.32.3_all.deb ...
Unpacking software-properties-common (0.96.24.32.3) ...
Processing triggers for man-db (2.8.3-2) ...
Processing triggers for dbus (1.12.2-1ubuntu1) ...
Setting up software-properties-common (0.96.24.32.3) ...

Ubuntu 13.10/Debian 7 and Older Versions

For the Ubuntu 13.10 Systems and Debian 7 (Wheezy) or its earlier versions, the add-apt-repository command is available under the python-software-properties package. Use the following command to install it.

sudo apt-get install python-software-properties

The post (Resolved) add-apt-repository command not found – Ubuntu & Debian appeared first on TecAdmin.

]]>
https://tecadmin.net/add-apt-repository-command-not-found-debain-ubuntu/feed/ 8