[Advanced] How to: Use Debian repositories simultaneously with Deepin 15.x
Tofloor
poster avatar
jotapesse
deepin
2016-03-04 14:31
Author
Edited by jotapesse at 2016-3-6 20:37

Deepin 15.x is based of Debian Sid (unstable), that means it uses Debian as a base system and is developed on top of it. It also means we may use/install Debian original packages with a reasonable assurance of compatibility with the Deepin system/desktop packages. The best way to do it is to setup APT to use the original Debian repositories simultaneously with Depin repository, while maintaining Deepin's packages with default higher priority. Debian APT makes this easy with APT settings or package pinning.

Why? Imagine you want to install an updated version of a package/application that has its version frozen in Deepin repository. In example, at the time of this writing, there is a newer version of libreoffice available in Debian Sid:
  1. $ apt-cache policy libreoffice
  2. libreoffice:
  3.   Installed: 1:5.1.0~rc2-1deepin1
  4.   Candidate: 1:5.1.0~rc2-1deepin1
  5.   Version table:
  6.     1:5.1.1~rc1-1 500
  7.       500 http://ftp.debian.org/debian sid/main amd64 Packages
  8. *** 1:5.1.0~rc2-1deepin1 990
  9.       990 http://packages.deepin.com/deepin unstable/main amd64 Packages
  10.       100 /var/lib/dpkg/status
Copy the Code

Disclaimer: Danger: Use this procedure at your own risk. Recommended only for advanced users. Valid only for Deepin 15.x release. Although installing Debian original packages guarantees a very high compatibility with Deepin (Debian based) packages, there is a potencial risk for breakage. You may compromise your system by installing other packages than those from Deepin repository. This procedure has worked for me but it may fail for you. Be sure to follow the following steps completely and verify that it's working before trying to install packages or upgrade your system. If you do not accept the risk do not try it. You have been warned.

Disclaimer #2: Warning: Currently there are issues with upgrades if the Deepin source list was not updated succcessfully (failed attempts/bad connections/bad CDN mechanism). Also from Control Center issued updates. It will result in undesired package upgrades from Debian which may compromise your system stability. If you wish to procede and use this how to you are advised to totally refrain from using Control Center Updates (stop using it completely) and always update from the command line and check the successful source list update and policy update before any install/upgrade. View more information at https://bbs.deepin.org/post/30778.

1. Add Debian Official repositories source list:
Create the file /etc/apt/sources.list.d/debian.list
  1. $ sudo nano /etc/apt/sources.list.d/debian.list
Copy the Code
with the following content:
  1. # Debian Sid/Unstable Official repositories

  2. deb http://ftp.debian.org/debian sid main contrib non-free
  3. deb-src http://ftp.debian.org/debian sid main contrib non-free
Copy the Code

2. Setup either APT Default-Release or APT package pinning:

Either option will work, the first option should work until the end of life of 'Deepin 15.x' (release version 2015), the second will work indefinitely (while Deepin maintains the same package/repository origin name 'Linux Deepin'). Choose either 2.1 or 2.2 option procedure, not both:

2.1. (Option) APT Default-Release:
Create the file /etc/apt/apt.conf.d/90deepin
  1. $ sudo nano /etc/apt/apt.conf.d/90deepin
Copy the Code
with the following content:
  1. // APT configuration
  2. // Deepin Default Release
  3. APT::Default-Release "2015";
Copy the Code

2.2. (Option) APT Package Pinning:
Create the file /etc/apt/preferences
  1. $ sudo nano /etc/apt/preferences
Copy the Code
with the following content:
  1. # APT preferences
  2. # Deepin Package Pinning
  3. Package: *
  4. Pin: release o=Linux Deepin
  5. Pin-Priority: 990
Copy the Code

3. Test APT package policy:
You should always test if your APT settings are taking effect in the APT policy, at any time. Always update APT first, then check policy, then install or upgrade packages (if you wish). You should get a priority value of 990 for Deepin repository packages and priority 500 for Debian repository. This means that, by default, only Deepin packages will be installed or upgraded.
  1. $ apt-cache policy
  2. Package files:
  3. 100 /var/lib/dpkg/status
  4.      release a=now
  5. 500 http://ftp.debian.org/debian sid/non-free i386 Packages
  6.      release o=Debian,a=unstable,n=sid,l=Debian,c=non-free,b=i386
  7.      origin ftp.debian.org
  8. 500 http://ftp.debian.org/debian sid/non-free amd64 Packages
  9.      release o=Debian,a=unstable,n=sid,l=Debian,c=non-free,b=amd64
  10.      origin ftp.debian.org
  11. 500 http://ftp.debian.org/debian sid/contrib i386 Packages
  12.      release o=Debian,a=unstable,n=sid,l=Debian,c=contrib,b=i386
  13.      origin ftp.debian.org
  14. 500 http://ftp.debian.org/debian sid/contrib amd64 Packages
  15.      release o=Debian,a=unstable,n=sid,l=Debian,c=contrib,b=amd64
  16.      origin ftp.debian.org
  17. 500 http://ftp.debian.org/debian sid/main i386 Packages
  18.      release o=Debian,a=unstable,n=sid,l=Debian,c=main,b=i386
  19.      origin ftp.debian.org
  20. 500 http://ftp.debian.org/debian sid/main amd64 Packages
  21.      release o=Debian,a=unstable,n=sid,l=Debian,c=main,b=amd64
  22.      origin ftp.debian.org
  23. 990 http://packages.deepin.com/deepin unstable/non-free i386 Packages
  24.      release v=2015,o=Linux Deepin,n=unstable,l=Deepin,c=non-free,b=i386
  25.      origin packages.deepin.com
  26. 990 http://packages.deepin.com/deepin unstable/non-free amd64 Packages
  27.      release v=2015,o=Linux Deepin,n=unstable,l=Deepin,c=non-free,b=amd64
  28.      origin packages.deepin.com
  29. 990 http://packages.deepin.com/deepin unstable/contrib i386 Packages
  30.      release v=2015,o=Linux Deepin,n=unstable,l=Deepin,c=contrib,b=i386
  31.      origin packages.deepin.com
  32. 990 http://packages.deepin.com/deepin unstable/contrib amd64 Packages
  33.      release v=2015,o=Linux Deepin,n=unstable,l=Deepin,c=contrib,b=amd64
  34.      origin packages.deepin.com
  35. 990 http://packages.deepin.com/deepin unstable/main i386 Packages
  36.      release v=2015,o=Linux Deepin,n=unstable,l=Deepin,c=main,b=i386
  37.      origin packages.deepin.com
  38. 990 http://packages.deepin.com/deepin unstable/main amd64 Packages
  39.      release v=2015,o=Linux Deepin,n=unstable,l=Deepin,c=main,b=amd64
  40.      origin packages.deepin.com
Copy the Code
You may check the policy for a specific package, check the example for libreoffice on the top of the post. The same priority values should be visible and there may be different versions available. Deepin packages sould always be the default candidates to install or upgrade, even if their version is lower (unless a Debian package was installed as explained in 5.).

4. Install Deepin packages:
To install any packages from the Deepin repository you don't have to anything different. Either from Deepin Store, Synaptic or using the command line, in example:
  1. $ sudo apt-get install libreoffice
Copy the Code

5. Install (or upgrade to) Debian packages:
You may now upgrade a currently installed or install a new package. All needed newer version dependencies, if required, will also be installed from Debian repository. Use:
  1. $ sudo apt-get -t sid install libreoffice
Copy the Code

That's it. Always update and verify your APT policy first, then install or upgrade from the command line. The use of Control Center System Updates is not recommended!  Have fun! :-)



Reply Favorite View the author
All Replies
2 / 3
To page
jotapesse
deepin
2016-03-07 03:11
#21
https://bbs.deepin.org/post/30778
It shows 5.0.14 as being installed because at the time of upgrading the system that was the newest ...

Hi @dance707 thanks for your feedback. Good find.

In my case I currently have:
  1. $ apt-cache policy virtualbox
  2. virtualbox:
  3.   Installed: 5.0.14-dfsg-2+b1
  4.   Candidate: 5.0.16-dfsg-2
  5.   Version table:
  6.     5.0.16-dfsg-2 500
  7.       500 http://ftp.pt.debian.org/debian sid/contrib amd64 Packages
  8. *** 5.0.14-dfsg-2+b1 100
  9.       100 /var/lib/dpkg/status
  10.     5.0.12-dfsg-2 990
  11.       990 http://packages.deepin.com/deepin unstable/contrib amd64 Packages
Copy the Code
I searched and found that virtualbox was upgraded from 5.0.12 to 5.0.14 by Deepin Control Center upgrade in 2016-02-27. Since Deepin repo doesn't offer that version it came from Debian repo. Why? This seems to be not a priority issue but an issue with the Deepin source lists update. I can only think that the trouble here is Deepin Control Center/Updates.

Because:
1. There are a lot of locked/failed source list update atempts, I have to frequently kill apt-get to update it on the command line;
2. The frequent source list update fails seem to be related to slow repositories/mirror connections or Official CDN response mechanism;
3. Control Center seems to blindly dist-upgrade with no regard for previous failed source list update attempts;
4. With a failed Deepin source list update, APT will use the remaining and only Debian source list but it will lack any higher priority packages (Deepin) to compare and thus will use Debian's resulting in undesired packages being upgraded from Debian.

Conclusion: My proposed how to procedure is highly dependent on proper APT source list updates. Deepin's source list updates are somewhat troublesome currently (slow response/bad mirror connections/bad CDN mechanism). Currently, this must be human verified at the command line. So, in order to not have any undesired package upgraded from Debian you are required to totally refrain from using Deepin's Control Center updates and opt to do it at the command line. From the command line with proper source list update and policy check you sould be safe. I'll update the how to with this findings.

Request: Perhaps Deepin team can see if it can improve Control Center's update/CDN mechanism to support this alternative Debian repositories procedure in the future? Probably a check if Deepin's source list was updated properly and a refusal to upgrade in case of failed update would suffice. Better yet, integrate this alternative in Control Center as an advanced option, as well as automatic updates (Debian unattended-upgrades). I'll suggest this by Deepin user Feedback.
Reply View the author
dance707
deepin
2016-03-07 03:27
#22
https://bbs.deepin.org/post/30778
Hi @dance707 thanks for your feedback. Good find.

In my case I currently have:

Also keep in mind Deepin already uses some what of a modified apt policy with the switching mirrors in /etc/apt/apt.conf.d/99mirrors.conf
Also I noticed line 4 of your code src is enabled but on Deepin it is not. ?
I noticed that it wants to update to 5.0.16 I am okay with that because my server is also that version. But why is it trying to update to 5.0.16 if it was a Deepin package before ?
And users should be aware if they upgrade with this method and then reinstall with a new iso to root next week there vm's will not work.
Reply View the author
jotapesse
deepin
2016-03-07 03:36
#23
https://bbs.deepin.org/post/30778
Also keep in mind Deepin already uses some what of a modified apt policy with the switching mirror ...

Yes I know. deb-src is optional, so that your're able to install packages sources for development/compiling purposes. As I said, probably, as is in my case, your virtualbox package was upgraded from Deepin's 5.0.12 to Debian's 5.0.14 in an earlier Control Center issued update (2016-02-27). Since then, as already is Debian's installed it will recurrently upgrade from Debian and thus upgrade to 5.0.16. To revert that You'll have to explicitly force to install version from Deepin.
Reply View the author
dance707
deepin
2016-03-07 03:49
#24
https://bbs.deepin.org/post/30778
Yes I know. deb-src is optional, so that your're able to install packages sources for development/ ...

We had a user in Asia install version 5.0.14 from Debian . Where he updated Deepin with a new iso and then he was no longer able to open his VM's. But In Debian the enhancement pack that gets installed does not automatically downgrade. and version 5.0.12 will no longer show in the repos. They had trouble finding a solution the user was very concerned. I recognized the error code he provided. Here is a screen shot of my solution for him :
Reply View the author
jotapesse
deepin
2016-03-07 03:55
#25
Disclaimer updated on original post.
Reply View the author
dance707
deepin
2016-03-07 04:01
#26
https://bbs.deepin.org/post/30778
Disclaimer updated on original post.

Okay thank you https://bbs.deepin.org/user/40945
I think for the time being maybe a manual off /on switching method may be better.
Reply View the author
jotapesse
deepin
2016-03-07 04:06
#27
https://bbs.deepin.org/post/30778
We had a user in Asia install version 5.0.14 from Debian . Where he updated Deepin with a new iso  ...

Ok. I'm sorry but I can't read chinese and can't translate the screenshot.

What do you mean "updated with a new ISO"? If he previously customized advanced settings in his Deepin install, how can he update it with a new ISO?

Reply View the author
dance707
deepin
2016-03-07 04:16
#28
https://bbs.deepin.org/post/30778
Ok. I'm sorry but I can't read chinese and can't translate the screenshot.

What do you mean "upda ...

For example if you upgrade the version of Virtual Box and the Virtual Box enhancement pack with your own source. And then reinstall Deepin to the root it downgrades the version of Virtual Box . But in Debian the Virual Box enhancement pack does not get installed to root.
My message there says "The Virtual Box extension package must be in match with the Virtual Box version, you can disable the USB 2.0 , sometimes it will start with the wrong extensions package".
So in Debian the correct extensions pack will no longer show in the repositories so must manually install or disable the USB 2.0 to start your VM
Reply View the author
jotapesse
deepin
2016-03-07 04:30
#29
https://bbs.deepin.org/post/30778
For example if you upgrade the version of Virtual Box and the Virtual Box enhancement pack with yo ...

I see. Is virtualbox pre-installed in Deepin ISO? Not the best option, I guess. Also a Deepin downgrade with an ISO reinstall also isn't recommend if the system was customized with any foreign package. A full fresh reinstall is advised and a separate /home partition is recommended.
Reply View the author
dance707
deepin
2016-03-07 04:36
#30
No Virtual Box is not pre-installed on the Deepin ISO . your miss understanding here is a screen shot of my extension pack after I reinstalled Deepin 15.1 and installed Virtual Box from the Deepin repositories
Reply View the author
dance707
deepin
2016-03-07 04:38
#31
https://bbs.deepin.org/post/30778
No Virtual Box is not pre-installed on the Deepin ISO . your miss understanding here is a screen sho ...

You can see the problem is that the extension pack does not get downgraded and the VM will fail to start.
Reply View the author
jotapesse
deepin
2016-03-07 04:44
#32
https://bbs.deepin.org/post/30778
No Virtual Box is not pre-installed on the Deepin ISO . your miss understanding here is a screen sho ...

Ok, I understand. But my reply still stands. Never, never downgrade any system install with an ISO if you have installed foreign packages, that's the result of it. A fresh reinstall is advised. It happened with virtualbox but it may happen with any other package. Anyway this case is easily solved by removing the foreign package and reinstalling from Deepin (but that would be prevented if a full fresh install took place).
Reply View the author
dance707
deepin
2016-03-07 04:48
#33
https://bbs.deepin.org/post/30778
Ok, I understand. But my reply still stands. Never, never downgrade any system install with an ISO ...

Okay but remember you said that Deepin upgraded the version to 5.0.14 on 2016-02-27
And a fresh install does not fix the problem. Must manually fix the problem.
Reply View the author
jotapesse
deepin
2016-03-07 04:54
#34
Edited by jotapesse at 2016-3-6 12:56
https://bbs.deepin.org/post/30778
Okay but remember you said that Deepin upgraded the version to 5.0.14 on 2016-02-27
And a fresh in ...

A full fresh reinstall (root partition formatted) fixes everything. All previous packages are cleared with the root partion being formatted so no residues or foreign packages are kept. To keep the /home intact you should have previously installed /home in a separate partition (obviously you don't format this one, unless you want to clear all your data). And I said that an update issued from Control Center upgraded the virtualbox (5.0.12) package to Debian's version (5.0.14) foreign package.
Reply View the author
dance707
deepin
2016-03-07 04:58
#35
https://bbs.deepin.org/post/30778
A full fresh reinstall (root partition formatted) fixes everything. All previous packages are clea ...

In my example I did a fresh reinstall to root and formatted. and the extensions pack remains at 5.0.14 just like it did with the user in Asia.
Reply View the author
dance707
deepin
2016-03-07 05:01
#36
https://bbs.deepin.org/post/30778
In my example I did a fresh reinstall to root and formatted. and the extensions pack remains at 5. ...

This is just one example of how getting a slightly newer version of a application you want will cause a lot of trouble. For most users it is best just to wait on Deepin
Reply View the author
dance707
deepin
2016-03-07 05:54
#37
https://bbs.deepin.org/post/30778
This is just one example of how getting a slightly newer version of a application you want will ca ...

Remember that in Virtual Box unlike KVM or QEMU the virtual machine resides on the home partition. The Virtual Box extensions package attaches it self to the virtual machine. In many distributions this package is not supplied in the repositories.
Reply View the author
jotapesse
deepin
2016-03-07 09:02
#38
https://bbs.deepin.org/post/30778
In my example I did a fresh reinstall to root and formatted. and the extensions pack remains at 5. ...

Very strange. I did not knew that, I presumed that the package would be like any other and I find that awkward. I did not test that but if that's the case then I stand corrected.
Reply View the author
jotapesse
deepin
2016-03-07 09:08
#39
https://bbs.deepin.org/post/30778
This is just one example of how getting a slightly newer version of a application you want will ca ...

Absolutely! Everyone should be aware that by upgrading packages to newer versions might also bring new problems. Not always new is best. The use of the proposed how to in this thread is for advanced users willing to take the risk and accept any undesired result as a consequence. If you want your system stable just don't mess with it! :-)
Reply View the author
dance707
deepin
2016-03-07 12:41
#40
https://bbs.deepin.org/post/30778
Very strange. I did not knew that, I presumed that the package would be like any other and I find  ...

That is why solving the problem in the Asia thread was so difficult for them as they had never encountered that error message before. And the user did not provided screen shots. Though my message to the user was not elegant in technical way, it quickly instructed the worried user how to work around the problem and gain access once again to his windows 7 virtual machine.
Reply View the author
2 / 3
To page
New Thread

Popular Events

More
国际排名
WHLUG