4

I would like to update just the base of elementary system and not the all installed apps.

I can run sudo apt-get install package-name to upgrade the package if it is already installed. Whereas I can also run sudo apt-get upgrade to upgrade all the packages.

I want to upgrade just the elementary OS and no other app installed later on. Such as Noise(Music) should be upgraded VLC should not. How do I accomplish this?

4
  • I'm curious: Why?
    – quassy
    Sep 5, 2015 at 12:31
  • @quassy I have a few apps that are quite huge to update frequently thus I need to update the system time to time and update these apps once in a month or two. Sep 5, 2015 at 16:24
  • Interesting, o_O
    – Ravan
    Nov 22, 2015 at 12:38
  • I have edited the post, for better search results. Feel free to revert (roll back) if it diverts your actual post intention :) @Adityaultra
    – Ravan
    Jan 1, 2016 at 14:36

3 Answers 3

3

Using CLI: (Recommended, see pastebin and note)

Keeping on hold: (suggest: use dpkg)

  • Apt

    sudo apt-mark hold package-name
    
  • Dpkg

    sudo -s 
    echo package-name hold | dpkg --set-selections
    apt-get update
    

    Note: Replace package-name with yours, for example, google-chrome-stable

Removing a Hold:

  • Apt

    sudo apt-mark unhold package-name
    
  • Dpkg

    sudo -s 
    echo package-name install | dpkg --set-selections
    apt-get update
    

    Note: This CLI method can hold/lock packages while updating through apt-get upgrade and also using software-updater.


Here my test with google-chrome-stable. You can clearly identify even chrome update is available but that is kept back.

ravan@ravan:~$ apt-cache policy google-chrome-stable
google-chrome-stable:
Installed: 44.0.2403.107-1
Candidate: 46.0.2490.86-1
Version table:
    46.0.2490.86-1 0
       500 http://dl.google.com/linux/chrome/deb/ stable/main amd64 Packages
*** 44.0.2403.107-1 0
    100 /var/lib/dpkg/status
ravan@ravan:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  google-chrome-stable
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

reference here

2

Use synaptic:

Note: This method holds/locks packages when using software-updater but not with apt-get upgrade

To install synaptic, open terminal and run:

sudo apt-get install synaptic

I will consider google-chrome-stable as example:

  • Open synaptic and search for chrome and select it.

  • Hit Package in top menu and choose Force version

    In the dropdown, select the version you like. ( I am not sure this step is necessary for your requirement )

  • Hit Package in top menu and choose "Lock version".

    (then it will change to red color)

    Now your installed version is locked. Therefore Updater will no longer notify you any updates until you unlock it.

Similarly apply lock for installed packages.


Here I have tested with google-chrome-stable

Imgur

Imgur

Before lock:

Imgur

After lock:

Imgur

2

Finally, a simple solution.

Open terminal and run:

sudo nano /etc/apt/preferences 

The above command open the file, if not there, it will create.

Here you want to hold vlc (for example) to specific version.

Now add the following lines to the above file:

Package: vlc
Pin: version 2.1.6-0ubuntu14.04.1
Pin-Priority: -1

Here,

  • Package is package name.

  • Pin is version you want to hold

After that run : sudo apt-get update


Test:

Before pin:

ravan@ravan:~$ apt-cache policy vlc
vlc:
   Installed: 2.1.6-0ubuntu14.04.1
   Candidate: 2.2.1~trusty1

After pin:

ravan@ravan:~$ apt-cache policy vlc
vlc:
    Installed: 2.1.6-0ubuntu14.04.1
    Candidate: 2.1.6-0ubuntu14.04.1
    Package pin: 2.1.6-0ubuntu14.04.1

To revert, remove the content of /etc/apt/preferences file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.