LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 06-09-2018, 08:48 PM   #1
whjeon
Member
 
Registered: Feb 2018
Location: Seoul,South Korea
Distribution: Gentoo Linux
Posts: 87

Rep: Reputation: Disabled
$sudo apt upgrade throws errors


Code:
$sudo apt upgrade
throws errors like
Code:
E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/) is another process using it
So I tried some recommendations of google search, and yesterday I found out that when I do
Code:
$sudo apt-get upgrade
No errors reported.

So my questions are 'is it ok to use 'apt' for the update and then upgrade with 'apt-get'?'and 'What do you recommend, only apt-get or only apt?'

Last edited by whjeon; 06-09-2018 at 09:30 PM.
 
Old 06-09-2018, 09:17 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 16,411
Blog Entries: 27

Rep: Reputation: 4928Reputation: 4928Reputation: 4928Reputation: 4928Reputation: 4928Reputation: 4928Reputation: 4928Reputation: 4928Reputation: 4928Reputation: 4928Reputation: 4928
I have encountered this error when I've tried to run apt or apt-get from a terminal when some GUI update-checker is also running.

It is more likely that something that you were unaware of, like an update-checker, was running the background and ran its course than that any differences between apt and apt-get might have caused this.

Here's a nice article about the differences between apt and apt-get: https://itsfoss.com/apt-vs-apt-get-difference/
 
2 members found this post helpful.
Old 06-09-2018, 09:19 PM   #3
whjeon
Member
 
Registered: Feb 2018
Location: Seoul,South Korea
Distribution: Gentoo Linux
Posts: 87

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by frankbell View Post
I have encountered this error when I've tried to run apt or apt-get from a terminal when some GUI update-checker is also running.

It is more likely that something that you were unaware of, like an update-checker, was running the background and ran its course than that any differences between apt and apt-get might have caused this.

Here's a nice article about the differences between apt and apt-get: https://itsfoss.com/apt-vs-apt-get-difference/
Oh! So you mean it(apt-get solved it) was a coincidence!
Thanks for your resource!

Then I'll keep using apt!
 
Old 06-09-2018, 09:29 PM   #4
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 20 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2903Reputation: 2903Reputation: 2903Reputation: 2903Reputation: 2903Reputation: 2903Reputation: 2903Reputation: 2903Reputation: 2903Reputation: 2903Reputation: 2903
Note that your second command says "ugprade", not "upgrade".

There are several applications on your system that can access the package system: apt, dpkg, your update manager, your software manager, Synaptic etc. In order to protect the package system from being corrupted by multiple applications accessing it at the same time, only one application can access it at once. That was the reason for your error, and it shouldn't, as far as I know, have had anything to do with whether you used apt or apt-get. You should test that out.

apt is a more modern implementation of several commands in the APT suite. I prefer to use it myself when I can, and fall back to the various apt commands (apt-get, apt-cache, apt-mark etc.) if the apt command can't quite do what I want it to.

You can mix and match if you want. One of the advantages of apt update is that it will tell you if there are any packages that need upgrading, whereas apt-get update doesn't do that. You'll also notice differences in the progress bars and other minor differences between apt and the other APT suite commands for which it replicates functionality.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Please help me to solve sudo apt-get upgrade error sumit_48 Linux Mint 42 03-23-2018 11:04 AM
Error while executing sudo apt-get upgrade Sammehta Linux - Newbie 1 02-18-2016 06:15 AM
sudo apt-get upgrade not working 14.04 ubuntu zeeshanayub Linux - Newbie 1 10-21-2014 08:15 PM
sudo apt-get update && sudo apt-get upgrade hallve_revera Linux - Newbie 6 01-10-2009 09:37 AM
sudo apt-get upgrade CMXILies Linux - Newbie 3 01-09-2009 07:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 01:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration